|
@@ -243,25 +243,20 @@
|
|
|
></simple-image-preview>
|
|
|
|
|
|
<!-- 通话弹出层 -->
|
|
|
- <el-dialog
|
|
|
- custom-class="communication-dialog"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="600px"
|
|
|
- :show-close="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :close-on-click-modal="false"
|
|
|
- append-to-body
|
|
|
- fullscreen
|
|
|
+ <div
|
|
|
+ v-if="dialogVisible"
|
|
|
+ class="communication-dialog"
|
|
|
+ v-move-ele.prevent.stop
|
|
|
>
|
|
|
- <!-- TODO:拖动 -->
|
|
|
<div class="communication-box" v-show="!isWaiting">
|
|
|
<div class="communication-host" id="communication-host"></div>
|
|
|
<div class="communication-guest" id="communication-guest"></div>
|
|
|
- <div class="communication-action">
|
|
|
- <el-button round type="danger" @click="hangup">结束通话</el-button>
|
|
|
+ <div class="communication-action" @mousedown.stop>
|
|
|
+ <el-button round type="danger" @click.stop="hangup"
|
|
|
+ >结束通话</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="communication-info">
|
|
|
- <!-- <span>当前网络状态良好</span> -->
|
|
|
<span>持续时长:<second-timer ref="SecondTimer"></second-timer></span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -276,12 +271,11 @@
|
|
|
<p class="communication-wait-username">
|
|
|
{{ detailInfo.examStudentName }}
|
|
|
</p>
|
|
|
- <div class="communication-wait-action">
|
|
|
+ <div class="communication-wait-action" @mousedown.stop>
|
|
|
<el-button round type="danger" @click="hangup">取消通话</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer"> </span>
|
|
|
- </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -311,6 +305,7 @@ import {
|
|
|
objTypeOf,
|
|
|
snakeToHump,
|
|
|
} from "@/utils/utils";
|
|
|
+import MoveEle from "@/plugins/move-ele";
|
|
|
import { mapState } from "vuex";
|
|
|
|
|
|
const domEmpty = (dom) => {
|
|
@@ -329,6 +324,7 @@ export default {
|
|
|
SimpleImagePreview,
|
|
|
SecondTimer,
|
|
|
},
|
|
|
+ directives: { MoveEle },
|
|
|
data() {
|
|
|
return {
|
|
|
examRecordId: this.$route.params.examRecordId,
|
|
@@ -341,12 +337,11 @@ export default {
|
|
|
viewVideoReady: false,
|
|
|
holding: false,
|
|
|
// communication
|
|
|
- popoverVisible: false,
|
|
|
userMonitor: {},
|
|
|
client: null,
|
|
|
localStream: null,
|
|
|
dialogVisible: false,
|
|
|
- isWaiting: true,
|
|
|
+ isWaiting: false,
|
|
|
subscribeSetTs: [],
|
|
|
loopRunning: false,
|
|
|
loopSetTs: [],
|
|
@@ -457,7 +452,6 @@ export default {
|
|
|
? `${domain}/live/${item.liveUrl.toLowerCase()}.flv`
|
|
|
: "";
|
|
|
item.name = sourceNames[item.source];
|
|
|
- item.muted = true;
|
|
|
item.ref = snakeToHump(item.source) + "Video";
|
|
|
records[item.source] = item;
|
|
|
});
|
|
@@ -466,7 +460,6 @@ export default {
|
|
|
return (
|
|
|
records[source] || {
|
|
|
liveUrl: null,
|
|
|
- muted: true,
|
|
|
source,
|
|
|
name: sourceNames[source],
|
|
|
ref: snakeToHump(source) + "Video",
|
|
@@ -723,7 +716,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.dialogVisible = true;
|
|
|
- this.popoverVisible = false;
|
|
|
this.holding = false;
|
|
|
// 添加远程用户视频发布监听
|
|
|
this.client.on("stream-added", (event) => {
|
|
@@ -829,16 +821,6 @@ export default {
|
|
|
this.clearSubscribeSetTs();
|
|
|
this.$refs.SecondTimer.end();
|
|
|
|
|
|
- if (this.autoAnswerInfo) {
|
|
|
- // 结束学生的通话
|
|
|
- await communicationOver({
|
|
|
- recordId: this.examRecordId,
|
|
|
- source: this.autoAnswerInfo.source,
|
|
|
- }).catch(() => {
|
|
|
- console.log("结束通话状态异常!");
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
// 取消发布本地视频
|
|
|
await this.client.unpublish(this.localStream).catch((error) => {
|
|
|
console.log("取消发布本地视频失败!", error);
|
|
@@ -863,6 +845,18 @@ export default {
|
|
|
this.dialogVisible = false;
|
|
|
this.isWaiting = true;
|
|
|
// this.initSubscribeVideo();
|
|
|
+
|
|
|
+ if (this.autoAnswerInfo) {
|
|
|
+ // 结束学生的通话
|
|
|
+ await communicationOver({
|
|
|
+ recordId: this.examRecordId,
|
|
|
+ source: this.autoAnswerInfo.source,
|
|
|
+ }).catch(() => {
|
|
|
+ console.log("结束通话状态异常!");
|
|
|
+ });
|
|
|
+
|
|
|
+ this.goBack();
|
|
|
+ }
|
|
|
},
|
|
|
initSubscribeVideo() {
|
|
|
this.viewVideoReady = true;
|