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