|
@@ -9,11 +9,11 @@
|
|
|
<span class="live-name">{{ roomData.name }}</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-button @click="getDevice">获取设备列表</el-button>
|
|
|
+ <!-- <el-button @click="playAudio">开启本地流声音</el-button> -->
|
|
|
<template v-if="userType === 'TEACHER'">
|
|
|
<el-button v-if="!liveStat" @click="startLive">开启直播</el-button>
|
|
|
<el-button v-if="liveStat" @click="closeLiveRoom">结束直播</el-button>
|
|
|
- <el-button @click="publishStream">推流</el-button>
|
|
|
+ <el-button v-if="liveStat" @click="publishStream">推流</el-button>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -22,8 +22,16 @@
|
|
|
<div class="live-container">
|
|
|
<!-- 左侧 -->
|
|
|
<div class="live-container-left">
|
|
|
- <div v-show="connection" id="student"></div>
|
|
|
- <div v-show="!connection" id="draw-parent">
|
|
|
+ <div v-show="callLoading" class="loading">
|
|
|
+ <div class="loading-wrapper">
|
|
|
+ <p class="loading-title">正在呼叫,等待对方接通...</p>
|
|
|
+ <!-- <div>
|
|
|
+ <el-button type="danger" icon="el-icon-phone-outline" circle></el-button>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="connect" id="student"></div>
|
|
|
+ <div v-show="isDraw" id="draw-parent">
|
|
|
<div v-show="isDrawSetting" class="draw-setting">
|
|
|
<span class="brush-shape">
|
|
|
<svg-icon icon-class="brush-shape" />
|
|
@@ -166,9 +174,13 @@ export default {
|
|
|
return {
|
|
|
userType: this.$store.state.user.user_type,
|
|
|
task_id: this.$route.query.task_id,
|
|
|
- connection: false,
|
|
|
+ // 已连接
|
|
|
+ connect: false,
|
|
|
+ // 等待接通
|
|
|
+ callLoading: false,
|
|
|
dialogVisible: false,
|
|
|
dialogVisibleMaterial: false,
|
|
|
+ // 资料信息
|
|
|
material_id: '',
|
|
|
material_name: '',
|
|
|
material_type: '',
|
|
@@ -202,9 +214,16 @@ export default {
|
|
|
drawThicknessList: ['1', '3', '5'],
|
|
|
// 直播间学员列表
|
|
|
student_list: [],
|
|
|
+ // 直播状态
|
|
|
liveStat: false
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ // 画板模式
|
|
|
+ isDraw() {
|
|
|
+ return !this.connect && !this.callLoading;
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
loadedNumber(newValue) {
|
|
|
if (newValue === 5) {
|
|
@@ -345,28 +364,43 @@ export default {
|
|
|
|
|
|
// 老师邀请学生上麦
|
|
|
invite(uid, mode) {
|
|
|
- GetLiveRoomInfo({ task_id: this.task_id }).then(({ video_mode }) => {
|
|
|
- if (video_mode === mode) {
|
|
|
- common.invite(uid);
|
|
|
- } else {
|
|
|
- common.roomUpdate({
|
|
|
- video_mode: mode,
|
|
|
- roomUpdateSuccess: function (data) {
|
|
|
- console.log(data, '连麦音视频模式更新请求成功!');
|
|
|
- common.invite(uid);
|
|
|
- },
|
|
|
- roomUpdateFailed: function (data) {
|
|
|
- console.log(data, '连麦音视频模式更新请求失败! 请稍后再试!');
|
|
|
- this.$message.error('连麦音视频模式更新请求失败! 请稍后再试!');
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ this.callLoading = true;
|
|
|
+ GetLiveRoomInfo({ task_id: this.task_id })
|
|
|
+ .then(({ video_mode }) => {
|
|
|
+ if (video_mode === mode) {
|
|
|
+ common.invite(uid);
|
|
|
+ } else {
|
|
|
+ common.roomUpdate({
|
|
|
+ video_mode: mode,
|
|
|
+ roomUpdateSuccess: function (data) {
|
|
|
+ console.log(data, '连麦音视频模式更新请求成功!');
|
|
|
+ common.invite(uid);
|
|
|
+ },
|
|
|
+ roomUpdateFailed: function (data) {
|
|
|
+ console.log(data, '连麦音视频模式更新请求失败! 请稍后再试!');
|
|
|
+ this.$message.error('连麦音视频模式更新请求失败! 请稍后再试!');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.callLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
// 下麦
|
|
|
handsDown(uid) {
|
|
|
- common.handsDown(uid);
|
|
|
+ common.handsDown({
|
|
|
+ uid,
|
|
|
+ success: str => {
|
|
|
+ this.callLoading = false;
|
|
|
+ console.log('下麦成功', str);
|
|
|
+ this.$message.success('下麦成功');
|
|
|
+ },
|
|
|
+ fail: data => {
|
|
|
+ console.log('下麦失败', data);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
// 发消息
|
|
@@ -416,6 +450,10 @@ export default {
|
|
|
common.publishStream('main');
|
|
|
},
|
|
|
|
|
|
+ playAudio() {
|
|
|
+ common.playAudio();
|
|
|
+ },
|
|
|
+
|
|
|
dialogClose() {
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
@@ -481,6 +519,11 @@ $live-bc: #3d3938;
|
|
|
&-info {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 7px 12px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
&-name {
|
|
@@ -498,6 +541,25 @@ $live-bc: #3d3938;
|
|
|
background-color: #fff;
|
|
|
border-radius: 8px;
|
|
|
|
|
|
+ .loading {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 468px;
|
|
|
+ color: #fff;
|
|
|
+ background-color: #646464;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ &-wrapper {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .loading-title {
|
|
|
+ margin-bottom: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#student {
|
|
|
width: 100%;
|
|
|
height: 468px;
|
|
@@ -713,10 +775,5 @@ $live-bc: #3d3938;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .el-button {
|
|
|
- border-radius: 4px;
|
|
|
- padding: 7px 12px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|