bugfix: 解决国标设备通道列表点播时 jessibuca 播放组件重复播放两次导致报错的问题

pull/1234/head
xiaoQQya 2023-12-26 10:27:35 +08:00
parent 3ab4ce0a83
commit 57bcf2e699
4 changed files with 14 additions and 9 deletions

View File

@ -242,8 +242,9 @@ export default {
console.error(error)
})
}
this.$nextTick(() => {
this.initData();
})
},
destroyed() {
this.$destroy('videojs');

View File

@ -42,10 +42,9 @@ export default {
volume: 1,
rotate: 0,
vod: true, //
forceNoOffscreen: false,
};
},
props: ['videoUrl', 'error', 'hasAudio', 'height'],
props: ['videoUrl', 'error', 'hasAudio', 'height', 'autoPlay'],
mounted() {
let paramUrl = decodeURIComponent(this.$route.params.url)
this.$nextTick(() => {
@ -57,6 +56,9 @@ export default {
this.videoUrl = paramUrl;
}
this.btnDom = document.getElementById("buttonsBox");
if (this.autoPlay) {
this.play(this.videoUrl);
}
})
},
watch: {
@ -65,8 +67,7 @@ export default {
this.$nextTick(() => {
this.play(val);
})
},
immediate: true
}
}
},
methods: {
@ -122,7 +123,7 @@ export default {
supportDblclickFullscreen: false,
timeout: 10,
useMSE: true,
useWCS: location.hostname === "localhost" || location.protocol === "https:",
useWCS: false,
useWebFullScreen: true,
videoBuffer: 0.1,
wasmDecodeErrorReplay: true,

View File

@ -8,7 +8,9 @@
<!-- <LivePlayer v-if="showVideoDialog" ref="livePlayer" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasAudio" fluent autoplay live></LivePlayer>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="Jessibuca" name="jessibuca">
<jessibucaPlayer v-if="activePlayer === 'jessibuca'" ref="jessibuca" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></jessibucaPlayer>
<jessibucaPlayer v-if="activePlayer === 'jessibuca'" ref="jessibuca" :visible.sync="showVideoDialog"
:videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px"
:hasAudio="hasAudio" :auto-play="false" fluent autoplay live></jessibucaPlayer>
</el-tab-pane>
<el-tab-pane label="WebRTC" name="webRTC">
<rtc-player v-if="activePlayer === 'webRTC'" ref="webRTC" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></rtc-player>
@ -242,6 +244,7 @@
import rtcPlayer from '../dialog/rtcPlayer.vue'
import LivePlayer from '@liveqing/liveplayer'
import jessibucaPlayer from '../common/jessibuca.vue'
export default {
name: 'devicePlayer',
props: {},

File diff suppressed because one or more lines are too long