|  | @@ -31,11 +31,11 @@ function publishStream(streamName) {
 | 
	
		
			
				|  |  |    rtc.publish({
 | 
	
		
			
				|  |  |      streamName,
 | 
	
		
			
				|  |  |      // 推流成功,更新上麦结果
 | 
	
		
			
				|  |  | -    success: stream => {
 | 
	
		
			
				|  |  | +    success: (stream) => {
 | 
	
		
			
				|  |  |        console.log('推流成功', stream);
 | 
	
		
			
				|  |  |        updateMcResult(stream.id(), 1);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    fail: str => {
 | 
	
		
			
				|  |  | +    fail: (str) => {
 | 
	
		
			
				|  |  |        // 推流失败,更新上麦结果
 | 
	
		
			
				|  |  |        console.log('推流失败,更新上麦结果', str);
 | 
	
		
			
				|  |  |        updateMcResult('', 0);
 | 
	
	
		
			
				|  | @@ -80,7 +80,7 @@ export function closeVideoTeacher(options) {
 | 
	
		
			
				|  |  |   * 初始化监听事件
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  export function initListener(vue) {
 | 
	
		
			
				|  |  | -  rtc.on('login_success', data => {
 | 
	
		
			
				|  |  | +  rtc.on('login_success', (data) => {
 | 
	
		
			
				|  |  |      console.log('登录成功', data);
 | 
	
		
			
				|  |  |      vue.roomData = data;
 | 
	
		
			
				|  |  |      // 初始化画板需要的数据
 | 
	
	
		
			
				|  | @@ -94,7 +94,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |      rtc.canvasInit(canvasInitData);
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('login_failed', data => {
 | 
	
		
			
				|  |  | +  rtc.on('login_failed', (data) => {
 | 
	
		
			
				|  |  |      console.log('登录失败', data);
 | 
	
		
			
				|  |  |      Message({
 | 
	
		
			
				|  |  |        message: `${i18n.t('Key443')}:${JSON.stringify(data)}`,
 | 
	
	
		
			
				|  | @@ -130,8 +130,8 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        const isVideo = device.video.length > 0 && data.video.some(item => item.deviceId === device.video);
 | 
	
		
			
				|  |  | -        const isAudio = device.audio.length > 0 && data.audio.some(item => item.deviceId === device.audio);
 | 
	
		
			
				|  |  | +        const isVideo = device.video.length > 0 && data.video.some((item) => item.deviceId === device.video);
 | 
	
		
			
				|  |  | +        const isAudio = device.audio.length > 0 && data.audio.some((item) => item.deviceId === device.audio);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (!isVideo && !isAudio) {
 | 
	
		
			
				|  |  |            vue.setDevice(false);
 | 
	
	
		
			
				|  | @@ -149,7 +149,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('conference_join_failed', err => {
 | 
	
		
			
				|  |  | +  rtc.on('conference_join_failed', (err) => {
 | 
	
		
			
				|  |  |      // 加入房间失败  err为错误原因
 | 
	
		
			
				|  |  |      console.log('加入房间失败', err);
 | 
	
		
			
				|  |  |      Message({
 | 
	
	
		
			
				|  | @@ -159,7 +159,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 新增订阅流事件
 | 
	
		
			
				|  |  | -  rtc.on('allow_sub', tryStream => {
 | 
	
		
			
				|  |  | +  rtc.on('allow_sub', (tryStream) => {
 | 
	
		
			
				|  |  |      if (tryStream.isMixed()) {
 | 
	
		
			
				|  |  |        console.log('是混合流,不订阅');
 | 
	
		
			
				|  |  |      } else {
 | 
	
	
		
			
				|  | @@ -207,61 +207,61 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 房间全量信息事件(人员进出时广播)
 | 
	
		
			
				|  |  | -  rtc.on('room_context', roomData => {
 | 
	
		
			
				|  |  | +  rtc.on('room_context', (roomData) => {
 | 
	
		
			
				|  |  |      vue.roomContext = JSON.parse(roomData);
 | 
	
		
			
				|  |  |      vue.getLiveRoomData_DRTD();
 | 
	
		
			
				|  |  |      console.log('房间全量信息事件(人员进出时广播)', JSON.parse(roomData));
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('publish_stream', str => {
 | 
	
		
			
				|  |  | +  rtc.on('publish_stream', (str) => {
 | 
	
		
			
				|  |  |      console.log('直播已开启', str);
 | 
	
		
			
				|  |  |      vue.liveStat = true;
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('end_stream', str => {
 | 
	
		
			
				|  |  | +  rtc.on('end_stream', (str) => {
 | 
	
		
			
				|  |  |      console.log('直播已关闭', str);
 | 
	
		
			
				|  |  |      vue.liveStat = false;
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('switch_user_settings', settingData => {
 | 
	
		
			
				|  |  | +  rtc.on('switch_user_settings', (settingData) => {
 | 
	
		
			
				|  |  |      // 单个用户配置监听
 | 
	
		
			
				|  |  |      console.log(settingData);
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 人员列表事件(人员麦序变化时广播)
 | 
	
		
			
				|  |  | -  rtc.on('speak_context', speakData => {
 | 
	
		
			
				|  |  | +  rtc.on('speak_context', (speakData) => {
 | 
	
		
			
				|  |  |      vue.speakData = JSON.parse(speakData);
 | 
	
		
			
				|  |  |      console.log('人员列表事件(人员麦序变化时广播)', JSON.parse(speakData));
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  rtc.on('switch_settings', data => {
 | 
	
		
			
				|  |  | +  rtc.on('switch_settings', (data) => {
 | 
	
		
			
				|  |  |      console.log('房间设置事件', data); // 房间设置事件
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 网络整体状态事件
 | 
	
		
			
				|  |  | -  rtc.on('netStatus', data => {
 | 
	
		
			
				|  |  | +  rtc.on('netStatus', (data) => {
 | 
	
		
			
				|  |  |      vue.netStatus = data.netStatus;
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 单条流状态通知事件
 | 
	
		
			
				|  |  | -  rtc.on('streamStatus', data => {
 | 
	
		
			
				|  |  | +  rtc.on('streamStatus', (data) => {
 | 
	
		
			
				|  |  |      console.log(data);
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 推流异常断开事件
 | 
	
		
			
				|  |  | -  rtc.on('publishStreamErr', data => {
 | 
	
		
			
				|  |  | +  rtc.on('publishStreamErr', (data) => {
 | 
	
		
			
				|  |  |      // 直播开启状态下,尝试重推这条流
 | 
	
		
			
				|  |  |      console.log(`推流意外终止:${data.streamName}`);
 | 
	
		
			
				|  |  |      publishStream('main');
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 视频无法自动播放
 | 
	
		
			
				|  |  | -  rtc.on('playError', data => {
 | 
	
		
			
				|  |  | +  rtc.on('playError', (data) => {
 | 
	
		
			
				|  |  |      console.log('视频无法自动播放', data);
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 监听通知移除流事件
 | 
	
		
			
				|  |  | -  rtc.on('stream_removed', stream => {
 | 
	
		
			
				|  |  | +  rtc.on('stream_removed', (stream) => {
 | 
	
		
			
				|  |  |      console.log('监听通知移除流事件', stream);
 | 
	
		
			
				|  |  |      if ('room_user_id' in vue.connectStudent && stream.streamType() === 10 && vue.connect) {
 | 
	
		
			
				|  |  |        vue.handsDown();
 | 
	
	
		
			
				|  | @@ -271,7 +271,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 停止订阅流
 | 
	
		
			
				|  |  | -  rtc.on('unSub', unSubStream => {
 | 
	
		
			
				|  |  | +  rtc.on('unSub', (unSubStream) => {
 | 
	
		
			
				|  |  |      console.log('停止订阅流', unSubStream);
 | 
	
		
			
				|  |  |      rtc.unSubscribeStream({
 | 
	
		
			
				|  |  |        unSubStream,
 | 
	
	
		
			
				|  | @@ -286,7 +286,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 用户退出房间通知其他人员事件
 | 
	
		
			
				|  |  | -  rtc.on('exit_room_user', data => {
 | 
	
		
			
				|  |  | +  rtc.on('exit_room_user', (data) => {
 | 
	
		
			
				|  |  |      console.log('用户退出房间通知其他人员事件', data);
 | 
	
		
			
				|  |  |      vue.studentExitLiveRoom(data.id, false);
 | 
	
		
			
				|  |  |    });
 | 
	
	
		
			
				|  | @@ -296,7 +296,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 监听自己被邀请事件
 | 
	
		
			
				|  |  | -  rtc.on('inviteUp', uid => {
 | 
	
		
			
				|  |  | +  rtc.on('inviteUp', (uid) => {
 | 
	
		
			
				|  |  |      console.log('监听自己被邀请事件', uid);
 | 
	
		
			
				|  |  |      rtc.inviteAccept({
 | 
	
		
			
				|  |  |        success(str) {
 | 
	
	
		
			
				|  | @@ -311,7 +311,7 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  |     * 监听聊天事件
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | -  rtc.on('chat_message', data => {
 | 
	
		
			
				|  |  | +  rtc.on('chat_message', (data) => {
 | 
	
		
			
				|  |  |      const dat = JSON.parse(data);
 | 
	
		
			
				|  |  |      console.log(dat);
 | 
	
		
			
				|  |  |      // 敏感词过滤:如果发送的聊天消息被系统判定包含敏感词,则只有发送者能收到本条消息,房间内其他人都不会收到这条聊天消息。
 | 
	
	
		
			
				|  | @@ -330,13 +330,13 @@ export function initListener(vue) {
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 画笔数据事件
 | 
	
		
			
				|  |  | -  rtc.on('draw', data => {
 | 
	
		
			
				|  |  | +  rtc.on('draw', (data) => {
 | 
	
		
			
				|  |  |      const drawData = JSON.parse(data);
 | 
	
		
			
				|  |  |      console.log('画笔数据事件', drawData);
 | 
	
		
			
				|  |  |    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 接收自定义消息
 | 
	
		
			
				|  |  | -  rtc.on('publish_message', data => {
 | 
	
		
			
				|  |  | +  rtc.on('publish_message', (data) => {
 | 
	
		
			
				|  |  |      // 连接中途下麦
 | 
	
		
			
				|  |  |      if (data.type === 'handsDown-load-student' && data.uid === vue.connectUid) {
 | 
	
		
			
				|  |  |        vue.callLoading = false;
 | 
	
	
		
			
				|  | @@ -404,10 +404,10 @@ export function stopLive() {
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  export function publishShareStream() {
 | 
	
		
			
				|  |  |    rtc.publishShareStream({
 | 
	
		
			
				|  |  | -    success: stream => {
 | 
	
		
			
				|  |  | +    success: (stream) => {
 | 
	
		
			
				|  |  |        console.log('推送桌面共享成功', stream);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    fail: str => {
 | 
	
		
			
				|  |  | +    fail: (str) => {
 | 
	
		
			
				|  |  |        console.log(str);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    });
 |