Commit 6349af9d by kyle

解决点开视频重新开始播放的问题

parent a48976d0
...@@ -22,10 +22,14 @@ ...@@ -22,10 +22,14 @@
<!-- 课程banner图 --> <!-- 课程banner图 -->
<!-- v-show="!sliceshare" --> <!-- v-show="!sliceshare" -->
<view class="courseBannerBox" v-if="!sliceshare"> <view class="courseBannerBox" v-if="!sliceshare">
<video id="myVideo" :src="courseInfo.filePathOss" :initial-time="videoPlaybackInfo.maxViewTime" <template v-if="isRenderVideo">
object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage" :title="courseInfo.fileTitle" <view>
@loadedmetadata="loadedmetadata" @play="playVideo" @pause="pause" @ended="ended" <video id="myVideo" :src="courseInfo.filePathOss" :initial-time="videoPlaybackInfo.maxViewTime"
@timeupdate="timeupdate"></video> object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage" :title="courseInfo.fileTitle"
@loadedmetadata="loadedmetadata" @play="playVideo" @pause="pause" @ended="ended"
@timeupdate="timeupdate"></video>
</view>
</template>
</view> </view>
<!-- 课程详情图 --> <!-- 课程详情图 -->
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
<view class="dataBox"> <view class="dataBox">
<strong v-if="courseInfo.status==1">¥{{courseInfo.coursePrice}}</strong> <strong v-if="courseInfo.status==1">¥{{courseInfo.coursePrice}}</strong>
<text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i <text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i
class="iconfont icon-yifukuan"></i>已购</text> class="iconfont icon-yifukuan"></i>已购{{videoPlaybackInfo.maxViewTime}}</text>
<text>{{courseInfo.salesNumber}}人购买</text> <text>{{courseInfo.salesNumber}}人购买</text>
</view> </view>
...@@ -140,6 +144,7 @@ ...@@ -140,6 +144,7 @@
}, },
data() { data() {
return { return {
isRenderVideo:false,
fileId: null, fileId: null,
lecturerId: null, lecturerId: null,
tabType: 3, tabType: 3,
...@@ -335,13 +340,12 @@ ...@@ -335,13 +340,12 @@
'cffp_userId'), 'cffp_userId'),
packFileId: this.courseInfo.packFileId packFileId: this.courseInfo.packFileId
}).then(res => { }).then(res => {
console.log('详情页面--res', res, 1251255)
if (res['success']) { if (res['success']) {
this.courseInfo = res['data']['data']; this.courseInfo = res['data']['data'];
this.lecturerId = res['data']['data']['fileLecturerId']; this.lecturerId = res['data']['data']['fileLecturerId'];
this.lecturerQuery(); this.lecturerQuery();
if (this.courseInfo.status === 2) { if (this.courseInfo.status === 2) {
this.findVideoPlayback() this.findVideoPlayback();
} }
} }
}) })
...@@ -406,9 +410,10 @@ ...@@ -406,9 +410,10 @@
systemType: 1, systemType: 1,
userId: this.userId, userId: this.userId,
fileId: this.fileId, fileId: this.fileId,
packFileId: this.courseInfo.packFileId packFileId: this.courseInfo.packFileId,
} }
api.findVideoPlayback(param).then(res => { api.findVideoPlayback(param).then(res => {
this.isRenderVideo = true;
if (res['success']) { if (res['success']) {
this.videoPlaybackInfo = res['data'] this.videoPlaybackInfo = res['data']
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment