|
@@ -2,7 +2,7 @@
|
|
|
<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 || autoplay"
|
|
|
ref="videoPlayer"
|
|
|
style="width: 100%; height: 100%; object-fit: fill"
|
|
|
@on-playing="onHkPlaying"
|
|
@@ -30,7 +30,8 @@ import { getVideoUrlById } from '@/api/videoMonitor';
|
|
|
const props = defineProps({
|
|
|
dot_data: Object,
|
|
|
width: Number,
|
|
|
- height: Number
|
|
|
+ height: Number,
|
|
|
+ autoplay: Boolean
|
|
|
});
|
|
|
|
|
|
const play = () => {
|
|
@@ -67,7 +68,6 @@ const isShowTooltip = async () => {
|
|
|
isShowTip.value = false;
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
const onHkPlaying = async () => {
|
|
|
console.log('onHkPlaying');
|
|
|
errBKVisible.value = false;
|
|
@@ -104,6 +104,11 @@ const stop_now = async () => {
|
|
|
posterVisible.value = true;
|
|
|
};
|
|
|
|
|
|
+onMounted(() => {
|
|
|
+ if (!!props.autoplay) {
|
|
|
+ play_now();
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|