Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change so that default presentation delay for DASH is configurable #1234 #1235

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Please keep the list sorted.

AdsWizz <*@adswizz.com>
Bonnier Broadcasting <*@bonnierbroadcasting.com>
Bryan Huh <[email protected]>
Esteban Dosztal <[email protected]>
Google Inc. <*@google.com>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

Aaron Vaage <[email protected]>
Andy Hochhaus <[email protected]>
Benjamin Wallberg <[email protected]>
Bryan Huh <[email protected]>
Chad Assareh <[email protected]>
Chris Fillmore <[email protected]>
Expand Down
6 changes: 5 additions & 1 deletion externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ shakaExtern.DrmConfiguration;
* customScheme: shakaExtern.DashContentProtectionCallback,
* clockSyncUri: string,
* ignoreDrmInfo: boolean,
* xlinkFailGracefully: boolean
* xlinkFailGracefully: boolean,
* defaultPresentationDelay: number
* }}
*
* @property {shakaExtern.DashContentProtectionCallback} customScheme
Expand All @@ -508,6 +509,9 @@ shakaExtern.DrmConfiguration;
* existing contents. If false, xlink-related errors will be propagated
* to the application and will result in a playback failure. Defaults to
* false if not provided.
* @property {number} defaultPresentationDelay
* A default presentationDelay if suggestedPresentationDelay is missing
* in the MPEG DASH manifest, has to be bigger than minBufferTime * 1.5.
*
* @exportDoc
*/
Expand Down
19 changes: 5 additions & 14 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ shaka.dash.DashParser = function() {
shaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;


/**
* The default MPD@suggestedPresentationDelay in seconds.
*
* @private
* @const {number}
*/
shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 10;


/**
* @typedef {
* !function(!Array.<string>, ?number, ?number):!Promise.<!ArrayBuffer>
Expand Down Expand Up @@ -491,12 +482,12 @@ shaka.dash.DashParser.prototype.processManifest_ =
// available, and anything less than minBufferTime will cause buffering
// issues.
//
// We have decided that our default will be 1.5 * minBufferTime, or 10s,
// whichever is larger. This is fairly conservative. Content providers
// should provide a suggestedPresentationDelay whenever possible to optimize
// the live streaming experience.
// We have decided that our default will be 1.5 * minBufferTime,
// or 10s (configurable) whichever is larger. This is fairly conservative.
// Content providers should provide a suggestedPresentationDelay
// whenever possible to optimize the live streaming experience.
var defaultPresentationDelay = Math.max(
shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_,
this.config_.dash.defaultPresentationDelay,
minBufferTime * 1.5);
var presentationDelay = suggestedPresentationDelay != null ?
suggestedPresentationDelay : defaultPresentationDelay;
Expand Down
3 changes: 2 additions & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,8 @@ shaka.Player.prototype.defaultConfig_ = function() {
},
clockSyncUri: '',
ignoreDrmInfo: false,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
},
streaming: {
Expand Down
3 changes: 2 additions & 1 deletion test/dash/dash_parser_content_protection_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ describe('DashParser ContentProtection', function() {
clockSyncUri: '',
customScheme: callback,
ignoreDrmInfo: ignoreDrmInfo,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
});
var playerEvents = {
Expand Down
3 changes: 2 additions & 1 deletion test/dash/dash_parser_live_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ describe('DashParser Live', function() {
clockSyncUri: '',
customScheme: function(node) { return null; },
ignoreDrmInfo: false,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
});
playerInterface = {
Expand Down
3 changes: 2 additions & 1 deletion test/hls/hls_live_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ describe('HlsParser live', function() {
customScheme: function(node) { return null; },
clockSyncUri: '',
ignoreDrmInfo: false,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
};

Expand Down
3 changes: 2 additions & 1 deletion test/hls/hls_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ describe('HlsParser', function() {
customScheme: function(node) { return null; },
clockSyncUri: '',
ignoreDrmInfo: false,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
};

Expand Down
3 changes: 2 additions & 1 deletion test/test/util/dash_parser_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ shaka.test.Dash.makeDashParser = function() {
customScheme: function(node) { return null; },
clockSyncUri: '',
ignoreDrmInfo: false,
xlinkFailGracefully: false
xlinkFailGracefully: false,
defaultPresentationDelay: 10
}
});
return parser;
Expand Down