I\'ve seen this mentioned a few places around the web but have yet to find answer anywhere.
I am using ALMovieplayercontroller library. Everything works fine but whe
Ok!!! the problem is that the player doesn't know what you are trying to play,
If im not mistaken ALMovieplayercontroller
is an extension of MPMoviePlayerController
.
So try setting the source type of the player to stream.
moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
Yes after so much researching i found to the following soluction.
MPMoviePlayerController directly will not play the youtube videos. you have to extract the video URL and set video URL to MPMoviePlayerController. after this video will be played.
There are lots of API available that gives the extracted video URL.
Some of them are below
XCDYouTubeKit
HCYoutubeParser
But using this API your application might be rejected. you should have to use on your risk.
Best way to play youtube videos is the WebView.