Skip to content

Audio track and subtitle support improvements

Compare
Choose a tag to compare
@defagos defagos released this 09 Mar 11:14
· 408 commits to master since this release

Audio tracks and subtitle support

Audio track and subtitle support has been greatly improved to be more consistent and user-friendly.

iOS and tvOS

  • Default audio selection now takes the application language into account, as well as user preferred languages. For example, if an application is only translated in French but offers content with French and English audio, the default language is now French. Previously, this depended only on user preferred languages and could be English if the user preferred language was English, even though the application was available in French only.
  • Automatic subtitle selection works as it should. It now correctly automatically enables subtitles if the audio is not a language the user is supposed to understand, but that subtitles the user can understand are available (based on app and system preferred languages).
  • Media configuration could be made programatically by assigning a block to the mediaConfigurationBlock. This single block has been replaced with two specific audioConfigurationBlock and subtitleConfigurationBlock blocks. Refer to the updated documentation to see how these blocks should be implemented so that you can update your code appropriately.
  • Subtitle styling was previously made with the mediaConfigurationBlock. It must now be made with the new dedicated textStyleRules controller property.
  • The -reloadMediaConfigurationWithBlock: and -reloadPlayerConfigurationWithBlock: controller methods have been removed. If you need to update a configuration block and apply the changes, update the associated block property and call -reloadMediaConfiguration or -reloadPlayerConfiguration afterwards.

iOS only

  • Audio track and subtitle choices are correctly preserved when casting over AirPlay and not overridden by the receiver (e.g. Apple TV) anymore.
  • The audio track and subtitle user interface has been improved. The current choice is always displayed (even if not available for the specified content). Empty selection is not possible anymore (this was clearly misleading for users) and information to the user has been improved.
  • Empty subtitle tracks are now omitted. This avoids SRGTracksButton from being displayed when not needed, and eliminates dumb choices with no visible effect from the tracks popover altogether.

Other changes

A few fixes and improvements have been made as well.

iOS and tvOS

  • Player and UI component energy efficiency has been improved (the number of refreshes has been reduced). In particular, non-required background activity has been eliminated.

iOS only

  • SRGPlaybackButton can be assigned an optional delegate for action and accessibility customization if needed.
  • Picture in picture and AirPlay play along in a more natural way. When PiP is enabled, external playback is now prevented automatically (only audio might is routed to the receiver).
  • Documentation for PiP support has been improved. In particular, correct restoration requires a custom transition to be implemented which was previously not clearly stated. Refer to the documentation and examples for more information.