Closed defagos closed 6 years ago
Akamai support has been contacted. We should strive to avoid a fix on our side since we have many issues to deal with (playhead position, current segment, whether this segment was selected, etc.):
We have discovered a major incompatibility between Akamai secure token and Airplay on Apple devices (iPhone and iPad). When you play content over Airplay, e.g. on an Apple TV, the Akamai token-protected stream URL is sent from the iPhone / iPad to the Apple TV receiver, which will start playing it. But if the token has expired in the meantime (which is very likely since tokens have a lifetime of ~30 seconds), the Apple TV will receive an authorization error and won’t be able to play the content.
This problem affects our iOS applications as well as our web-based player on mobile.
You can easily reproduce the problem with the web-based player using an iPhone or iPad and an Apple TV:
If you perform steps 1 and 2 in a row, playback will resume on the Apple TV. But if you repeat the same procedure, waiting 30 seconds between steps 1 and 2, playback will not resume on the Apple TV since the token has expired in the meantime.
We cannot control how Airplay works (this is a private Apple protocol), and there is no way to ask the Apple TV to retrieve a fresh token. We assume this problem was already discovered by some of your clients since it should be pretty common. There are probably some guidelines on your side how to handle Airplay in a way compatible with Akamai secure token. Could you provide us with such information or do you have any technical contact person we could have a discussion with?
We have mitigated token expiration issues where we could (#63), but in all cases involving AirPlay there is sadly nothing to be done.
Until we stop using Akamai tokens and replace them with proper DRM solutions, we cannot do much more. The current behavior with non-protected content is correct (even in tricky cases like AirPlay in multi-controller configurations, see #123), but there is nothing to do for protected streams.
Gosh I was wrong. It is possible to have correct behavior using a custom asset resource loader delegate. This will be improved as part of our work on DRM support.
For token-protected content, playback will fail if Airplay is enabled ~30 seconds after the video has been started on a phone or tablet.
Issue overview
Description of the problem
The playback URL is sent as is from the iOS device to the Airplay receiver when Airplay is enabled (see https://nto.github.io/AirPlay.html#video). After ~30 seconds, and for token-protected content, the URL which is sent to the receiver is not valid anymore, though, since the token has expired. Content therefore fails to play on the Airplay device, and Letterbox receives a cryptic Unknown error from the internal
AVPlayer
:Environment information
Reproducibility
Steps to reproduce