Yes, I am completely aware of YouTube's Helper iFrame API which uses a web view to play YouTube videos.
But tons of popular apps such as WhatsApp, Telegram and Musi play YouTube videos in either custom video players or iOS native video players and there's tons of comments repeating the same thing here in StackOverFlow that it is against Youtube's TOS when none of these popular apps have been taken down by Youtube or been rejected by Apple's App Store.
So how do I play Youtube videos in an AVPlayer?
Have tried passing YouTube urls directly into AVPlayer which obviously won't work since it is not the video file itself.