Kaynağa Gözat

切换前后摄像头

zhangli 4 yıl önce
ebeveyn
işleme
a27954a3bf
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      pagesMedia/liveDetail.vue

+ 6 - 0
pagesMedia/liveDetail.vue

@@ -1,6 +1,9 @@
 <template>
 	<view class="container">
 		<trtc-room ref="trtc-component" :config="rtcConfig"> </trtc-room>
+		<view style="position: absolute;bottom: 0px;#000000;color: #FFFFFF;margin: 30px;" @click="changeCamera()">
+			切换摄像头
+		</view>
 		<view class="popup-open" @click="popupShow = true">
 			<view class="iconfont iconzhibo-shangpin"></view>
 		</view>
@@ -303,6 +306,9 @@
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_AUDIO_REMOVE, event => {
 					console.log('* room REMOTE_AUDIO_REMOVE', event, this.trtcComponent.getRemoteUserList());
 				});
+			},
+			changeCamera: function() {
+				this.trtcComponent.switchCamera();
 			}
 		},
 	}