Playing youtube video with MPMoviePlayerController

后端 未结 3 475
挽巷
挽巷 2021-01-03 12:39

i\'ve been using an html string for a long period for playing youtube videos through an UIWebView, the problem is i want to get notifications with playbackstate changed. i\'

3条回答
  •  旧时难觅i
    2021-01-03 13:07

    Make use of custom LBYouTubePlayerViewController

    It is a subclass of MPMoviePlayerViewController.

    LBYouTubeView is just a small view that is able to display YouTube videos in a MPMoviePlayerController. You even have the choice between high-quality and standard quality stream.

    It just loads the HTML code of YouTube's mobile website and looks for the data in the script tag.

    LBYouTubeView doesn't use UIWebView which makes it faster and look cleaner.

提交回复
热议问题