Skip to content

Commit 8298cbb

Browse files
committed
Try to speedup shaka player URL switching
1 parent 7b6e578 commit 8298cbb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

platform/video.shaka/backend.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,19 @@ Player.prototype.setupDrm = function(type, options, callback, error) {
4848
var config = { drm: { servers: laServer } }
4949
var ui = this.ui
5050
log("DefaultBand", ui.maxBandwidth)
51+
config.abr = { switchInterval: 1 }
5152
if (ui.maxBandwidth || ui.minBandwidth) {
5253
var restrictions = {}
5354
if (ui.maxBandwidth)
5455
restrictions.maxBandwidth = ui.maxBandwidth
5556
if (ui.minBandwidth)
5657
restrictions.minBandwidth = ui.minBandwidth
5758

58-
config.abr = { restrictions: restrictions }
59+
config.abr.restrictions = restrictions
5960
}
6061

62+
config.streaming = { bufferingGoal: 1, rebufferingGoal: 1 }
63+
6164
log("SetupDRM", config)
6265
this.shakaPlayer.configure(config);
6366
if (callback)
@@ -171,7 +174,7 @@ Player.prototype.setAudioTrack = function(trackId) {
171174

172175
this.shakaPlayer.configure({
173176
abr: abr,
174-
streaming: { bufferingGoal : 15, rebufferingGoal: 4 }
177+
streaming: { bufferingGoal: 1, rebufferingGoal: 1 }
175178
});
176179
this._language = found[0].language
177180
this.shakaPlayer.selectVariantTrack(video, true)
@@ -211,7 +214,10 @@ Player.prototype.setVideoTrack = function(trackId) {
211214
if (ui.minBandwidth)
212215
abr.restrictions.minBandwidth = ui.minBandwidth
213216

214-
this.shakaPlayer.configure({ abr: abr });
217+
this.shakaPlayer.configure({
218+
abr: abr,
219+
streaming: { bufferingGoal: 1, rebufferingGoal: 1 }
220+
});
215221
this._videoTrackHeight = video.height
216222
this.shakaPlayer.selectVariantTrack(video)
217223
}

0 commit comments

Comments
 (0)