-
Notifications
You must be signed in to change notification settings - Fork 11
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
Provide hooks for track customization #507
Comments
We can likely use the following to specify a preferred language before playback starts, e.g. for subtitles: let criteria = AVPlayerMediaSelectionCriteria(preferredLanguages: ["en"], preferredMediaCharacteristics: nil)
queuePlayer.setMediaSelectionCriteria(criteria, forMediaCharacteristic: .legible) ( It might be enough to expose this API so that apps can force a language before playback starts. We should also likely provide an API which does not use MediaAccessibility when setting subtitles. Using this API apps could force subtitles on a player instance, e.g. when displayed in a news feed with sound muted. The same player could then be shared in full-screen where the interactive MediaAccessibility selection would take place. When reverting the player back to the feed the subtitles could then be forced again using the same API. I guess this API should be implemented as follows:
|
Use casesHere are a few use cases with nice behavior we should likely expect from a user experience perspective. The test setup is as follows:
No overridesSetup:
Expected result:
Audio overrideSetup:
Expected result:
Subtitle overrideSetup:
Expected result:
🚧 Learnings:
No override in playlistSetup:
Expected result:
Audio override in playlistSetup:
Expected result:
Subtitle override in playlistSetup:
Expected result:
Use case TODO 1Playlist with 3 items, Morning Show, Stream S with only Romansh and Klingon audio, Morning Show again. Probably need this intermediate test stream to be generated.
Use case TODO 2Playlist with 3 items, Morning Show, Stream S with only Romansh and Klingon audio, Morning Show again. Probably need this intermediate test stream to be generated.
TODO: Chinese subtitles should be preserved between items
Hints:
|
A remark about selection:
|
The
If there is namely no
selects English automatically by default, whereas
selects French by default. This can be easily tested by intercepting the Apple Bip Bop 16:9 basic example playlist with Charles and editing the corresponding response accordingly. |
A few things about
The above is true for audible and legible characteristics, and for all usual accessibility behaviors (AD, SDH). |
Automatic selection has been documented on the dedicated thread. |
The Since implementing a selector can be quite tricky it is likely better to wait until there is a real need before we expose this API. |
As a developer integrating Pillarbox I want to be able to reliably override the default track selection.
Acceptance criteria
Hints
MediaSelector
instead. If an app needs to override the selection logic it won't be per item but likely based on app-managed settings.Tasks
Check that there are not leaks (in particular the transition demo seems to leak. Maybe because of sheet presented from sheet?).Leak on iOS 17 beta, no issue on iOS 16ExposeNot yetMediaSelector
for customization?PlaybackView
.The text was updated successfully, but these errors were encountered: