apple-tvtvmltvjs

Streaming video in an Apple TV TVJS app works in the simulator but fails on the device with an arcane error


I am trying to stream video in a TVML app. Streaming the video works in the simulator, but on the device I get an arcane error message that doesn't explain anything.

I'm using the code from this example with the below code changed in the function startPlayback(event) section.

var player = new Player();

player.playlist = new Playlist();

var video = new MediaItem('video', 'http://cdnapi.kaltura.com/p/1626222/sp/162622200/playManifest/entryId/0_eq9i2jbt/format/url/protocol/http/a.m3u8');
video.title = 'title';
video.subtitle = 'subtitle';
video.description = 'description';
video.artworkImageURL = 'artworkImageURL';

player.playlist.push(video);

setPlaybackEventListeners(player);

player.play();

Error Message:

2016-04-05 18:05:08.821 TeeVee[255:12143] #T:[Main] #Notice #SYSTEM : Template controller: <_TVProductTemplateController: 0x12f021400> 2016-04-05 18:05:14.298 TeeVee[255:12143] #T:[Main] #Error #SYSTEM : Error occurred: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x130519500 {Error Domain=NSOSStatusErrorDomain Code=-16044 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16044), NSLocalizedDescription=The operation could not be completed} 2016-04-05 18:05:14.298 TeeVee[255:12143] #T:[Main] #Error #SYSTEM : Stopping due to error


Solution

  • Ugh, it was an AppTransport issue. We're whitelisting our Kaltura domains, but I guess we're missing one. When I disable AppTransport completely, the app worked without error. I wish Apple would display the domain that's not whitelisted or https when the error occurs.