From 8298cbb9bb890eb5e886bdba27b911e9c0ef8516 Mon Sep 17 00:00:00 2001 From: Alexey Pobery Date: Mon, 21 Oct 2024 22:53:00 +0300 Subject: [PATCH] Try to speedup shaka player URL switching --- platform/video.shaka/backend.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/video.shaka/backend.js b/platform/video.shaka/backend.js index 13754a56..9309a631 100644 --- a/platform/video.shaka/backend.js +++ b/platform/video.shaka/backend.js @@ -48,6 +48,7 @@ Player.prototype.setupDrm = function(type, options, callback, error) { var config = { drm: { servers: laServer } } var ui = this.ui log("DefaultBand", ui.maxBandwidth) + config.abr = { switchInterval: 1 } if (ui.maxBandwidth || ui.minBandwidth) { var restrictions = {} if (ui.maxBandwidth) @@ -55,9 +56,11 @@ Player.prototype.setupDrm = function(type, options, callback, error) { if (ui.minBandwidth) restrictions.minBandwidth = ui.minBandwidth - config.abr = { restrictions: restrictions } + config.abr.restrictions = restrictions } + config.streaming = { bufferingGoal: 1, rebufferingGoal: 1 } + log("SetupDRM", config) this.shakaPlayer.configure(config); if (callback) @@ -171,7 +174,7 @@ Player.prototype.setAudioTrack = function(trackId) { this.shakaPlayer.configure({ abr: abr, - streaming: { bufferingGoal : 15, rebufferingGoal: 4 } + streaming: { bufferingGoal: 1, rebufferingGoal: 1 } }); this._language = found[0].language this.shakaPlayer.selectVariantTrack(video, true) @@ -211,7 +214,10 @@ Player.prototype.setVideoTrack = function(trackId) { if (ui.minBandwidth) abr.restrictions.minBandwidth = ui.minBandwidth - this.shakaPlayer.configure({ abr: abr }); + this.shakaPlayer.configure({ + abr: abr, + streaming: { bufferingGoal: 1, rebufferingGoal: 1 } + }); this._videoTrackHeight = video.height this.shakaPlayer.selectVariantTrack(video) }