Javascript on embedded videos - javascript

Is it possible to use javascript to seek position of videos embedded on a page (Videos from Youtube, DailyMotion, Revver, etc)?

If you mean you want to read the position of progressbar of the video player it could be done, but the player (usually flash object) has to expose appropriate methods or events to javascript. The exact way of intercating with player depends on the specyfic flash object you use.

YouTube has a javascript API which can be used to control the video playback, including seeking the position

Related

How does youtube volume controls work internally?

I'm curious how Youtube allows you to control the speaker volume through embedded controls in their website? Can Javascript control the speaker output? Thanks in advance.
Ok, so yes, for <video> and <audio> elements JavaScript can control the volume of "playback".
That does not mean JavaScript in the browser is controlling your speakers, directly, it is more like your browser can send audio to your systems speakers... And your browser let's JavaScript signal certain intents, which are forwarded by your browser to the system and then to the speakers.
But if your speakers are set to a low volume, or are off, your JavaScript could not change that.
You can learn about the details on MDN here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video and here https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Introduction
You can assign the volume property of the audio or video element to set the output volume.

Is there any VPAID client?

Scenario: Need to play VPAID ads with "In Content" mode, on mobile
Most of the solution I found is either some other players plugin (like videojs) or doesn't support mobile (like google ima)
Or, something like this:
https://github.com/dailymotion/vast-client-js
Not sure what you mean with in-content, but I assume that you're looking for a video player that supports VPAID. After all, VPAID does just that, it allows you to create interactive content (e.g. an HTML canvas) that shows within your video ad or even interacts with the video player itself (e.g. pauses the publisher video).
IMA is a perfect plugin for a video player like Video.js and it does support mobile -JavaScript VPAID creatives- (what makes you think that it doesn't?) Hopefully I'll be able to help you further if I know what you're looking for.

Brightcove SmartPlayer API Controlling Volume

I am using Brightcove custom player, it has only videoDisplay ( not video control ). In JavaScript i am creating all media control like ( play/ pause, Seek bar, volume , fullscreen).
I am able to play, pause, seek video via smartplayer API. But i didn't find a method to mute / unMute or adjusting volume.
From Brightcove support website i found a article to control volume via JS
http://support.brightcove.com/en/video-cloud/solutions/controlling-volume-player-api
setVolume method throws undefined error
But i don't find a method video.setVolume() in VideoPlayer API
http://docs.brightcove.com/en/video-cloud/smart-player-api/reference/symbols/brightcove.api.modules.VideoPlayerModule.html
Help me controlling volume via JavaScript
Thanks
I'm trying to figure this out to - I need a video to auto-play (its going to be used in an ad unit) and have it be muted by default.
From the link you provided, see the following note:
Note: Volume control has not been included in the Smart Player API.
iOS devices do not allow for control of the volume outside the
built-in system controls (i.e. cannot be done via Javascript).
Controlling the volume programmatically in any HTML player is
currently not possible.
I'm thinking the solution might be to use the Flash Player API where it is supported with auto play and mute, and then fall back to the Smart Player API without auto-play everywhere else.
I'm also looking into video.js as an alternative - but if the note from the BC knowledge base is correct, thats not going to work.

screengrab from a youtube video in javascript

I have a user requirement in which I want to take a screengrab of what is playing on a youtube video at the moment. I have read about rendering to canvas, but it seems to take dom elements, and not the current flash video position. Is this possible? I can't use browser extensions, it has to be a button on the site that does this.
Thanks in advance.
Edit: How about if I use the HTML5 renderer?
Its not possible to do this. Getting a youtube video as a dom video element is possible using the HTML5 embed option. The problem is youtube videos reside in an iframe, and due to cross-domain security restrictions, you will not be able to access the video dom element, which is necessary to draw it to a canvas.

Is there any way to control EMBED Code Videos?

Is there any way to control YouTube EMBED CODE. For example I am using YouTube embed code in my site. Is there any way to control the video like forward, backward, stop etc. with my own buttons.
Is this possible?
Any help will be appreciated.. Thanks in Advance.
Fero
YouTube has a JavaScript and Flash API that you can use to build your own player or control the player programmatically.
The documentation is here: http://code.google.com/apis/youtube/overview.html
There are several examples in the documentation for controlling your own "chromeless" player. This is probably what you want to use if you want your own buttons.
All of the major browser-embedded video player types have ways to do this, but the method is different for all of them.
YouTube uses a Flash player, which poses a special problem: Flash video players have no ability to handle external JavaScript calls other than what is specifically added by the programmer that built the player. That is, if YouTube didn't build their player with support for external scriptability, you can't script it. This isn't a flag -- on/off -- it's that Flash makes you explicitly publish an external scripting API, and you have to know what the calls look like to make the player do what you want. This is unlike, say, QuickTime, Windows Media Player, or the new HTML 5 <video> tag, all of which have documented basic playback control like you're asking about.
It's probably possible to build your own FLV player (or buy one, like the popular JW Player, which does have a JavaScript API) and point it at the actual video file served by YouTube. I don't know if they try to obscure the video file URL, but once you find out what it is, you're golden.

Categories

Resources