|
@@ -4,11 +4,14 @@
|
|
|
class="video-image"
|
|
|
:autoplay="true"
|
|
|
:muted="true"
|
|
|
- :loop="true"
|
|
|
+ :loop="false"
|
|
|
:preload="true"
|
|
|
:controls="false"
|
|
|
:poster="roomInfo.bg"
|
|
|
- :src="roomInfo.video"></video>
|
|
|
+ :src="roomInfo.video"
|
|
|
+ ref="videoRef"
|
|
|
+ @ended="restartVideo"
|
|
|
+ ></video>
|
|
|
<div
|
|
|
class="video-model"
|
|
|
v-if="
|
|
@@ -261,6 +264,15 @@ const hasExecutedDefault = ref(false)
|
|
|
const hasExecutedModeScene = ref(false)
|
|
|
const store = useStore()
|
|
|
|
|
|
+const videoRef = ref(null); // 创建一个 ref 用于引用视频元素
|
|
|
+const restartVideo = () => {
|
|
|
+ if (videoRef.value) {
|
|
|
+ // console.log('视频播放结束,重新开始播放');
|
|
|
+
|
|
|
+ videoRef.value.currentTime = 0; // 将视频播放位置设置为起始点
|
|
|
+ videoRef.value.play(); // 重新播放视频
|
|
|
+ }
|
|
|
+};
|
|
|
onMounted(async () => {
|
|
|
console.log("========重新执行了")
|
|
|
|