windowsavplayerhttp-live-streamingtvosavplayeritem

AVPlayer failure with HLS live stream url on tvOS 13.4 (Works on tvOS 13.3)


I have an Apple TV app that plays HLS live streams from windows media services. The videos were playing perfectly on tvOS 13.3 but since testing on tvOS 13.4 I now get a cryptic error when I attempt to begin streaming the video. The URL format I am using is:

https://myhost.streaming.mediaservices.windows.net/{uuid}/{uuid}.ism/manifest(format=m3u8-aapl, audio-only=false)

And here is the error output from tvOS devices running 13.4 when I try to load an AVPlayer with that url:

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12746), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x6000000c8360 {Error Domain=NSOSStatusErrorDomain Code=-12746 "(null)"}}

I tracked the -12746 error down to this documentation but again not many details there. I also checked the errorLog() of the player item but there's nothing there.

The other interesting thing is I can recreate this error when I follow Apple's Creating a Basic Video Player example. Just copy and pasted their test url, it plays fine on tvOS 13.3 and below but fails with the above error on tvOS 13.4.

Has anyone else seen this error on tvOS 13.4 and if so did you find a workaround?

Thanks for the time.


Solution

  • I've face same error. It seems that it was issue with Simulator and probably with coreaudio on my MacBook Pro "16. After restarting Simulator and terminating coreaudiod process in Activity Monitor, video start playing in tvOS 13.4 simulator and in tvOS 13.3 Also at real device I didn't face this problem with latest tvOS (13.4.6)