| | |
| | | } |
| | | // Subscribe when a remote user publishes a stream |
| | | agoraClient.on('user-joined', async (user: IAgoraRTCRemoteUser) => { |
| | | message.info('user[' + user.uid + '] join') |
| | | message.info('用户[' + user.uid + '] 加入') |
| | | }) |
| | | agoraClient.on('user-published', async (user: IAgoraRTCRemoteUser, mediaType: 'audio' | 'video') => { |
| | | await agoraClient.subscribe(user, mediaType) |
| | |
| | | }) |
| | | agoraClient.on('user-unpublished', async (user: any) => { |
| | | console.log('unpublish live:', user) |
| | | message.info('unpublish live') |
| | | message.info('取消发布') |
| | | }) |
| | | agoraClient.on('exception', async (e: any) => { |
| | | console.log(e) |
| | |
| | | } |
| | | const onUpdateQuality = () => { |
| | | if (!livePara.liveState) { |
| | | message.info('Please turn on the livestream first.') |
| | | message.info('请先打开直播') |
| | | return |
| | | } |
| | | setLivestreamQuality({ |
| | |
| | | |
| | | const onSwitch = () => { |
| | | if (dronePara.lensSelected === undefined || dronePara.lensSelected === nonSwitchable) { |
| | | message.info('The ' + nonSwitchable + ' lens cannot be switched, please select the lens to be switched.', 8) |
| | | message.info('当前 ' + nonSwitchable + ' 镜头无法切换,请选择要切换的镜头', 8) |
| | | return |
| | | } |
| | | changeLivestreamLens({ |