fix danmaku seek
This commit is contained in:
parent
1e21471519
commit
7a8a2ac7ba
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -830,6 +830,14 @@ class DPlayer {
|
|||
}
|
||||
|
||||
this.video.currentTime = time;
|
||||
|
||||
for (let i = 0; i < this.dan.length; i++) {
|
||||
if (this.dan[i].time >= time) {
|
||||
this.danIndex = i;
|
||||
return;
|
||||
}
|
||||
this.danIndex = this.dan.length;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1140,17 +1148,17 @@ class DPlayer {
|
|||
flvPlayer.load();
|
||||
}
|
||||
|
||||
if (this.option.danmaku) {
|
||||
this.video.addEventListener('seeking', () => {
|
||||
for (let i = 0; i < this.dan.length; i++) {
|
||||
if (this.dan[i].time >= this.video.currentTime) {
|
||||
this.danIndex = i;
|
||||
return;
|
||||
}
|
||||
this.danIndex = this.dan.length;
|
||||
}
|
||||
});
|
||||
}
|
||||
// if (this.option.danmaku) {
|
||||
// this.video.addEventListener('seeking', () => {
|
||||
// for (let i = 0; i < this.dan.length; i++) {
|
||||
// if (this.dan[i].time >= this.video.currentTime) {
|
||||
// this.danIndex = i;
|
||||
// return;
|
||||
// }
|
||||
// this.danIndex = this.dan.length;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue