|
@@ -131,7 +131,6 @@
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.startTick()
|
|
|
|
|
this.startMonitor()
|
|
this.startMonitor()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -167,15 +166,16 @@
|
|
|
that.reportErr("play", '' + err.message)
|
|
that.reportErr("play", '' + err.message)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- playerReadied(audio) {
|
|
|
|
|
- console.log("playerReadied", audio)
|
|
|
|
|
|
|
+ playerReadied(player) {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
|
|
+ this.isReady = true
|
|
|
|
|
+ setTimeout(() => this.setMarks(), 600);
|
|
|
|
|
|
|
|
if (this.media.position > 5 && this.media.position < this.media.duration) {
|
|
if (this.media.position > 5 && this.media.position < this.media.duration) {
|
|
|
- this.setposition(this.media.position)
|
|
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ that.setposition(that.media.position)
|
|
|
|
|
+ }, 300)
|
|
|
}
|
|
}
|
|
|
- this.isReady = true
|
|
|
|
|
- setTimeout(() => this.setMarks(), 600);
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
if (that.player && that.player.volume) {
|
|
if (that.player && that.player.volume) {
|
|
@@ -210,13 +210,6 @@
|
|
|
},
|
|
},
|
|
|
onPlayerError(event) {
|
|
onPlayerError(event) {
|
|
|
this.reportErr("play", 'error');
|
|
this.reportErr("play", 'error');
|
|
|
- let player = this.$refs.videoPlayer && this.$refs.videoPlayer.player;
|
|
|
|
|
- if (player) {
|
|
|
|
|
- player.pause();
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- player.play();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
onPlayerEnded(event) {
|
|
onPlayerEnded(event) {
|
|
|
this.reportErr("play", 'end');
|
|
this.reportErr("play", 'end');
|
|
@@ -235,13 +228,13 @@
|
|
|
myPlayer && myPlayer.pause()
|
|
myPlayer && myPlayer.pause()
|
|
|
},
|
|
},
|
|
|
doPlay() {
|
|
doPlay() {
|
|
|
- // console.log("doPlay")
|
|
|
|
|
this.onPlay = true
|
|
this.onPlay = true
|
|
|
this.startTick();
|
|
this.startTick();
|
|
|
if (!this.$refs.videoPlayer || !this.$refs.videoPlayer.player) return;
|
|
if (!this.$refs.videoPlayer || !this.$refs.videoPlayer.player) return;
|
|
|
if (!this.dialog) return this.doPause();
|
|
if (!this.dialog) return this.doPause();
|
|
|
let myPlayer = this.$refs.videoPlayer.player;
|
|
let myPlayer = this.$refs.videoPlayer.player;
|
|
|
- myPlayer && myPlayer.play()
|
|
|
|
|
|
|
+ let p = myPlayer && myPlayer.play()
|
|
|
|
|
+ if (p && p.catch) p.catch(function() {})
|
|
|
this.tickNum = 0
|
|
this.tickNum = 0
|
|
|
},
|
|
},
|
|
|
setVolume(val) {
|
|
setVolume(val) {
|
|
@@ -280,7 +273,7 @@
|
|
|
document.addEventListener("keydown", function(e) {
|
|
document.addEventListener("keydown", function(e) {
|
|
|
if (e.key == "F12") {
|
|
if (e.key == "F12") {
|
|
|
that.reportErr("play", 'keydownF12');
|
|
that.reportErr("play", 'keydownF12');
|
|
|
- e.preventDefault();
|
|
|
|
|
|
|
+ try { e.preventDefault() } catch (err) {}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -348,12 +341,8 @@
|
|
|
}
|
|
}
|
|
|
// 主动暂停
|
|
// 主动暂停
|
|
|
let myPlayer = this.$refs.videoPlayer.player;
|
|
let myPlayer = this.$refs.videoPlayer.player;
|
|
|
- let curTimes = parseInt(myPlayer.currentTime());
|
|
|
|
|
- // 后退无心跳
|
|
|
|
|
- if (!force && this.media.position > (curTimes+8)){
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ let curTimes = parseInt(myPlayer.currentTime());
|
|
|
if (curTimes < 4) {
|
|
if (curTimes < 4) {
|
|
|
console.log("curTimes")
|
|
console.log("curTimes")
|
|
|
return;
|
|
return;
|
|
@@ -364,6 +353,7 @@
|
|
|
// 拉到后面
|
|
// 拉到后面
|
|
|
if (!isFinish) {
|
|
if (!isFinish) {
|
|
|
if (!this.onPlay) return;
|
|
if (!this.onPlay) return;
|
|
|
|
|
+ if(curTimes <= media.position) return;
|
|
|
}
|
|
}
|
|
|
if(window.navigator.webdriver){
|
|
if(window.navigator.webdriver){
|
|
|
this.reportErr("play", 'webdriver');
|
|
this.reportErr("play", 'webdriver');
|
|
@@ -411,6 +401,7 @@
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
|
.video-js {
|
|
.video-js {
|
|
|
|
|
+ touch-action: none;
|
|
|
.vjs-control-bar {
|
|
.vjs-control-bar {
|
|
|
.vjs-icon-custombutton {
|
|
.vjs-icon-custombutton {
|
|
|
font-family: VideoJS;
|
|
font-family: VideoJS;
|