代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-28 14:13:23 +08:00
parent b2d9b4fc9c
commit aeb4560684
2 changed files with 28 additions and 24 deletions

View File

@ -133,22 +133,24 @@ export default {
});
this.on('error', function() {
console.log('error');
const src = video.getMedia().src[0].src;
video.reset();
video.src(src);
video.load();
video.play();
var currentTime = video.currentTime();
lastTime = currentTime;
if (video.error().code == '') {
const src = video.getMedia().src[0].src;
video.reset();
video.src(src);
video.load();
video.play();
var currentTime = video.currentTime();
lastTime = currentTime;
}
});
this.on('seeked', function() {
// ,
console.log('seeked');
var currentTime = video.currentTime();
if (currentTime == lastTime) {
video.currentTime(currentTime + 10000);
video.play();
}
// var currentTime = video.currentTime();
// if (currentTime != lastTime) {
// // video.currentTime(currentTime + 10000);
// video.play();
// }
// video.play();
});
this.on('loadedmetadata', function() {

View File

@ -59,21 +59,23 @@ export default {
this.on('seeked', function() {
// ,
console.log('seeked');
var currentTime = video.currentTime();
if (currentTime == lastTime) {
video.currentTime(currentTime + 10000);
video.play();
}
// var currentTime = video.currentTime();
// if (currentTime != lastTime) {
// video.currentTime(currentTime + 10000);
// video.play();
// }
});
this.on('error', function() {
console.log('error');
const src = video.getMedia().src[0].src;
video.reset();
video.src(src);
video.load();
video.play();
var currentTime = video.currentTime();
lastTime = currentTime;
if (video.error().code == '') {
const src = video.getMedia().src[0].src;
video.reset();
video.src(src);
video.load();
video.play();
var currentTime = video.currentTime();
lastTime = currentTime;
}
});
this.on('loadedmetadata', function() {
console.log('loadedmetadata');