mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Reset playbackRate once player has caught up to source
This commit is contained in:
parent
06bf0c2622
commit
4345b1d930
1 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
var options = {
|
||||
preload: "auto",
|
||||
liveui: true,
|
||||
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0],
|
||||
controlBar: {
|
||||
children: [
|
||||
|
@ -154,6 +155,13 @@ if (video_data.params.video_start > 0 || video_data.params.video_end > 0) {
|
|||
player.volume(video_data.params.volume / 100);
|
||||
player.playbackRate(video_data.params.speed);
|
||||
|
||||
player.on('waiting', function () {
|
||||
if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) {
|
||||
console.log('Player has caught up to source, resetting playbackRate.')
|
||||
player.playbackRate(1);
|
||||
}
|
||||
});
|
||||
|
||||
if (video_data.params.autoplay) {
|
||||
var bpb = player.getChild('bigPlayButton');
|
||||
|
||||
|
|
Loading…
Reference in a new issue