|
@@ -229,7 +229,8 @@ export default {
|
|
|
goodsStatus: 0, // 0未上架,1上架
|
|
|
showAuth: false,
|
|
|
shareShow: false,
|
|
|
- sectionType: '',
|
|
|
+ sectionType: 2, //sectionType: 2, // 节类型 1录播 2直播 3回放
|
|
|
+ vid: '', // 回放的id
|
|
|
formShare: {
|
|
|
links: '',
|
|
|
ercode: '',
|
|
@@ -269,21 +270,26 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
// 下面不是复制链接进来的
|
|
|
- this.sectionId = this.$route.query.sectionId;
|
|
|
- this.goodsId = this.$route.query.goodsId;
|
|
|
- this.courseId = this.$route.query.courseId;
|
|
|
- this.orderGoodsId = this.$route.query.orderGoodsId;
|
|
|
- this.gradeId = +this.$route.query.gradeId;
|
|
|
- this.chapterId = this.$route.query.chapterId;
|
|
|
- this.moduleId = this.$route.query.moduleId;
|
|
|
- this.channelId = this.$route.params.channelId;
|
|
|
- this.goodsName = this.$route.query.goodsName
|
|
|
- this.sectionType = this.$route.query.sectionType
|
|
|
+ const {sectionId, goodsId, courseId, orderGoodsId, gradeId, chapterId, moduleId, goodsName, sectionType, vid} = this.$route.query
|
|
|
+ this.sectionId = sectionId
|
|
|
+ this.goodsId = goodsId
|
|
|
+ this.courseId = courseId
|
|
|
+ this.orderGoodsId = orderGoodsId
|
|
|
+ this.gradeId = +gradeId
|
|
|
+ this.chapterId = chapterId
|
|
|
+ this.moduleId = moduleId
|
|
|
+ // this.channelId = this.$route.params.channelId;
|
|
|
+ this.goodsName = goodsName
|
|
|
+ this.sectionType = sectionType
|
|
|
+ this.vid = vid
|
|
|
this.identification = new Date().valueOf() + ""
|
|
|
this.buyCourse = 0
|
|
|
// this.getParam()
|
|
|
this.playVideo();
|
|
|
- this.studyRecordGetLastLive();
|
|
|
+ if (this.sectionType !=3 ) {
|
|
|
+ this.studyRecordGetLastLive();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
if (!this.$tools.isLogin()) return
|
|
@@ -419,6 +425,8 @@ export default {
|
|
|
channelId: this.channelId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ console.log('------------res', res.code)
|
|
|
+ if (res.code == 200) {
|
|
|
this.sign = res.data.sign;
|
|
|
this.token = res.data.token;
|
|
|
this.mediaChannelKey = res.data.mediaChannelKey;
|
|
@@ -428,6 +436,9 @@ export default {
|
|
|
this.loadPlayerzb();
|
|
|
// 新增用户视频学习日志
|
|
|
this.studyLog()
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.msg)
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -544,22 +555,33 @@ export default {
|
|
|
); // 监听流状态变化
|
|
|
|
|
|
// 第四步:监听频道信息读取完成事件,初始化播放器
|
|
|
+ let options = {
|
|
|
+ el: els.playerEl,
|
|
|
+ pptEl: els.pptEl,
|
|
|
+ pptPlaceholder: true,
|
|
|
+ switchPlayer: true,
|
|
|
+ controllerPosition: "ppt",
|
|
|
+ fixedController: true,
|
|
|
+ controllerEl: els.controllerEl,
|
|
|
+ pptNavBottom: "80px",
|
|
|
+ barrage: true, // 是否开启弹幕
|
|
|
+ defaultBarrageStatus: true,
|
|
|
+ autoplay: true,
|
|
|
+ }
|
|
|
+ if (this.sectionType == 3) {
|
|
|
+ // 回放模式需要fileId、url、sessionId
|
|
|
+ // fileId: undefined, //ppt数据id,回放模式必填
|
|
|
+ // url: undefined, // 回放视频链接,回放模式必填
|
|
|
+ // sessionId: undefined, // 回放场次id,回放模式必填
|
|
|
+ // vid: undefined, // 回放id,回放模式下传入该参数,可不传fileId、url、sessionId
|
|
|
+ options.type = 'vod',
|
|
|
+ options.vid = this.vid
|
|
|
+ }
|
|
|
+ console.log('options', options)
|
|
|
this.plv.liveSdk.on(
|
|
|
PolyvLiveSdk.EVENTS.CHANNEL_DATA_INIT,
|
|
|
(event, data) => {
|
|
|
- this.plv.liveSdk.setupPlayer({
|
|
|
- el: els.playerEl,
|
|
|
- pptEl: els.pptEl,
|
|
|
- pptPlaceholder: true,
|
|
|
- switchPlayer: true,
|
|
|
- controllerPosition: "ppt",
|
|
|
- fixedController: true,
|
|
|
- controllerEl: els.controllerEl,
|
|
|
- pptNavBottom: "80px",
|
|
|
- barrage: true, // 是否开启弹幕
|
|
|
- defaultBarrageStatus: true,
|
|
|
- autoplay: true,
|
|
|
- });
|
|
|
+ this.plv.liveSdk.setupPlayer(options);
|
|
|
|
|
|
this.plv.liveSdk.player.on(
|
|
|
"fullscreenChange",
|