let nameDiv = `<div style="width:${this.hostRemoteVideoWidth}px;height:20px;position:absolute;bottom:0;z-index:1;overflow:hidden;font-size:14px;text-align:right;color:#cccccc;display:${this.nameDisplay}">${userName}</div>`;
//把远程视图添加到老师列表
loger.log("获取远程视频流成功->userRole:"+userRole+":" + userName + "->" + uid, new Date().getTime());
let viewDiv = `<div id="${this.xdyRemote+uid}" class="${this.hostWebRtcVideoClass}" style="width:${this.hostRemoteVideoWidth*this.videoScale}px;height:${this.hostRemoteVideoHeight*this.videoScale}px;float:left;margin-right:1px;pointer-events:none;">${nameDiv}</div>`;
$(this.hostRemoteViewId).prepend(viewDiv);
} else {
let nameDiv = `<div style="width:${this.normalRemoteVideoWidth}px;height:20px;position:absolute;bottom:0;z-index:1;overflow:hidden;font-size:14px;text-align:right;color:#cccccc;display:${this.nameDisplay}">${userName}</div>`;
//把视图添加到学生列表
loger.log("获取远程视频流成功->学生:" + userName + "->" + uid, new Date().getTime());
let viewDiv = `<div id="${this.xdyRemote+uid}" class="${this.normalWebRtcVideoClass}" style="width:${this.normalRemoteVideoWidth*this.videoScale}px;height:${this.normalRemoteVideoHeight*this.videoScale}px;float:left;margin-right:1px;pointer-events:none;">${nameDiv}</div>`;
...
...
@@ -217,12 +226,59 @@ class WebRtcApe extends Emiter {
$("bar_" + stream.getId()).hide();
stream.play(this.xdyRemote + stream.getId());
} catch (err) {
//添加之前先删除之前存在的重复视图
let len=$("#"+this.xdyRemote + uid+"#player_" + uid).length;