Play YouTube video in Flexslider slide and pause slideshow - youtube-api

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

Related

Clickable preview image that auto-loads a Youtube video

We're working on implementing a clickable preview image that will play a Youtube video.
The goal is to avoid loading unnecessary JS code and improve Google Pagespeed score.
We have implemented a solution that works.
But the problem is that it takes two clicks to actually load the Youtube video: one click to display the Youtube video, another to actually start the video.
I know for a fact that it's possible to load start such videos in one click, because solutions such as this one exist (but it requires Wordpress)
How do we approach this? Is there a ready-made solution for implementing lazy loading for videos? (that doesn't require Wordpress?)
I used this small tutorial: https://www.labnol.org/internet/light-youtube-embeds/27941/
You show a thumbnail image of a YouTube video and 'When a visitor clicks the play button, the thumbnail image is replaced with the standard YouTube video player with autoplay set to 1 so it plays the video instantly.'
You need javascript, css and html (no Wordpress). Hope it helps you.

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.

Playing Vimeo Videos with Custom Video Player in iOS

I have to play Vimeo videos in my iOS application using a video player. I need to log events like play, pause, seek etc. Its not possible to play using MPMoviePlayerController or AVPlayer as Vimeo videos have flash content. I am able to play using UIWebView. But, it is showing default Vimeo player controls. I need to have my own controls to play, pause etc as I need to log those events.
I have tried for lot of solutions. Nothing worked. If anyone knows how to play Vimeo videos using custom player. Please Let me know.
I am able to find out solution for this problem. I have used YTVimeoExtractor present here.
Its README.md file says following :
YTVimeoExtractor helps you get mp4 urls which can be use in iOS's native player. You can even choose between mobile, standard and high definition quality.
YTVimeoExtractor doesn't use UIWebView which makes it fast and clean.
I have used MKMoivePlayerViewController and its notifications - MPMoviePlayerPlaybackStateDidChangeNotification and ˚ notifications to get stop, pause events.
The only official way to use a player besides the Vimeo player to play Vimeo videos is to use third-party player urls provided to PRO members: https://vimeo.com/s/adg

Youtube API - how to get video with custom controls for 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!

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 ...

Resources