Posts

Post not yet marked as solved
2 Replies
Adding a .buffer before .values was the answer. Thanks for reading!
Post not yet marked as solved
21 Replies
I'm having the exact same problem on tvOS, iPadOS, and iOS. Not on macOS (non-Catalyst). The video is also "black with sound" on real devices, too. Exact same code works perfectly fine when generated from Xcode 14.2 The problem seems to be with AVPlayer. You can test this quite easily. Start a new Xcode project in Xcode 14.3, put this in your ContentView.swift: import AVKit import SwiftUI let avPlayer = AVPlayer(url: URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8")!) struct ContentView: View { var body: some View { VideoPlayer(player: avPlayer) .onAppear { avPlayer.play() } } } ...and witness the darkness! You could replace VideoPlayer(player:) with a represented AVPlayerViewController or whatever you like, always black video with sound.
Post not yet marked as solved
3 Replies
Update: This seems to be a problem with my project itself. It was originally an Apple TV app which I turned into a multiplatform app later on. I don't think everything got converted properly; my Info tab in Project Settings only has options for Apple TV. Nothing really to do here except start a new multiplatform project and import all the files from the previous one! Thanks.
Post not yet marked as solved
3 Replies
Hi, Thanks for this! By multiplatform app I mean an app that targets all Apple platforms as described here: https://developer.apple.com/documentation/xcode/configuring-a-multiplatform-app-target So I use this feature to target iOS, iPadOS, tvOS, and macOS. I don't do any Android development. Even so I think what you wrote may be close to the answer anyway. I'll try it. Though note when you start a new Xcode project as a multiplatform app, it doesn't create an Info.plist file for the project. So I guess I'll have to add one to the project and try this. Thanks!