Search code examples
swiftuitvos

tvOS 17.2 won't play certain videos


Loading a video that played on tvOS 17, won't now play in tvOS 17.2. It isn't true for all videos or even all videos of a certain type.

This code works fine on tvOS 17, but not on 17.2

import SwiftUI
import AVKit
struct ContentView: View {
    var body: some View {
        let player = AVPlayer(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!)
        VideoPlayer(player: player)
            .onAppear {
                player.play()
            }
    }
}

I have tried reloading the metadata. I tried making the player from an AVAsset rather than a URL. I can't seem to see what is making it work with some videos and not all and what is different from tvOS 17 to 17.2.


Solution

  • I believe there might be a problem specifically with the tvOS 17.2 simulator. In my experience, everything functioned as expected when testing on an actual device running tvOS 17.2.