Releases: SRGSSR/srgmediaplayer-apple
Maintenance release
- Mitigate a possible crash when playback fails for some reason.
Maintenance release
- Fix stall detection, avoiding the controller to sometimes stay stuck in this state.
- Avoid screen dimming when playing a video with sound routed over AirPlay.
- Correctly take into account SDH accessibility opt-in when choosing subtitles automatically.
Date support for livestreams
Date support
This release adds support for dates when playing a livestream:
- When playing a livestream, the
currentDate
property ofSRGMediaPlayerController
provides the date corresponding to the current position, if any. - For livestreams the player can equivalently start playback or seek to time or date-based positions. New
SRGMark
andSRGMarkRange
classes have been introduced to support this duality. - (Breaking change) To support the time / date duality, segments are not defined anymore with time ranges, but with mark ranges. The previously required
-srg_timeRange
property has therefore been replaced with-srg_markRange
. - (Breaking change)
SRGTimeSliderDelegate
methods receive an optional date parameter. Be sure your implementation adopt the new method signatures.
This feature works best if date information is supplied in the streams themselves with EXT-X-PROGRAM-DATE-TIME
tags. This ensures that the stream time and the wall-clock time can be related. If no such information is available in your streams you can still use date-based seeking, but accuracy might not be optimal (there is a delay between broadcasting and streaming). To mitigate this issue, you can measure which delay there is between broadcasting and streaming, and provide a SRGMediaPlayerUserInfoStreamOffsetKey
as userInfo
when playing your stream.
Fixes
- Ensure the player prevents the device from sleeping only when required. For video background playback proper behavior requires a device supporting iOS 12 or above.
- Fix imprecise seeks when a Bluetooth handset is connected.
- Fix issue preventing the player from correctly resuming when seeking outside the available media range.
- Fix tvOS build issue with Xcode 11.4.
Audio track and subtitle support improvements
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 specificaudioConfigurationBlock
andsubtitleConfigurationBlock
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 dedicatedtextStyleRules
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.
tvOS compatibility
- The library is compatible with tvOS.
- Many properties are now key-value observable (e.g.
timeRange
ormediaType
). If your implementation previously used periodic time observers to check these properties for changes, you should now simply respond to changes instead. - The AirPlay button now supports two different images for audio and video. The previously unique
image
property has been removed. - Semantic versioning has been adopted.
- The project has been renamed as
srgmediaplayer-apple
.
iOS 13 support
- The project has been updated to support iOS 13 and Xcode 11.
- The track selection interface has been updated:
- Dark mode is supported on iOS 13 and above. A new
userInterfaceStyle
property forSRGTracksButton
lets you choose whether the appearance is controlled by the system, or whether the track selection interface should always be displayed with a light or dark theme. - The track selection interface displays either as a popover or modal depending on the available screen width.
- Dark mode is supported on iOS 13 and above. A new
- The
SRGMediaPlayerViewController
icons have been updated for a more consistent look & feel. - The
SRGTracksButtonDelegate
delegate methods have been renamed.
Maintenance release
- Tracks popover anchoring has been made more reliable.
Background video playback support
- Background video playback behavior can be finely controlled with the
viewBackgroundBehavior
controller property. If you want to allow lock screen playback on devices running iOS 12.3 and above (the standard behavior ofSRGMediaPlayerController
until version 2.6), useSRGMediaPlayerViewBackgroundBehaviorDetachedWhenDeviceLocked
. - Fix an issue with Akamai streams containing subtitles when
start
and / orend
times are provided (playback not ending correctly because of subtitles longer than the stream). - Route detection and AirPlay button layout performance have been improved on iOS 11 and above.
Improved subtitle support
- Support for subtitle selection has been improved to better take Accessibility settings (SDH / Audio description) into account, as well as user preferred languages.
- A media configuration block can be optionally be attached to a media player controller. This block is called when a media is ready to play, and provides a convenient way to customize the
AVPlayerItem
before it is played. This block is mostly provided as a way to customize subtitle and audio tracks programatically (#64). - Playback methods which expected an
AVPlayerItem
object now expect anAVURLAsset
object instead. Accordingly, theSRGMediaPlayerPreviousPlayerItemAssetKey
constant has been renamed asSRGMediaPlayerPreviousURLAssetKey
. - Player stalls are now reported in a reliable way.
- Audio-only playback detection has been improved (#63).
- A new
SRGMediaPlayerPreviousSelectedSegmentKey
is supplied in playback state change notifications to provide information about any previously selected segment. - The subtitle popover style cannot be overridden anymore with
UIAppearance
. - The framework footprint at application startup time has been reduced.
End of stream behavior fix
This release fixes minor end of stream behavior regressions.