提交 1a6ea8e1 编写于 作者: guofeng.chen's avatar guofeng.chen

修改无视频时报错

上级 39535c8c
......@@ -143,9 +143,11 @@ export default {
this.isWechat = ua.match(/(MicroMessenger)\/([\d.]+)/);
},
mounted() {
const player = document.getElementById(this.vid);
player.addEventListener("timeupdate", this.onTimeUpdate, false);
this.player = player;
if (this.isWechat) {
const player = document.getElementById(this.vid);
player.addEventListener("timeupdate", this.onTimeUpdate, false);
this.player = player;
}
},
beforeDestroy() {
this.timer && clearTimeout(this.timer);
......@@ -187,6 +189,9 @@ export default {
},
// 切换视频
switchUrl(opts = {}) {
if (!this.isWechat) {
return;
}
const { url = '', poster = '', proved = 0, history = 0, enable = true } = opts;
this.loaded = false;
this.player.src = url;
......@@ -205,6 +210,9 @@ export default {
},
// 切换并播放
switchUrlAndPlay(opts = {}) {
if (!this.isWechat) {
return;
}
if (!this.isPaused && !this.finish) {
this.reportOnOff(2);
}
......
......@@ -149,11 +149,11 @@ export default {
if (token && !info.id) {
this.$store.dispatch('getUserInfo');
}
this.projectId = sessionStorage.getItem('projectId');
if (!this.projectId) {
this.$router.replace('/not-found');
return;
}
// this.projectId = sessionStorage.getItem('projectId');
// if (!this.projectId) {
// this.$router.replace('/not-found');
// return;
// }
this.getCourseInfo();
this.getCourseQas();
const { height } = this.$el.querySelector('.video-box').getBoundingClientRect();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册