How to play youtube Videos With MPMoviePlayerViewC

2019-08-09 16:17发布

问题:

Is there any other way to play youtube videos other than UIWebView.i want to play youtube videos in MPMOviePlayer.i have done research on it but i found no result.i got this url

Play YouTube videos with MPMoviePlayerController instead of UIWebView

please help me in doing this.thanks in advance

回答1:

I found a solution from github : https://github.com/hellozimi/HCYoutubeParser

It's great, but sometime it can't play few links, seem like it can't get real URL video,

NSDictionary *qualities = [HCYoutubeParser h264videosWithYoutubeURL:url];
_urlToLoad = [NSURL URLWithString:[qualities objectForKey:@"medium"]];

just return nil for qualities. Anybody have idea to solve it.



回答2:

Hi guys solution for this

https://github.com/larcus94/LBYouTubeView



回答3:

For me this solution es better and pretty simple but elegant and it did work perfectly

https://github.com/hellozimi/HCYoutubeParser