Youtube API - how to get video with custom controls for iOS - ios

I'm working on an application that eventually will be uploaded to the App-Store so every solution you suggest has to be legit with licenses against Youtube and Apple.
I'm trying to create a custom video player for Youtube, which will have my own play/pause/stop and next/previous buttons. I've searched quite a lot for legit ways to make this and have not found the correct way yet.
The way I'm using it at the moment is with the Youtube embed player and the parameters:
controls = 0,
playsinline = 1,
autohide = 1,
showinfo = 0,
modestbranding = 1
With all that, I still have a play button on top of the video.
I've seen the iPhone application called "iTube" and they have their custom controls over youtube without the play button on top of the video. In addition, the looks and feels of the video over there doesn't suits me like the Youtube embed API. It just feels different.
Does anyone know how did they make that?

Well after some more research I've found that they probably used MPMoviePlayerViewController with custom controls.
It uses progressive download so I think they're using it with low quality over cellular networks to not violate Apple's terms.
If anyone thinks differently I would appreciate any response.
Thanks all!

Related

Play Youtube Url In Webview without userControl in iOS

I want to play youtube url in UIWebview or MPMoviewviewcontroller.but the restriction is user should not control the playing video.could any one help ?
If you want finer control over youtube videos, theres a library (not written by me) called XCDYoutubeKit. Search for that and look at incorporating it into your app - theres a class in there that is based on MPMoviePlayerController, that allows the playing of youtube videos from their youtube id (I use it, its good). This also means you get a normal player, so you can pause, scrub through, etc.

YTPlayerView Play video in full screen ipad

I am using "YTPlayerView" to play video in iOS. When I am using this in iPhone it automatically play video in full screen but when I am using same thing in the iPad it does not switch to full screen. I also tried the below parameters but no success.
NSDictionary *playerVars = #{ #"playsinline" : #0 };
[self.playerView loadWithVideoId:videoIDURL playerVars:playerVars];
We have developed a very video intensive app for both iPhone and iPad in the past, and actually had the opposite problem - we wanted to use the YTPlayerView for displaying videos inline (non-fullscreen) on both devices, but weren't able to get it done on the iPhone. We ended up using XCDYouTubeVideoPlayerViewController, which seemed to have resolved most of our issues. This is not really the recommended way to approach this, since it pretty much breaks YouTube's terms of use (it parses the html page, finds the .mp4 url, and plays it in MPMoviePlayer, which gives all all of the flexibility you need for full screen, loading times and other notifications.
Throughout the process of trying to find a way to work with YTPlayerView, I contacted engineers form Google who work on the YouTube helper framework, and they recommended to work directly with the iframe player API, which lets you customize the controls and receive events about the video. This means you'll have to use your own web view instead of the YouTube helper. The communication between the JavaScript and the Objective-C parts can be tricky (and that's what the helper library actually tries to save from the developer), but it will give you more flexibility.
This can also help with working with UIWebView to display YouTube videos: Playing YouTube Videos in a WebView Inline.
I know it's not exactly what you asked, but I hope it can help lead you in the right direction. I've had a lot of issues working with YouTube videos on iOS, so I know how frustrating it can be. Good Luck!

mediaelement.js > Youtube API: Does the mejs play button affect the views on YT?

I searched for quiet some time… Seems like that embedded youtube videos really need the "human click" to increase the views on the YT profile. Tried some things with the API given from YT… no luck so far.
Does the mediaelement.js do the magic?
here is the answer from the YT js doc:
Note: A playback only counts toward a video's official view count if it is initiated via a native play button in the player.
You can't use your own play button or enable autoplay if you want the stats... Tried it, the best way is to use the "native" youtube player with minimal UI and let the users click the "native" play button ...

Is there anyway to play a video inline in iOS?

I've tried tens of different ways to play a video from YouTube or a server and not have it go into fullscreen. I know it's possible because the YouTube app allows for this to happen but can't seem to figure out how to do it. Please advise!
Check out this answer:
Can I play a youtube video in a UIWebView inline (not fullscreen)?
This solution is iOS 6 & 7 compatible, it involves setting UIWebView's allowsInlinePlayback and setting YouTube's iFrame webkit-playsinline value.

Play YouTube video in Flexslider slide and pause slideshow

I am using flexslider on a site and will be putting youtube videos in certain slides. However, I need the slider to stop animating while the video is playing, and resume when the video finishes. I understand that the developer has provided a solution to this exact problem using the vimeo API. Are there examples out there of an implementation using the youtube APIs? Is it possible? I am (obviously) not a javascript expert, and find that I learn best through examples/tutorials.
There's an example at https://developers.google.com/youtube/iframe_api_reference#Getting_Started for embedding an iframe YouTube player on a page, and responding to specific events. I think you should be able to adapt that to meet your needs.
Here is my option for Youtube and Vimeo, hope is help :)
https://github.com/woothemes/FlexSlider/issues/346#issuecomment-13826530

Resources