课件预览根据视频显示它的封面图

This commit is contained in:
18571350067 2021-12-28 19:01:10 +08:00
parent 36c9db5960
commit 4200f1b952
2 changed files with 11 additions and 3 deletions

View File

@ -526,7 +526,6 @@ export default {
this.fileUpload.textForm.courseId = this.$route.query.courseId
this.fileUpload.textForm.type = this.fileUpload.tabkey
this.fileUpload.textForm.videoPath = this.videoPath
console.log('aaaaaa', this.fileUpload.textForm)
this.fileUpload.textForm.ifResources = this.$route.query.ifResources || 0
let form = {}
form = this.fileUpload.textForm
@ -606,7 +605,6 @@ export default {
this.fileUpload.videoForm = this.courseware
this.fileUpload.videoForm.ifResources = this.ifResources || 0;
this.fileUpload.videoForm.disabled = false
console.log("1111111",this.fileUpload.videoForm);
}
if (this.courseware.type == '2') {

View File

@ -105,6 +105,7 @@ export default {
},
data() {
return {
images:[],
type: 1,
isactive: 0,
queryParam: { coursewareId: this.$route.query.coursewareId || this.coursewareId },
@ -128,7 +129,7 @@ export default {
// src: this.videoPath,
// },
],
poster: 'https://pica.zhimg.com/v2-c79ec963f532b2ad2749d5c71353c0d0_1440w.jpg?source=172ae18b', //
// poster: 'https://pica.zhimg.com/v2-c79ec963f532b2ad2749d5c71353c0d0_1440w.jpg?source=172ae18b', //
},
}
},
@ -139,6 +140,11 @@ export default {
//
this.courseware = res.data
if (this.courseware.videoList.length > 0) {
//
if (this.courseware.image != '' || this.courseware.image) {
this.images = this.courseware.image.split(",");
this.playerOptions.poster = this.images[0];
}
//
if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0)
@ -172,6 +178,10 @@ export default {
//
this.playerOptions.sources = []
this.playerOptions.sources.push({ type: 'video/mp4', src: path })
console.log("index",index);
console.log("images",this.images);
this.playerOptions.poster = this.images[index]
}
},