Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS how to directly play youtube videos without embedding it in a UIWebView

I want to add a youtube video play functionality to my iPhone app. But I dont want to embed it in a UIWebView,

Basically I want to remove an extra view before video is played. I want a user to see the video as soon as he taps on (say) a UITableViewCell.

Is this possible??

I have seen this post: Embedding YouTube videos on But that is not the solution I want.

Also if I launch Youtube application directly, users wont be redirected to the app. after video is completed.

Thanks in advance.

like image 837
Nilesh Ukey Avatar asked Nov 25 '22 12:11

Nilesh Ukey


1 Answers

You could use XCDYouTubeVideoPlayerViewController. It is a 3rd party YouTube library. https://github.com/0xced/XCDYouTubeVideoPlayerViewController

From their Readme:

Keep in mind that XCDYouTubeVideoPlayerViewController uses progressive download, so remember that some restrictions apply if you submit your app to the App Store, as stated in HTTP Live Streaming — Requirements for Apps:

Warning: iOS apps submitted for distribution in the App Store must conform to these requirements.

If your app delivers video over cellular networks, and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period, you are required to use HTTP Live Streaming. (Progressive download may be used for smaller clips.)

like image 157
thijsai Avatar answered Nov 28 '22 02:11

thijsai