MPMoviePlayerController error _itemFailedToPlayToEnd while playing youtube video iOS 7

前端 未结 3 942
囚心锁ツ
囚心锁ツ 2021-01-02 01:55

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

相关标签:
3条回答
  • 2021-01-02 02:01

    Ok!!! the problem is that the player doesn't know what you are trying to play,

    1. you can try to change the name to x.mp4
    2. you can debug the project and see that the path and the file you are trying to play exists.
    0 讨论(0)
  • 2021-01-02 02:11

    If im not mistaken ALMovieplayercontroller is an extension of MPMoviePlayerController. So try setting the source type of the player to stream.

    moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
    
    0 讨论(0)
  • 2021-01-02 02:22

    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.

    0 讨论(0)
提交回复
热议问题