diff --git a/pages/component/commonComponents/curriculumVideo.vue b/pages/component/commonComponents/curriculumVideo.vue index c1ee3b3..447bc94 100644 --- a/pages/component/commonComponents/curriculumVideo.vue +++ b/pages/component/commonComponents/curriculumVideo.vue @@ -48,7 +48,6 @@ export default { }, handleClick(data) { console.log("data at line 35:", data); - this.$emit("open", data); }, diff --git a/pages/component/commonComponents/video/index.vue b/pages/component/commonComponents/video/index.vue index 27fd348..762a1e0 100644 --- a/pages/component/commonComponents/video/index.vue +++ b/pages/component/commonComponents/video/index.vue @@ -126,11 +126,13 @@ this.isChange = false; }, async changeVideo(data) { + console.log('changeVideo',); this.currentTime = ""; this.firstTime = 0; this.isSetFirstTime = false; this.isChange = false; - await this.init(data, true); + this.getLive(true, this.currentVideo) + // await this.init(data, true); }, screenChange(data) { console.log( @@ -232,13 +234,17 @@ uni.setStorageSync("videoOssList", JSON.stringify(list)); }, // 获取播放凭证 - async getLive(isChange) { + async getLive(isChange,newVideoData) { var that = this; this.isfresh = false; var data = { ...this.options, }; - + if(isChange && newVideoData){ + data = { + ...newVideoData, + }; + } await $http .request({ url: `sociology/course/checkVideo`, @@ -358,7 +364,7 @@ var _seconds = 0 var curStatus = null var diff = 0 - + var myplayer = undefined import $ from 'jquery' export default { components: { @@ -654,7 +660,9 @@ } var player = new Aliplayer(playerOptions, function(player) {}); - this.player = player; + this.player = player; + myplayer = player; + console.log('myplayer------------',myplayer); console.log('是否拿到第一次初始值呢', this.platform, typeof this.firstTime, this.firstTime) player.on('ready', function() { @@ -747,6 +755,15 @@ receiveMsg(newValue, oldValue, ownerVm, vm) { //数据变化 videoData = newValue + if(videoData){ + if(videoData.type == 1){ + if(videoData.m3u8Url != '' && videoData.m3u8Url != null){ + // myplayer.source(videoData.m3u8Url) + console.log('走了吗?'); + } + } + } + console.log('可能是切换视频',myplayer,videoData,); }, receiveWinWidth(newValue, oldValue, ownerVm, vm) { //数据变化 diff --git a/pages/course/chapterDetailAndorid.vue b/pages/course/chapterDetailAndorid.vue index 30e7c0a..73476c2 100644 --- a/pages/course/chapterDetailAndorid.vue +++ b/pages/course/chapterDetailAndorid.vue @@ -280,14 +280,16 @@ export default { }); }, changeVideo(data) { - console.log("data at line 370:", data); + console.log("data at line 370:", data); if (data.id != this.currentVideo.id) { // handleEnd - this.$refs.commonVideo.handleEnd(); + // this.$refs.commonVideo.handleEnd(); setTimeout(() => { this.currentVideo = data; - this.initVideo(); + this.$refs.commonVideo.changeVideo(); + // this.changeVideo() + // this.initVideo(); this.isOpenMp3 = false; }, 500); } else { @@ -296,7 +298,7 @@ export default { this.isOpenMp3 = false; } - console.log("data at line 380111111111111111111:", data.type); + // console.log("data at line 380111111111111111111:", data.type); }, hancleModalCancel() { this.show = false;