Reset playbackRate once player has caught up to source

This commit is contained in:
Omar Roth 2019-05-20 12:15:48 -05:00
parent 06bf0c2622
commit 4345b1d930
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2

View file

@ -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');