Playing a local video file on Apple TV

I am looping a simple slide show on an AppleTV. I am able to stream the video file just fine anand it plays great, but when I move the file locally (bundled), it fails to play on the actual AppleTV. However, it does play fine on the simulator.


I'm using Swift 4.1 Xcode 9.3 AppleTV 4th gen with tvOS 11.3.


Here is my code:

guard let fileURL = Bundle.main.path(forResource: "showroom", ofType:"m4v") else {
            debugPrint("video not found")
            return
        }
        playerAsset = AVAsset (url: URL(fileURLWithPath: fileURL))
        playerItem = AVPlayerItem(asset: playerAsset!)   //(url: fileURL as URL)
        queuePlayer = AVQueuePlayer(items: [playerItem!])
        playerLooper = AVPlayerLooper(player: queuePlayer!, templateItem: playerItem!)
  
  
        // Create a new AVPlayerViewController and pass it a reference to the player.
        let controller = AVPlayerViewController()
        controller.player = queuePlayer
  
        // Modally present the player and call the player's play() method when complete.
        present(controller, animated: true) {
            queuePlayer!.play()
        }

When I run on the device, I receive the following console messages and just a blank screen with a spinner on the AppleTV:


2018-04-03 09:13:00.225001-0500 ShowRoom[231:10709] [UIDevice.battery] No internal battery found


2018-04-03 09:13:00.404092-0500 ShowRoom[231:10709] [AXM-MediaDesc] Did observe change on. path:'currentItem' object:<AVQueuePlayer: 0x1c0027420> change:{
    kind = 1;
    new = "<AVPlayerItem: 0x1c40049f0, asset = <AVURLAsset: 0x1c4420c20, URL = file:///var/containers/Bundle/Application/D6FD828D-2109-4946-BCAE-4080A0114912/ShowRoom.app/showroom.m4v>>";

2018-04-03 09:13:00.469734-0500 ShowRoom[231:10709] [AXM-MediaDesc] Did observe change on. path:'currentItem' object:<AVQueuePlayer: 0x1c0027420> change:{
    kind = 1;
    notificationIsPrior = 1;
    old = "<AVPlayerItem: 0x1c40049f0, asset = <AVURLAsset: 0x1c4420c20, URL = file:///var/containers/Bundle/Application/D6FD828D-2109-4946-BCAE-4080A0114912/ShowRoom.app/showroom.m4v>>";

2018-04-03 09:13:00.470929-0500 ShowRoom[231:10709] [AXM-MediaDesc] Did observe change on. path:'currentItem' object:<AVQueuePlayer: 0x1c0027420> change:{
    kind = 1;
    new = "<AVPlayerItem: 0x1c40053c0, asset = <AVURLAsset: 0x1c4420c20, URL = file:///var/containers/Bundle/Application/D6FD828D-2109-4946-BCAE-4080A0114912/ShowRoom.app/showroom.m4v>>";
    old = "<AVPlayerItem: 0x1c40049f0, asset = <AVURLAsset: 0x1c4420c20, URL = file:///var/containers/Bundle/Application/D6FD828D-2109-4946-BCAE-4080A0114912/ShowRoom.app/showroom.m4v>>";

2018-04-03 09:13:00.543119-0500 ShowRoom[231:10709] [AXM-MediaDesc] Will stop processing legibility events for player item: (null)


Any ideas on what I'm missing here? I've also tried a .MOV file with the same results. Thanks!