Skip to content

On the PlayStation 5, set Infinity MediaSource duration for live contents#1250

Merged
peaBerberian merged 2 commits intomasterfrom
fix/ps5-duration-and-seek
May 16, 2023
Merged

On the PlayStation 5, set Infinity MediaSource duration for live contents#1250
peaBerberian merged 2 commits intomasterfrom
fix/ps5-duration-and-seek

Conversation

@peaBerberian
Copy link
Collaborator

The Playstation 5 have issues when the MediaSource's duration property is set to a very high value (playback freezes) but not when setting it to Infinity, which is what the HTML spec as of now recommends for live contents.

However setting the MediaSource's duration property to Infinity seems 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 Infinity require us to use another MSE API, setLiveSeekableRange to 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, returning true based on a whitelist of platform for which
it has been detected that high duration values cause issues but setting it to Infinity AND playing with setLiveSeekableRange does not. It only returns true for 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 setLiveSeekableRange API on the PlayStation 5 to stay close to other platforms' implementation), I also factorized the function and its inner comment.

@peaBerberian peaBerberian added bug This is an RxPlayer issue (unexpected result when comparing to the API) Compatibility Relative to the RxPlayer's compatibility with various devices and environments labels May 15, 2023
@peaBerberian peaBerberian force-pushed the fix/ps5-duration-and-seek branch from d37386c to 4789e56 Compare May 15, 2023 15:45
@peaBerberian peaBerberian force-pushed the fix/ps5-duration-and-seek branch from 4789e56 to 36385cf Compare May 16, 2023 09:25
@peaBerberian peaBerberian added this to the 3.30.1 milestone May 16, 2023
@peaBerberian peaBerberian merged commit 585d13f into master May 16, 2023
@peaBerberian peaBerberian mentioned this pull request Jun 13, 2023
@peaBerberian peaBerberian modified the milestones: 3.30.1, 3.31.0 Jun 13, 2023
@peaBerberian peaBerberian deleted the fix/ps5-duration-and-seek branch July 6, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This is an RxPlayer issue (unexpected result when comparing to the API) Compatibility Relative to the RxPlayer's compatibility with various devices and environments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant