Hi @Mirco46 ,
The AVPlayer documentation says:
A player is a controller object that manages the playback and timing of a media asset. Use an instance of AVPlayer to play local and remote file-based media, such as QuickTime movies and MP3 audio files, as well as audiovisual media served using HTTP Live Streaming.
You can load remote media, but YouTube videos won't work due to their format. As far as I know, YouTube videos are embedded in a page, they're not movie files that AVPlayer ca
n handle. I believe it's against the YouTube terms of service to scrape that video file from the public URL and play it in a AVPlayer
. You'd need to use a WebView ( WKWebView)to handle that instead to use the public URL and show the web page with the embedded video.
If you have some other remote media (like something in the HTTP Live Streaming realm) you can definitely use AVPlayer
to show that.