How to close Youtube ads on video automatically? - html

This is about the ads that appears on the bottom of the YouTube video screen when a video starts playing for the first time. We can manually close the video by clicking the Close button on the upper right corner of the ad. Is there anyway to write a script or small piece of program for the browser to automatically close if any ad appears, when its browsing YouTube.
(I thought it would be interesting if we could do that)
Thanks.

Having used YouTube API quite a bit over the years, I've tried to achieve what you are asking without any success.
Unfortunately, there is no way to close overlay ads automatically. This Google forum post confirms it: https://groups.google.com/forum/?fromgroups#!topic/youtube-api-gdata/qG733WIH6yE
It can't be clicked away [advert] because those mouse events are handled internally and cant be managed in the parent application. The parent application obviously has mouse events over the video screen to manage pause / play functionality.

Related

Why video is started from last end position?

I have a problem with youtube-api when i load a video. I am using loadVideoById function. I have tried also cueVideoById but the result is the same.
OK, here is what it is about.
when i play some video at YouTube page and will finish it in for example middle. YouTube will remember that position and next time i enter this video it will play from that position. Also im logged in in the Chrome browser. So when i load this video at my page using youtube api by function mentioned before it also starts this video from previously remembered position.
I tried to use stopVideo or seekTo(0) after loading it but it doesnt work. Also when i change the time of video and press stop and play next it will start again from remember position. Does anyone know the solution for this ?
JS fiddle:
https://jsfiddle.net/or2w8fpd/6/
Just open video by youtube side stop in the middle, check if youtube saved your position for future (if you return to video where does progress start) then open jsfiddle and try it. remember to be logged in to chrome browser

Youtube API Overlay Play Button size off when using setSize

When looking at my video player app yesterday morning, I noticed some odd behavior on the AS3 Chromeless player.
When using the setSize function as documented in the API, the giant play button that overlays the video is now suddenly becoming very large, not even close to the dimensions specified. However, once the play button is clicked, the video player itself is fine. This is throwing off all of the positioning in my app, and looks terrible.
I assume something changed on the Chromeless Player, but I need to get this to work sooner rather than later. Is anyone else experiencing this issue / does anyone have a work around?
Thanks for the help!
Each time you set the size, force a redraw. Its gonna do that when you click it, and apparently, in your case, doesn't.
This is a known problem with the Google Data API for Youtube. People seem to be clamoring for a fix, although Google has not been very responsive.

How can I prevent HTML5 audio or video from playing when removed from the page?

Please feel free to suggest a better title for this post, as I wasn't sure how to properly describe the problem in one short question.
I've got a media player page with an HTML5 player and the option for the visitor to choose to play the video or audio for that page. While one is playing, a button to switch to the other is available. For example, if the visitor is playing audio, a "Switch to Video" button is available, which essentially removes the current content and replaces it. This effectively removes the current HTML5 player from the DOM tree as well, of course. In addition to replacing the content, a 'pause' event is triggered on any audio or video element on the page prior to loading the new content.
Unfortunately, if you switch between audio and video quickly enough, you'll end up with multiple items playing simultaneously.
I need to make sure this doesn't happen.
How can I ensure that when I replace the player, the previously loading file does not play?
To see this happening, go to http://www.onlinechurchmediacenter.com/mc/vertigoelectric/5628, choose either audio or video, and once it starts playing keep clicking the "Play Audio" or "Play Video" link which appears below the player. If you continuously click this quickly enough, you'll begin to notice multiple instances of the audio/video playing over each other.
I'd advise not to remove the elements from the DOM. Just hide them and trigger the pause. For good measure, trigger another pause before you play the next item.

How can I remove youtube logo from the youtube player for use in other application?

I want to use the Charmless youtube player in my application and I want to remove youtube logo from the Player. How can i achieve this thing? My application is developed using AS3.
Simply add ?modestbranding=1 to the end of your URL.
See more here.
modestbranding (supported players: AS3, HTML5)
This parameter lets you use a YouTube player that does not show a YouTube logo.
Set the parameter value to 1 to prevent the YouTube logo from displaying in the control bar.
Note that a small YouTube text label will still display in the upper-right corner of a paused
video when the user's mouse pointer hovers over the player.
try this API player code.
http://www.youtube.com/apiplayer?version=3&modestbranding=1&showinfo=1
Chromeless player, the modestbranding has no effect unless "showinfo=1" is must for API player.
I tried to remove youtube logo by many ways. But I didn't get success to remove it from the youtube player.
Finally I check the youtube player functionality and behavior. When video is attached to the player then it will be displayed in center. if player container height is bigger then video height so both (top and bottom) side Black strip will be appeared. Just we have to hide the Black Strip from the user display area using masking concept. (In Flash we can apply the mask to container and same thing will be done using the DOM model in Javascript.)
In directly it will be removed as per end user perspective not actually. so Indirect way youtube logo is removed from the player.
you can try GKPlugin this plugin using JWPlayer 5.x at:
https://drive.google.com/folderview?id=0B0OhZLpuvlSRTDZLMXowQWNMZTA#list

iOS HTML5 video player next/prev buttons

Is there a way to access/listen to the previous/next buttons in the iOS HTML5 video player? Ideally I would listen to some sort of a prev and next event and swap out the videos accordingly without the user having to close the video and click my prev/next buttons.
(source: iphonefaq.org)
I am currently using jwplayer to generate the html5 video and listening to their playlist next/prev listeners don't seem to do the trick. I can always find and attach listeners to the actual <video> tag pretty easily though.
If you attach listeners to the video tag itself then when the user hits next and previous then the listeners in the code will put up on those buttons. I am doing something similar with youTube videos. If you hit next it goes to the end of the youtube video and fires a video complete event tag and then I load the next video when that is called, so that the video will one loop without the next button and two the users can hit the buttons. I have not found a way to monitor the buttons in the player on the iphone side, but if I find it I will post that as well since it is important to know both angels if possible.
Funny thing I think I am looking to try and do the same exact thing. I know how to transition the videos to the next without having to leave the fullscreen mode because of using youTube api in the js but I am not able to observe the quicktime player itself and need to for another feature that I would like to work on.
That's the native iOS player which is a thin version of Quicktime. You'll know if it's an HTML5 player when it doesn't transition from the Quicktime player and your page in Safari. How is your movie being embedded?
I recently had a similar problem and was unable to find a solution using the HTML player. I ended up implementing the video player using MPVideoPlayer Framework and launching it from my web view with a custom URL scheme (AppName:Commnad:Asset). I was then able to use the delegate methods to monitor user interactions. If you would like to see basic implementation, let me know and I can add some code.