I am trying to play an RTSP stream (rtsp://xxx.xxx.x.x:xxx/livestream/1) using AVPlayerViewController in my iOS app. The stream is from a local WiFi-connected camera, and I get the URL from the device's API. However, the video does not play in AVPlayerViewController.
I can successfully play the stream using the MobileVLCKit framework, but I would like to make it work with AVPlayer.
- Is there any way to support RTSP streaming in AVPlayerViewController?
- How can I implement this in Swift 5 and Swift 6?
- Do I need to stick with MobileVLCKit, or is there any workaround?
Any suggestions or workarounds would be appreciated.