Adding languages so that they're available to all players.
Adding languages so that they're available to all players.
The language code or dictionary property
The data values to be translated
VideoJS.addLanguage("es", js.Dynamic.literal(Hello = "Hola"))
Doubles as the main function for users to create a player instance and also the main library object.
Doubles as the main function for users to create a player instance and also the main library object. The videojs function can be used to initialize or retrieve a player.
Video element or video element ID
Optional options object for config/settings
Optional ready callback
Get a component class object by name
Get an object with the currently created players, keyed by player ID
Returns whether the url passed is a cross domain request or not.
Returns whether the url passed is a cross domain request or not.
The url to check
Create a Video.js player plugin.
Create a Video.js player plugin. Plugins are only initialized when options for the plugin are included in the player options, or the plugin function on the player instance is called. See the plugin guide in the docs for a more detailed example
The plugin name
The plugin function that will be called with options
Register a component so it can referred to by name.
Register a component so it can referred to by name. Used when adding to other components, either through addChild component.addChild('myComponent') or through default children options { children: ['myComponent'] }.
Class name of the component
Component class
The newly registered component
// Get a component to subclass var VjsButton = videojs.getComponent('Button'); // Subclass the component (see 'extend' doc for more info) var MySpecialButton = videojs.extend(VjsButton, {}); // Register the new component VjsButton.registerComponent('MySpecialButton', MySpecialButton); // (optionally) add the new component as a default player child myPlayer.addChild('MySpecialButton');
Register a Tech so it can referred to by name.
Register a Tech so it can referred to by name. This is used in the tech order for the player.
Class name of the tech
Tech class
The newly registered Tech
// get the Html5 Tech var Html5 = videojs.getTech('Html5'); var MyTech = videojs.extend(Html5, {}); // Register the new Tech VjsButton.registerTech('Tech', MyTech); var player = videojs('myplayer', { techOrder: ['myTech', 'html5'] });
(Since version ) see corresponding Javadoc for more information.