|
@@ -3,6 +3,10 @@
|
|
|
<!-- <div class="video-box" :style="metasHeight ? `height:${metasHeight}px;` : ''"> -->
|
|
|
<div class="video-box">
|
|
|
<!-- <ui-icon v-show="loading" class="loading-icon" type="_loading_"></ui-icon> -->
|
|
|
+ <i
|
|
|
+ v-show="loading"
|
|
|
+ class="iconfont ui-kankan-icon icon tip-h-center tip-v-bottom icon-_loading_ loading-icon"
|
|
|
+ ></i>
|
|
|
<video
|
|
|
@error="filesError"
|
|
|
v-show="!loading"
|
|
@@ -27,6 +31,7 @@
|
|
|
import { onMounted, nextTick, ref, computed, defineProps } from 'vue';
|
|
|
import { changeUrl } from '../common';
|
|
|
import { tagType } from '/@/store/modules/scene';
|
|
|
+ import { watchEffect } from 'vue';
|
|
|
|
|
|
// const videoNum = ref(0);
|
|
|
// const type = ref('video');
|
|
@@ -45,6 +50,10 @@
|
|
|
type: Number,
|
|
|
default: null,
|
|
|
},
|
|
|
+ show: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
});
|
|
|
const loading = ref(true);
|
|
|
|
|
@@ -61,11 +70,22 @@
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ watchEffect(() => {
|
|
|
+ if (props.show) {
|
|
|
+ let myVideo = document.getElementById('video');
|
|
|
+ if (myVideo) {
|
|
|
+ //@ts-ignore
|
|
|
+ myVideo.play();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
nextTick(() => {
|
|
|
let myVideo = document.getElementById('video');
|
|
|
- myVideo.oncanplay = function () {
|
|
|
- loading.value = false;
|
|
|
- };
|
|
|
+ if (myVideo) {
|
|
|
+ myVideo.oncanplay = function () {
|
|
|
+ loading.value = false;
|
|
|
+ };
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
</script>
|