|
@@ -93,7 +93,7 @@ export class LiveService {
|
|
|
};
|
|
|
this.timer && clearTimeout(this.timer);
|
|
|
this.timer_countdown && clearInterval(this.timer_countdown);
|
|
|
- this.timer_countdown = null
|
|
|
+ this.timer_countdown = null;
|
|
|
this.options['token'] = '';
|
|
|
this.options['channel'] = '';
|
|
|
this.user_published_list = [];
|
|
@@ -587,16 +587,14 @@ export class LiveService {
|
|
|
|
|
|
/* 切换摄像头 */
|
|
|
async changeCamera() {
|
|
|
- const oldCameras = await AgoraRTC.getCameras(true);
|
|
|
- console.log('oldCameras:', oldCameras);
|
|
|
- let newCamers = oldCameras.find(
|
|
|
- (item: any) => item.deviceId !== this.currentUsedDevice.videoDevice
|
|
|
- );
|
|
|
- console.log(newCamers);
|
|
|
- newCamers &&
|
|
|
- (await this.localTracks.videoTrack.setDevice({
|
|
|
- cameraId: newCamers.deviceId,
|
|
|
- }));
|
|
|
+ // const oldCameras = await AgoraRTC.getCameras(true);
|
|
|
+ // console.log('oldCameras:', oldCameras);
|
|
|
+ // let newCamers = oldCameras.find(
|
|
|
+ // (item: any) => item.deviceId !== this.currentUsedDevice.videoDevice
|
|
|
+ // );
|
|
|
+ // console.log(newCamers);
|
|
|
+ // newCamers &&
|
|
|
+ // (await this.localTracks.videoTrack.setDevice(newCamers.deviceId));
|
|
|
// .then(() => {
|
|
|
// this.tools['camera'] = !this.tools['camera'];
|
|
|
// this.currentUsedDevice.videoDevice = newCamers.deviceId;
|
|
@@ -607,8 +605,9 @@ export class LiveService {
|
|
|
// this.currentUsedDevice.videoDevice = newCamers.deviceId;
|
|
|
// this.alertTips('切换摄像头失败');
|
|
|
// });
|
|
|
+ await this.localTracks.videoTrack.setDevice({facingMode: this.tools['camera'] ? 'user' : 'environment'})
|
|
|
this.tools['camera'] = !this.tools['camera'];
|
|
|
- this.currentUsedDevice.videoDevice = newCamers.deviceId;
|
|
|
+ // this.currentUsedDevice.videoDevice = newCamers.deviceId;
|
|
|
return true;
|
|
|
}
|
|
|
/* 切换美颜 */
|