Skip to content

Commit

Permalink
Try to speedup shaka player URL switching
Browse files Browse the repository at this point in the history
  • Loading branch information
comrat committed Oct 21, 2024
1 parent 7b6e578 commit 8298cbb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions platform/video.shaka/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ 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)
restrictions.maxBandwidth = ui.maxBandwidth
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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 8298cbb

Please sign in to comment.