|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<view class="video-wrapper" id="video-container"> |
|
|
|
<view style="position:relative;width:100%;" :style="{'height':videoHeight+'px'}"> |
|
|
|
<video id="video_play" :controls="false" :src="videoObj.videoUrl" @ended="videoEnded()" :autoplay="auto" :show-fullscreen-btn="false" :loop="isLoop" style="width: 100%;height: 100%;" object-fit="cover"></video> |
|
|
|
<video id="video_play" :controls="false" :src="videoObj.videoUrl" @ended="videoEnded()" @loadedmetadata="onMetadataLoaded" :autoplay="auto" :show-fullscreen-btn="false" :loop="isLoop" style="width: 100%;height: 100%;" object-fit="cover"></video> |
|
|
|
<view class="question"></view> |
|
|
|
<view class="popup-layer-back" v-if="!start" v-show="question"> |
|
|
|
<!-- <view class="popup-layer-close" @click="question=false">关闭</view> --> |
|
|
|
@ -23,6 +23,7 @@ |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="popup-layer-back" v-show="resCheck"> |
|
|
|
<view><image style="position: absolute; top: 20%; left: 10%;" src="/static/images/fail.gif"></image></view> |
|
|
|
<view class="popup-layer" style="color: red;" @click="toResVideo()"> |
|
|
|
<view class="anitem1"> |
|
|
|
<image class="animg1" src="/static/videos/skin_bg_v1.png"></image> |
|
|
|
@ -63,6 +64,7 @@ |
|
|
|
isOk: false, |
|
|
|
isError: false, |
|
|
|
resCheck: false, |
|
|
|
isResVideo: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -153,6 +155,14 @@ |
|
|
|
this.auto = true; |
|
|
|
this.resCheck = false; |
|
|
|
this.resVideoUrl = ""; |
|
|
|
this.isResVideo = true; |
|
|
|
}, |
|
|
|
onMetadataLoaded(event) { |
|
|
|
if(this.isResVideo) { |
|
|
|
this.isResVideo = false; |
|
|
|
const duration = event.detail.duration; |
|
|
|
this.videoContext.seek(duration); |
|
|
|
} |
|
|
|
}, |
|
|
|
nextQuestion(outId, obj) { |
|
|
|
// 点击开始后先增加题次 |
|
|
|
@ -210,7 +220,9 @@ |
|
|
|
that.isError = false; |
|
|
|
that.isOk = false; |
|
|
|
that.hasNodeId(outId); |
|
|
|
that.videoObj.videoUrl = uni.$http.baseUrl + that.videoObj.videoUrl |
|
|
|
if(!that.videoObj.videoUrl.includes("http")) { |
|
|
|
that.videoObj.videoUrl = uni.$http.baseUrl + that.videoObj.videoUrl |
|
|
|
} |
|
|
|
|
|
|
|
// 用于记录上一个视频 |
|
|
|
if(null==obj) { |
|
|
|
|