On the PlayStation 5, set Infinity MediaSource duration for live contents#1250
Merged
peaBerberian merged 2 commits intomasterfrom May 16, 2023
Merged
On the PlayStation 5, set Infinity MediaSource duration for live contents#1250peaBerberian merged 2 commits intomasterfrom
peaBerberian merged 2 commits intomasterfrom
Conversation
d37386c to
4789e56
Compare
4789e56 to
36385cf
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Playstation 5 have issues when the
MediaSource'sdurationproperty is set to a very high value (playback freezes) but not when setting it toInfinity, which is what the HTML spec as of now recommends for live contents.However setting the
MediaSource'sdurationproperty toInfinityseems more risky, considering all platforms we now support, than setting it at a relatively high 2^32 value which is what we do generally.Moreover, setting it to
Infinityrequire us to use another MSE API,setLiveSeekableRangeto properly allow seeking. We're used to MSE issues so I'm not too confident of using another MSE API for all platforms directly.So I added a new method in
compat, returningtruebased on a whitelist of platform for whichit has been detected that high
durationvalues cause issues but setting it to Infinity AND playing withsetLiveSeekableRangedoes not. It only returnstruefor now on the PlayStation 5.I then rely on that method return value for performing those work-arounds. Also because now the ~2^32 work-around may appear in two places (either on the MediaSource's duration like before, or on the
setLiveSeekableRangeAPI on the PlayStation 5 to stay close to other platforms' implementation), I also factorized the function and its inner comment.