1

I just have a simple videplayer I want to update the current video but I don´t know how

struct VideoPlayerView: UIViewRepresentable {

     @Binding var videoURL: URL?

    func makeUIView(context: Context) ->  UIView {

        return playerUIView(frame: .zero, URL:  videoURL!)

    }

    func updateUIView(_ uiView: UIView, context: Context)  {
        print(videoURL) 
    }


}

when the binding value change the videoURL print on the updateUIView its working but isn't changing the video, im new on swift and dint know how to update the current playing video.

Misael Landeros
  • 545
  • 5
  • 18
  • 1
    Just search on SO.. Eg. [here](https://stackoverflow.com/questions/57024870/swiftui-how-to-properly-code-avplayer-after-loading-a-video-from-the-device-wit) you find good approach. – Asperi Apr 12 '20 at 03:44

0 Answers0