Closed defagos closed 2 years ago
Beware:
For livestreams locking the playback rate is difficult (as we don't know that a stream is live until we play it). Moreover this seems to work, at least probably using some buffering (< 1 are applied, > 1 are ignored because we cannot play in the future). For the moment I won't do anything special, we'll see if work is really required to prevent playback speed changes for livestreams.
I made a proposal with the settings icon replacing the tracks icon but we'll keep the tracks icon.
I tested the addition of a playback speed button on tvOS. On my tvOS 15.4 beta device the button is deselected after making a choice. This is apparently not related to changes triggering a button reload but most likely an issue which I don't experience in the ivOS 15.3 simulator.
Still asking myself about the icon and popup title. If there are only speed settings available (e.g. stream without subtitles, audio stream) then the icon and title seem a bit odd.
I finished the implementation, which is available for review on feature/speed-playback-speed
.
The question above still remains to be answered, but the API and testing work is done. I see three possibilities:
The speed has been restricted to 1x for livestreams without DVR. Slower speeds could work (buffering would still need to be studied) but the UX obtained is awkward (you cannot fast forward to the live conditions).
@defagos Thanks for driving this nice player feature to the SRG SSR Apple player.
We should add speed controls:
muted
, just stores the value and applies it to the underlyingAVPlayer
).AVPlayer
does not provide this piece of information AFAIK. We should display a message telling the user that the desired speed might not be applied if the stream does not support it.AVPlayer
limitation (easy to check withAVPlayerViewController
). If this is a limitation then we should probably ensure the rate is 1 in live conditions. If not possible then we must probably limit the rate to 1 for livestreams.SRGMediaPlayerViewController
buttonAnalytics implemented on top of Media Player (e.g. our SRG Analytics library) can use a combination of the
isLive
flag and the playback rate value to send the correct value, depending on specifications. comScore API, for example, does not provide any way to inform the SDK that a stream is live, so client code has to do this work on its own so that correct values are transmitted.