|
@@ -2,13 +2,14 @@
|
|
|
<div class="dot-box" :style="{ width: width ? width + 'px' : '100%', height: height ? height + 'px' : '100%' }">
|
|
|
<div class="video-box" @click="play_now">
|
|
|
<HikvisionPlayer
|
|
|
- v-if="isPlaying"
|
|
|
+ v-if="isPlaying && !isNoLive"
|
|
|
ref="videoPlayer"
|
|
|
hideEnlarge
|
|
|
style="width: 100%; height: 100%; object-fit: fill"
|
|
|
@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" />
|
|
|
<div class="video-header">
|
|
|
<div class="label" :title="dot_data.name">{{ dot_data.name }}</div>
|
|
|
<div class="video-header-right">
|
|
@@ -39,14 +40,20 @@
|
|
|
<!--收藏弹窗-->
|
|
|
<VideoTagEdit v-if="showCollectDialog" :id="dot_data.id" v-model="showCollectDialog" :tags="tags" @update-video-tag="getData2" />
|
|
|
<!--点击全屏弹窗-->
|
|
|
- <video-dialog v-if="showFullScreenDialog" v-model="showFullScreenDialog" :videoMonitorData="dot_data" @changeTagsData="getData" />
|
|
|
+ <video-dialog
|
|
|
+ v-if="showFullScreenDialog"
|
|
|
+ v-model="showFullScreenDialog"
|
|
|
+ :videoMonitorData="dot_data"
|
|
|
+ :isNoLive="isNoLive"
|
|
|
+ @changeTagsData="getData"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="HKVideo2">
|
|
|
import HikvisionPlayer from './hikvision-h5player.vue';
|
|
|
import VideoDialog from '@/components/HKVideo/video-dialog.vue';
|
|
|
-import { getVideoById, getVideoTagInfo, getVideoUrlById } from '@/api/videoMonitor';
|
|
|
+import { getVideoTagInfo, getVideoUrlById } from '@/api/videoMonitor';
|
|
|
|
|
|
interface Tag {
|
|
|
dict_label: string;
|
|
@@ -68,6 +75,7 @@ interface Props {
|
|
|
autoplay?: boolean;
|
|
|
isIndex?: boolean;
|
|
|
hiddenCollect: boolean;
|
|
|
+ isNoLive?: boolean;
|
|
|
}
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {});
|
|
@@ -78,6 +86,7 @@ const isPlaying = ref(false);
|
|
|
const errBKVisible = ref(false);
|
|
|
const posterVisible = ref(true);
|
|
|
let videoPlayer = ref(null);
|
|
|
+let FlvVideoRef = ref(null);
|
|
|
const tags = ref([]);
|
|
|
|
|
|
watch(
|
|
@@ -133,18 +142,17 @@ const play_now = async (check?: boolean) => {
|
|
|
posterVisible.value = false;
|
|
|
errBKVisible.value = false;
|
|
|
isPlaying.value = true;
|
|
|
- // 视频监控数据
|
|
|
- // getVideoById(props.dot_data.video_code).then((res) => {
|
|
|
- // if (res.data.status === 0) {
|
|
|
- // errBKVisible.value = true;
|
|
|
- // isPlaying.value = false;
|
|
|
- // } else {
|
|
|
- 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);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- // }
|
|
|
- // });
|
|
|
};
|
|
|
// 停止播放
|
|
|
const stop_now = async () => {
|