|
@@ -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 = () => {
|
|
@@ -95,6 +96,12 @@ const stop_now = async () => {
|
|
|
}
|
|
|
posterVisible.value = true;
|
|
|
};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ if (!!props.autoplay) {
|
|
|
+ play_now();
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|