How to play youtube video without UIWebView or detect video player when youtube video start playing using webview?

爷,独闯天下 提交于 2019-12-04 06:01:15

MPMoviePlayerViewController cannot directly play youtube video urls.You need to extract the url before loading MPMoviePlayerViewController with the url.

you can see a working demo in my github repo:

Try this:: https://github.com/DpzAtMicRO/IOSYoutubePlayer

LBYoutubeExtractor extracts the youtube Url with JSON.
Please do read the README.md before you use this in your application.

Regards

MPMoviePlayerViewController is a good one but last commit is years ago. I found another solution called 'XCDYouTubeKit' which supports iPhone/iPad and iOS7 onwards with full screen YouTube video.

You can access github page at here and fully documented tutorial at here

This is what official developer says in his page:

The only official way of playing a YouTube video inside an app is with a web view and the iframe player API. Unfortunately, this is very slow and quite ugly, so I wrote this player to give users a better viewing experience.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!