tj
This commit is contained in:
parent
748ab4c25d
commit
38e1bc3215
@ -53,6 +53,7 @@
|
||||
|
||||
<script>
|
||||
import TRTC from 'trtc-sdk-v5';
|
||||
import videoTelephone from "@/services/videoTelephone";
|
||||
export default {
|
||||
props: {
|
||||
eventDialog: {
|
||||
@ -66,12 +67,13 @@ export default {
|
||||
return {
|
||||
zoomActive: true,// true 放大状态、false 缩小状态
|
||||
|
||||
roomId: '',
|
||||
sdkAppId: '',
|
||||
roomId: 0,
|
||||
sdkAppId: 0,
|
||||
userId: '',
|
||||
userSig: '',
|
||||
cameraId: '',// 本地视频通道
|
||||
microphoneId: '',// 本地音频通道
|
||||
camStatus: false,// 本地流
|
||||
vidStatus: false,// 本地视频状态
|
||||
micStatus: false,// 本地音频状态
|
||||
|
||||
@ -95,7 +97,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMedia()
|
||||
this.initMedia();
|
||||
this.getRoomArgument();
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
@ -113,6 +116,19 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 获取房间参数
|
||||
getRoomArgument() {
|
||||
videoTelephone.getEnterById({id: this.eventDialog.id}).then((res) => {
|
||||
let {roomId, sdkAppId, userId, userSig} = res;
|
||||
this.roomId = roomId;
|
||||
this.sdkAppId = sdkAppId;
|
||||
this.userId = userId;
|
||||
this.userSig = userSig;
|
||||
console.log(res, '---房间参数')
|
||||
this.handleEnterRoom();
|
||||
});
|
||||
},
|
||||
|
||||
// 获取视频、音频权限
|
||||
async getDeviceList() {
|
||||
let camera = await TRTC.getCameraList();
|
||||
@ -137,13 +153,6 @@ export default {
|
||||
},
|
||||
// 获取进入房间的参数
|
||||
handleEnterRoom() {
|
||||
let data = {
|
||||
sdkSecretKey: '',
|
||||
sdkAppId: '',
|
||||
userId: '',
|
||||
roomId: '',
|
||||
userSig: ''
|
||||
}
|
||||
this.enterRoom();
|
||||
this.handleStartLocalAudio();
|
||||
this.handleStartLocalVideo();
|
||||
@ -153,7 +162,8 @@ export default {
|
||||
try {
|
||||
await this.trtc.enterRoom({
|
||||
roomId: this.roomId,
|
||||
sdkAppId: parseInt(this.sdkAppId, 10),
|
||||
// sdkAppId: parseInt(this.sdkAppId, 10),
|
||||
sdkAppId: this.sdkAppId,
|
||||
userId: this.userId,
|
||||
userSig: this.userSig,
|
||||
});
|
||||
@ -200,12 +210,13 @@ export default {
|
||||
}
|
||||
try {
|
||||
await this.trtc.startLocalVideo({
|
||||
view: 'local',
|
||||
view: 'realTimeVideo0',
|
||||
option: {
|
||||
cameraId: this.cameraId,
|
||||
profile: '1080p',
|
||||
},
|
||||
});
|
||||
this.camStatus = true;
|
||||
this.vidStatus = true;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
@ -275,6 +286,7 @@ export default {
|
||||
},
|
||||
// 远端进入房间
|
||||
handleRemoteVideoAvailable(event) {
|
||||
console.log(event, '---event远端进入房间')
|
||||
const { userId, streamType } = event;
|
||||
try {
|
||||
let data = {
|
||||
@ -293,6 +305,7 @@ export default {
|
||||
},
|
||||
// 远端退出房间
|
||||
handleRemoteVideoUnavailable(event) {
|
||||
console.log(event, '---event远端退出房间')
|
||||
const { streamType } = event;
|
||||
this.trtc.stopRemoteVideo({ userId: event.userId, streamType });
|
||||
this.personnelNumber--;
|
||||
|
||||
@ -27,14 +27,18 @@
|
||||
<div class="f12">{{item.content}}</div>
|
||||
<div class="flex-row align-items-center">
|
||||
<div class="f16 mr-8 cursor-pointer"
|
||||
@click="handleVideoCall">
|
||||
v-if="item.roomId && item.sdkAppId && item.userId && item.userSig"
|
||||
@click="handleVideoCall(item)">
|
||||
<i class="el-icon-video-camera"></i>
|
||||
</div>
|
||||
<div class="f16 mr-8 cursor-pointer"
|
||||
v-if="item.status.code === 0"
|
||||
@click="VideoEditDialog={id:item.id, bookingTime:item.bookingTime}">
|
||||
<i class="el-icon-edit-outline"></i>
|
||||
</div>
|
||||
<div class="f16 mr-8 cursor-pointer" @click="handleBackCase(item)">
|
||||
<div class="f16 mr-8 cursor-pointer"
|
||||
v-if="item.status.code === 1"
|
||||
@click="handleBackCase(item)">
|
||||
<i class="el-icon-delete"></i>
|
||||
</div>
|
||||
</div>
|
||||
@ -49,7 +53,7 @@
|
||||
<!-- 视频预约修改 -->
|
||||
<videoReservationEditDialog v-if="VideoEditDialog" :eventDialog.sync="VideoEditDialog" />
|
||||
<!-- 视频房间 -->
|
||||
<VideoRoom v-if="VideoCallDialog" :eventDialog.sync="VideoCallDialog" />
|
||||
<!-- <VideoRoom v-if="VideoCallDialog" :eventDialog.sync="VideoCallDialog" />-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -60,7 +64,7 @@ export default {
|
||||
components: {
|
||||
VideoReservationDialog: () => import('./VideoReservationDialog'),//视频预约
|
||||
videoReservationEditDialog: () => import('../../event-tracing/components/videoReservationDialog'),//视频预约修改
|
||||
VideoRoom: () => import('./VideoRoom'),
|
||||
// VideoRoom: () => import('./VideoRoom'),
|
||||
},
|
||||
props: {
|
||||
visiblePopover: {
|
||||
@ -84,7 +88,7 @@ export default {
|
||||
videoTableData: [],
|
||||
VideoDialog: null,
|
||||
VideoEditDialog: null,
|
||||
VideoCallDialog: null
|
||||
// VideoCallDialog: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -125,7 +129,13 @@ export default {
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleVideoCall(item) {
|
||||
this.$parent.VideoCallDialog = {id: item.id}
|
||||
this.$parent.VideoCallDialog = {
|
||||
id: item.id,
|
||||
roomId: item.roomId,
|
||||
sdkAppId: item.sdkAppId,
|
||||
userId: item.userId,
|
||||
userSig: item.userSig
|
||||
}
|
||||
// this.VideoCallDialog = {
|
||||
// id: item.id
|
||||
// }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user