|
@@ -8,7 +8,7 @@
|
|
|
@on-playing="onHkPlaying"
|
|
|
@on-play-error="onHKPlayError"
|
|
|
/>
|
|
|
- <FlvVideo v-if="isPlaying && isNoLive" ref="FlvVideoRef" :videoUrl="dot_data.video_code"style="width: 100%; height: 100%; object-fit: fill" />
|
|
|
+ <FlvVideo v-if="isPlaying && isNoLive" ref="flvVideoRef" :videoUrl="dot_data.video_code" style="width: 100%; height: 100%; object-fit: fill" />
|
|
|
<img v-if="posterVisible" class="video-play" src="@/assets/images/video/play.png" alt="" />
|
|
|
<img v-if="posterVisible && dot_data.poster" class="video-poster" :src="dot_data.poster" />
|
|
|
<div v-if="errBKVisible" class="err_bk">
|
|
@@ -77,6 +77,7 @@ const onHKPlayError = async () => {
|
|
|
};
|
|
|
|
|
|
let videoPlayer = ref(null);
|
|
|
+let flvVideoRef = ref(null);
|
|
|
let reload = ref(false);
|
|
|
watch(
|
|
|
() => props.dot_data,
|
|
@@ -84,6 +85,9 @@ watch(
|
|
|
if (!!videoPlayer.value) {
|
|
|
videoPlayer.value.stop();
|
|
|
}
|
|
|
+ if (!!flvVideoRef.value) {
|
|
|
+ flvVideoRef.value.destoryVideo();
|
|
|
+ }
|
|
|
posterVisible.value = true;
|
|
|
errBKVisible.value = false;
|
|
|
isPlaying.value = false;
|
|
@@ -105,12 +109,17 @@ const play_now = async (check?: boolean) => {
|
|
|
posterVisible.value = false;
|
|
|
errBKVisible.value = false;
|
|
|
isPlaying.value = true;
|
|
|
- // 视频监控数据
|
|
|
- getVideoUrlById(props.dot_data.video_code).then((res) => {
|
|
|
- wsUrl.value = res.data;
|
|
|
- videoPlayer.value.play(wsUrl.value);
|
|
|
+ nextTick(() => {
|
|
|
+ if (props.isNoLive) {
|
|
|
+ flvVideoRef.value.handleVideoPlay(props.dot_data.video_code);
|
|
|
+ } else {
|
|
|
+ // 视频监控数据
|
|
|
+ getVideoUrlById(props.dot_data.video_code).then((res) => {
|
|
|
+ wsUrl.value = res.data;
|
|
|
+ videoPlayer.value.play(wsUrl.value);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- console.log('play_now');
|
|
|
};
|
|
|
|
|
|
const stop_now = async () => {
|