mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-27 16:57:52 +01:00
Reset playbackRate once player has caught up to source
This commit is contained in:
parent
06bf0c2622
commit
4345b1d930
@ -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 New Issue
Block a user