|
@@ -997,7 +997,7 @@ export default {
|
|
if (this.$method.isGoLogin()) {
|
|
if (this.$method.isGoLogin()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.closePhoto()
|
|
|
|
|
|
+ this.closePhoto();
|
|
this.courseCourseList();
|
|
this.courseCourseList();
|
|
},
|
|
},
|
|
onUnload() {
|
|
onUnload() {
|
|
@@ -1663,66 +1663,15 @@ export default {
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
let { data } = res.data;
|
|
let { data } = res.data;
|
|
- console.log(data, 789);
|
|
|
|
if (!data.sectionId) {
|
|
if (!data.sectionId) {
|
|
data = this.menuAllList[0];
|
|
data = this.menuAllList[0];
|
|
} else {
|
|
} else {
|
|
if (data.learning == 1 && this.orderNum == 2) {
|
|
if (data.learning == 1 && this.orderNum == 2) {
|
|
let next = this.menuAllList.find((e) => e.studyStatus != 1);
|
|
let next = this.menuAllList.find((e) => e.studyStatus != 1);
|
|
- console.log(next, 789);
|
|
|
|
next && (data = next);
|
|
next && (data = next);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.initPlayVideo(data);
|
|
this.initPlayVideo(data);
|
|
- // if (res.data.data) {
|
|
|
|
- // this.moduleId = res.data.data.moduleId;
|
|
|
|
- // this.chapterId = res.data.data.chapterId;
|
|
|
|
- // if (res.data.data.sectionType == 1) {
|
|
|
|
- // //录播
|
|
|
|
- // this.$store.commit("setPlaySectionId", {
|
|
|
|
- // playSectionId: res.data.data.sectionId,
|
|
|
|
- // });
|
|
|
|
- // this.$store.commit("setPlayVID", {
|
|
|
|
- // playVID: res.data.data.recordingUrl,
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- // this.sectionItem = res.data.data;
|
|
|
|
- // await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
|
- // this.playVideo(res.data.data);
|
|
|
|
- // } else if (res.data.data.sectionType == 2) {
|
|
|
|
- // //直播
|
|
|
|
- // this.studyRecordGetLastLive();
|
|
|
|
- // } else if (res.data.data.sectionType == 3) {
|
|
|
|
- // //回放
|
|
|
|
- // this.$store.commit("setPlaySectionId", {
|
|
|
|
- // playSectionId: res.data.data.sectionId,
|
|
|
|
- // });
|
|
|
|
- // this.$store.commit("setPlayVID", {
|
|
|
|
- // playVID: res.data.data.recordingUrl,
|
|
|
|
- // });
|
|
|
|
- // this.sectionItem = res.data.data;
|
|
|
|
- // this.playVideo(res.data.data);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // // 查询用户最后一次看的录播的信息
|
|
|
|
- // this.$http({
|
|
|
|
- // url: "/study/record/getUserWatchLast",
|
|
|
|
- // method: "get",
|
|
|
|
- // data: {
|
|
|
|
- // orderGoodsId: this.orderGoodsId,
|
|
|
|
- // },
|
|
|
|
- // }).then((res) => {
|
|
|
|
- // if (res.data.code == 200) {
|
|
|
|
- // let { data } = res.data;
|
|
|
|
- // if (!data) {
|
|
|
|
- // const sectionItem = this.menuAllList[0];
|
|
|
|
- // sectionItem.sectionType == 1 && (data = sectionItem);
|
|
|
|
- // // initPlayVideo
|
|
|
|
- // }
|
|
|
|
- // this.sectionItem = data;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -2621,7 +2570,7 @@ export default {
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
}
|
|
}
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
- await this.clears();
|
|
|
|
|
|
+ // await this.clears();
|
|
// #endif
|
|
// #endif
|
|
if (this.vid) {
|
|
if (this.vid) {
|
|
//切换视频
|
|
//切换视频
|
|
@@ -2885,9 +2834,9 @@ export default {
|
|
PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
|
|
PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
|
|
// #endif
|
|
// #endif
|
|
}
|
|
}
|
|
- // if (currentTime < 15 && !this.ossAvatarUrl) {
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
|
|
+ if (currentTime < 10 && !this.ossAvatarUrl) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (this.playChannelId > 0) {
|
|
if (this.playChannelId > 0) {
|
|
currentTime = 2; //直播无法获取,无论开始结束都传2秒
|
|
currentTime = 2; //直播无法获取,无论开始结束都传2秒
|
|
}
|
|
}
|
|
@@ -3667,9 +3616,7 @@ export default {
|
|
if (self.goodsData.goodsPlayConfig) {
|
|
if (self.goodsData.goodsPlayConfig) {
|
|
self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
|
|
self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
|
|
if (self.goodsPlayConfig.autoPlay > 0) {
|
|
if (self.goodsPlayConfig.autoPlay > 0) {
|
|
- // #ifdef H5
|
|
|
|
self.autoplay = true;
|
|
self.autoplay = true;
|
|
- // #endif
|
|
|
|
}
|
|
}
|
|
if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
|
|
if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
@@ -3880,11 +3827,8 @@ export default {
|
|
loadPlayer() {
|
|
loadPlayer() {
|
|
const polyvPlayer = window.polyvPlayer;
|
|
const polyvPlayer = window.polyvPlayer;
|
|
this.$api.polyvVideoSign(this.vid).then(async (res) => {
|
|
this.$api.polyvVideoSign(this.vid).then(async (res) => {
|
|
- this.player = await polyvPlayer({
|
|
|
|
- wrap: "#player",
|
|
|
|
- width: "100%",
|
|
|
|
|
|
+ let option = {
|
|
showLine: "off",
|
|
showLine: "off",
|
|
- height: 218,
|
|
|
|
ban_history_time: "on",
|
|
ban_history_time: "on",
|
|
vid: this.vid,
|
|
vid: this.vid,
|
|
forceH5: true,
|
|
forceH5: true,
|
|
@@ -3897,9 +3841,38 @@ export default {
|
|
watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
|
|
watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
|
|
ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
|
|
ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
|
|
sign: res.data.data.sign, // 移动端播放加密视频所需的签名
|
|
sign: res.data.data.sign, // 移动端播放加密视频所需的签名
|
|
- });
|
|
|
|
- polyvPlayerContext = this.player;
|
|
|
|
- this.player.on("s2j_onPlayStart", async (vid) => {
|
|
|
|
|
|
+ };
|
|
|
|
+ if (polyvPlayerContext) {
|
|
|
|
+ polyvPlayerContext.changeVid(option);
|
|
|
|
+ } else {
|
|
|
|
+ option = {
|
|
|
|
+ wrap: "#player",
|
|
|
|
+ width: "100%",
|
|
|
|
+ height: 218,
|
|
|
|
+ ...option,
|
|
|
|
+ };
|
|
|
|
+ polyvPlayerContext = await polyvPlayer(option);
|
|
|
|
+ }
|
|
|
|
+ // polyvPlayerContext = await polyvPlayer({
|
|
|
|
+ // wrap: "#player",
|
|
|
|
+ // width: "100%",
|
|
|
|
+ // showLine: "off",
|
|
|
|
+ // height: 218,
|
|
|
|
+ // ban_history_time: "on",
|
|
|
|
+ // vid: this.vid,
|
|
|
|
+ // forceH5: true,
|
|
|
|
+ // autoplay: this.autoplay, // 自动播放
|
|
|
|
+ // ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
|
|
|
|
+ // speed: this.playbackRate, // 倍数
|
|
|
|
+ // teaser_show: 1,
|
|
|
|
+ // tail_show: 1,
|
|
|
|
+ // hideSwitchPlayer: true,
|
|
|
|
+ // watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
|
|
|
|
+ // ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
|
|
|
|
+ // sign: res.data.data.sign, // 移动端播放加密视频所需的签名
|
|
|
|
+ // });
|
|
|
|
+ // polyvPlayerContext = this.player;
|
|
|
|
+ polyvPlayerContext.on("s2j_onPlayStart", async (vid) => {
|
|
// 视频初次播放时触发
|
|
// 视频初次播放时触发
|
|
console.log("视频初次播放时触发:");
|
|
console.log("视频初次播放时触发:");
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -3927,7 +3900,7 @@ export default {
|
|
this.loadedmetadata();
|
|
this.loadedmetadata();
|
|
this.postStudyRecord(0);
|
|
this.postStudyRecord(0);
|
|
});
|
|
});
|
|
- this.player.on("s2j_onVideoPause", () => {
|
|
|
|
|
|
+ polyvPlayerContext.on("s2j_onVideoPause", () => {
|
|
// 视频暂停时触发
|
|
// 视频暂停时触发
|
|
console.log("视频暂停时触发", this.vid);
|
|
console.log("视频暂停时触发", this.vid);
|
|
this.erJianErZaoPauseTip();
|
|
this.erJianErZaoPauseTip();
|
|
@@ -3936,8 +3909,7 @@ export default {
|
|
clearInterval(this.studyTimer);
|
|
clearInterval(this.studyTimer);
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
});
|
|
});
|
|
-
|
|
|
|
- this.player.on("s2j_onVideoPlay", () => {
|
|
|
|
|
|
+ polyvPlayerContext.on("s2j_onVideoPlay", () => {
|
|
// 视频初次播放或由暂停恢复播放时触发
|
|
// 视频初次播放或由暂停恢复播放时触发
|
|
console.log("视频初次播放或由暂停恢复播放时触发");
|
|
console.log("视频初次播放或由暂停恢复播放时触发");
|
|
if (this.needSeek) {
|
|
if (this.needSeek) {
|
|
@@ -3969,8 +3941,7 @@ export default {
|
|
this.postStudyRecord(0, this.playSectionId);
|
|
this.postStudyRecord(0, this.playSectionId);
|
|
}, 15000);
|
|
}, 15000);
|
|
});
|
|
});
|
|
-
|
|
|
|
- this.player.on("s2j_onPlayOver", async () => {
|
|
|
|
|
|
+ polyvPlayerContext.on("s2j_onPlayOver", async () => {
|
|
// 当前视频播放完毕时触发
|
|
// 当前视频播放完毕时触发
|
|
this.hasStart = false;
|
|
this.hasStart = false;
|
|
this.clearBarTimer();
|
|
this.clearBarTimer();
|
|
@@ -3988,7 +3959,8 @@ export default {
|
|
clears() {
|
|
clears() {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
this.vid = "";
|
|
this.vid = "";
|
|
- this.player && this.player.destroy();
|
|
|
|
|
|
+ polyvPlayerContext && polyvPlayerContext.destroy();
|
|
|
|
+ polyvPlayerContext = null;
|
|
resolve();
|
|
resolve();
|
|
});
|
|
});
|
|
},
|
|
},
|