Post

Replies

Boosts

Views

Activity

Reply to Simple VideoPlayer not working
Hello, @JamieCarroll answered the question right. I just dealt with something similar. The main problem in here is that the player property is not marked as @State var. Let me explain in little more words. Without marking the property @State, SwiftUI knows very little of what is going on with it. It means that when you set the players URL, currentItem or whatever property to the player, SwiftUI doesn't acknowledge it and does nothing (Not triggering view update). I am pretty sure when setting up the playable URL, in the background AVPlayer does lot of stuff that mutates the object.
Apr ’22