Closed defagos closed 5 years ago
This behavior crosses app boundaries. Playing http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8 in Safari will restore the previous subtitle track as well.
This behavior is probably related to MediaAccessibility
, described at WWDC. AVPlayerViewController
namely only displays SDH choices (unlike our tracks controller which displays everything), and an Automatic choice probably based on the preferred language order.
We should probably improve our track selection popup to closely match standard behavior.
Yep, this is related to MediaAccessibility
. After having changed languages in AVPlayerViewController
, MACaptionAppearanceCopySelectedLanguages
returns the newly set language. We must probably do the same and call MACaptionAppearanceAddSelectedLanguage
.
There was far more than restoration. I also improved the way subtitles can be enabled, using MediaAccessibility
settings:
This mimics AVPlayerViewController
behavior. For this reason, no audio restoration is performed at all.
To improve the user experience, we also now display for each track option:
AVPlayerViewController
only use the display name, but having both is better (most notably if the friendly title contains more information or is localized). This behavior is similar to the user experience when changing the device language (new language as title, translation in the current language as subtitle).
Moreover, the tracks popover now stays visible after having selected an option. This makes it possible to change audio and subtitle tracks at the same time, without having to reopen the popover. I also added two new delegate methods, so that custom player layouts can be informed when the popover is being displayed or hidden. SRGMediaPlayerViewController
is now using these delegate methods to prevent its user interface from being hidden while the popover is displayed.
The previous subtitle setting should be restored (if possible) when playing a media. This seems to work somehow with
AVPlayerController
(which then changes the subtitles loaded by SRG Media Player). Something must therefore be missing in SRG Media Player implementation.Issue type
Incorrect behavior
Description of the problem
Reproducibility
Always reproducible
Steps to reproduce
Note that audio tracks are not restored (repeat the same steps with iOS standard player, but changing audio tracks).