-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
specific rebufferingGoal override manifest one #1547 #1581
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
add the config field manifest.dash.ignoreMinBufferTime, which will default to false. If true, the DASH parser will ignore minBufferTime in the manifest, such that streaming.rebufferingGoal is the only factor in play.
lib/dash/dash_parser.js
Outdated
let ignoreMinBufferTime = this.config_.dash.ignoreMinBufferTime; | ||
let minBufferTime = 0; | ||
if (!ignoreMinBufferTime) { | ||
minBufferTime = | ||
XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseAttr()
can return null
if there's no such attribute, so please add || 0
to the end of this statement.
@@ -101,6 +101,7 @@ shaka.util.PlayerConfiguration = class { | |||
ignoreDrmInfo: false, | |||
xlinkFailGracefully: false, | |||
defaultPresentationDelay: 10, | |||
ignoreMinBufferTime: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be added to externs/shaka/player.js, in the shaka.extern.DashManifestConfiguration
type. Please add @property
to describe the property, and also add it to the @typedef
block.
This will probably produce a few build errors, as the DASH config object in several of our tests will need to be updated to match the updated type. Be sure to run python build/all.py
and fix any errors that come up.
After that, please add a new test in test/dash/dash_parser_manifest_unit.js
that shows the effect of ignoreMinBufferTime. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not yet sure on how to write a test properly but will check it later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest looking at the very last test in that file ('exposes Representation IDs') as a template.
The important parts of the test are:
- Fake manifest text. This can be very simple for your case, with only one Representation.
- A call to
fakeNetEngine.setResponseText()
so the fake manifest text gets returned from the networking engine. - Any necessary configuration passed to
parser.configure()
. For you, this should set the new flag. - The (async) call to
parser.start()
to parse the manifest and get the results. - Expectations on the output. You would expect that minBufferTime is 0, in spite of the attribute in the manifest text.
Does that help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitly help, thanks
Thank you for contributing! You should also add yourself to CONTRIBUTORS and AUTHORS files (alphabetically). |
minBufferTime should have a default value of 0
externs/shaka/player.js
Outdated
@@ -536,6 +537,10 @@ shaka.extern.DrmConfiguration; | |||
* @property {number} defaultPresentationDelay | |||
* A default presentationDelay if suggestedPresentationDelay is missing | |||
* in the MPEG DASH manifest. This has to be bigger than minBufferTime * 1.5. | |||
* @property {boolean} ignoreMinBufferTime | |||
* If true will cause DASH parser to ignore minBufferTime from manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor English nit: This sentence needs a period at the end, and the next line should begin with a capital letter.
i added 2 tests for
dont know if the second one is necessary or if it is already tested somehow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
All tests passed! |
Released in v2.5.0-beta2. |
EDIT: pull request updated to add manifest.dash.ignoreMinBufferTime
i'm not really satisfied of adding a defaultRebufferingGoal to config but at least changes in code are very lightsee #1547