Closed pyby closed 3 years ago
Thanks, was just gonna create this issue to write this comment. And I now just saw that you have a fix proposal as well, and that we named our branches quite similarly. We are probably two parts of the same brain :)
I have a sligthly different fix proposal than yours, but at the same location. I think it should suffice to test whether external playback is active or not instead of the current condition. I cannot test this intuition entirely with my setup (I can only simulate it by setting usesExternalPlaybackWhileExternalScreenIsActive
to NO
).
The idea is:
externalPlaybackActive
is YES
if and only if video playback occurs externally. So I think the last part of your test condition is actually implicit, thus the simpler test I propose.I'll let you have a look next week, as you have such a device at home. My fix is on feature/airplay-audio-only-fix
, yours on feature/airplay-audio-only
.
I didn't mention my fix yet because:
self.mediaType == SRGMediaPlayerMediaTypeVideo
, but self.mediaType
is known to not be fully trusted over AirPlay. Probably the reason why my tests failed (Open the application, then the player with a VoD over Airplay already configured). ❌externalPlaybackActive
seems a good way. Indicates whether the player is currently playing video in "external playback" mode.AVPlayer
already manages the media type, regarding the externalPlaybackActive
property.Your fix branch works as expected, tested on my side. (Letterbox Demo and Play SRG debug). Thank you.
Issue type
Incorrect behavior
Description of the problem
When playing a video over AirPlay audio only (Apple AirPort Express, Sono…), the device turns off after the iOS settings delay.
Play SRF, AppStore review:
This issue comes from #84 . Probably from this part of code.
Environment information
Reproducibility
Always reproducible
Code sample
Play iOS code in production
Steps to reproduce
I was abled to reproduce in Letterbox Demo and Play SRG apps easily.
Current result: The device screen turns OFF.
Expected result: The device screen prevents to turn OFF.