|
@@ -1248,7 +1248,7 @@
|
|
|
<div class="left-box">
|
|
|
<div
|
|
|
class="textarea clearfix"
|
|
|
- v-if="isPlayRebuild > 0"
|
|
|
+ v-if="!(isPlayRebuild > 0)"
|
|
|
>
|
|
|
<el-input
|
|
|
resize="none"
|
|
@@ -1978,6 +1978,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ liveDuration: 0,
|
|
|
numPages: 0,
|
|
|
showPdf: false,
|
|
|
// 总页数
|
|
@@ -2017,6 +2018,7 @@ export default {
|
|
|
courseTabIndex: "1",
|
|
|
goodsId: "",
|
|
|
gradeId: "",
|
|
|
+ livingTimer: null,
|
|
|
sectionItem: {},
|
|
|
gradeDetail: {},
|
|
|
playTime: 0, //页面播放时长,不含暂停
|
|
@@ -2297,7 +2299,9 @@ export default {
|
|
|
try {
|
|
|
this.$msgbox.close();
|
|
|
} catch (err) {}
|
|
|
-
|
|
|
+ if (this.playSectionId) {
|
|
|
+ this.postStudyRecord();
|
|
|
+ }
|
|
|
if (this.lockTimer) {
|
|
|
clearInterval(this.lockTimer);
|
|
|
this.$request
|
|
@@ -2326,10 +2330,15 @@ export default {
|
|
|
});
|
|
|
this.takePhotoModal = false;
|
|
|
this.isTaking = false;
|
|
|
+ this.loading = false;
|
|
|
var polyvPlayerContext = this.player;
|
|
|
if (polyvPlayerContext) {
|
|
|
polyvPlayerContext.j2s_resumeVideo();
|
|
|
}
|
|
|
+ var polyvPlayerContext = this.playerzb;
|
|
|
+ if (polyvPlayerContext) {
|
|
|
+ polyvPlayerContext.j2s_resumeVideo();
|
|
|
+ }
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.loading = false;
|
|
@@ -3648,6 +3657,10 @@ export default {
|
|
|
this.player.destroy();
|
|
|
}
|
|
|
this.player = "";
|
|
|
+ if (this.playerzb) {
|
|
|
+ this.playerzb.destroy();
|
|
|
+ }
|
|
|
+ this.playerzb = "";
|
|
|
this.vidzb = "";
|
|
|
this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
this.courseDetail(); //课程详情
|
|
@@ -4292,6 +4305,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
loadPlayerzb() {
|
|
|
+ var self = this;
|
|
|
const polyvLivePlayer = window.polyvLivePlayer;
|
|
|
this.playerzb = polyvLivePlayer({
|
|
|
wrap: "#playerzb",
|
|
@@ -4300,6 +4314,16 @@ export default {
|
|
|
uid: this.uidzb,
|
|
|
vid: this.vidzb,
|
|
|
});
|
|
|
+ console.log(this.playerzb);
|
|
|
+ this.livingTimer = setInterval(self.timeEventLiving, 1000);
|
|
|
+
|
|
|
+ this.playerzb.on("s2j_onPlayOver", () => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "播放完毕",
|
|
|
+ });
|
|
|
+ this.postStudyRecord(1);
|
|
|
+ });
|
|
|
},
|
|
|
loadPlayer() {
|
|
|
var self = this;
|
|
@@ -4311,29 +4335,31 @@ export default {
|
|
|
height: 455,
|
|
|
speed: 2,
|
|
|
vid: self.vid,
|
|
|
+ teaser_show: 1,
|
|
|
+ tail_show: 1,
|
|
|
+ hideSwitchPlayer: true,
|
|
|
watchStartTime: this.recordObj.videoCurrentTime,
|
|
|
autoplay: true,
|
|
|
- teaser_show: 0,
|
|
|
ts: res.data.ts,
|
|
|
sign: res.data.sign,
|
|
|
- adMatter: [
|
|
|
- {
|
|
|
- // 广告参数详细配置
|
|
|
- location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
- adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
- matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
- timesize: 5, //广告时长,单位:秒
|
|
|
- skipenabled: false, //是否显示跳过按钮
|
|
|
- },
|
|
|
- {
|
|
|
- // 广告参数详细配置
|
|
|
- location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
- adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
- matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
- timesize: 5, //广告时长,单位:秒
|
|
|
- skipenabled: false, //是否显示跳过按钮
|
|
|
- },
|
|
|
- ],
|
|
|
+ // adMatter: [
|
|
|
+ // {
|
|
|
+ // // 广告参数详细配置
|
|
|
+ // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
+ // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
+ // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
+ // timesize: 5, //广告时长,单位:秒
|
|
|
+ // skipenabled: false, //是否显示跳过按钮
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // // 广告参数详细配置
|
|
|
+ // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
+ // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
+ // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
+ // timesize: 5, //广告时长,单位:秒
|
|
|
+ // skipenabled: false, //是否显示跳过按钮
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
playsafe: function (vid, next) {
|
|
|
next();
|
|
|
},
|
|
@@ -4357,6 +4383,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ timeEventLiving() {
|
|
|
+ var polyvPlayerContext = this.playerzb;
|
|
|
+ if (polyvPlayerContext) {
|
|
|
+ this.liveDuration = this.liveDuration + 1; //每隔1秒
|
|
|
+ console.log(this.liveDuration);
|
|
|
+ if (this.liveDuration == 2) {
|
|
|
+ //直播第2秒拍照
|
|
|
+ if (
|
|
|
+ this.goodsPhotographConfig.livephotograph == 1 &&
|
|
|
+ this.sectionItem.learning != 1
|
|
|
+ ) {
|
|
|
+ //开启直播拍照
|
|
|
+
|
|
|
+ polyvPlayerContext.j2s_pauseVideo();
|
|
|
+ this.openPhoto();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
timeEvent() {
|
|
|
let self = this;
|
|
|
var polyvPlayerContext = this.player;
|
|
@@ -4429,6 +4475,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var polyvPlayerContext = this.playerzb;
|
|
|
+ if (polyvPlayerContext) {
|
|
|
+ if (this.isFullScreen()) {
|
|
|
+ this.exitFullscreen();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
if (
|
|
|
(window.navigator.mediaDevices &&
|