Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I need to play youtube video in my iOS application and while video is playing I need to add an overlay on video.

1.Now how can i run youtube video in native player?

2.if I play video in UIWebview then how can i detect that video is playing and how to add overlay on the video?

like image 693
Mashhadi Avatar asked Dec 04 '12 11:12

Mashhadi


1 Answers

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

like image 78
DD_ Avatar answered Oct 02 '22 12:10

DD_