SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

Speed controls #109

Closed defagos closed 2 years ago

defagos commented 2 years ago

We should add speed controls:

Analytics 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.

defagos commented 2 years ago

Beware:

defagos commented 2 years ago

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.

defagos commented 2 years ago

I made a proposal with the settings icon replacing the tracks icon but we'll keep the tracks icon.

defagos commented 2 years ago

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.

defagos commented 2 years ago

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.

defagos commented 2 years ago

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:

defagos commented 2 years ago

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).

pyby commented 2 years ago

@defagos Thanks for driving this nice player feature to the SRG SSR Apple player.