9/18/2019 Jwplayer Javascript Api
This article provides a reference to all available JW Player JavaScript API calls. For an introduction to JW8's API, see our Introduction to the JavaScript API. For more in-depth instructions on implementation, see our JW Player Developer Guide. To see example code for each API call, visit our JW Player Demos and search by call.
Plays everywhere, every time.Live on over 2 million sites with 1.3 billion unique plays per month, JW Player is the solution for seamless video playback across browsers and media types. It empowers the developer to interact with video programmatically to create unique and awesome user experiences. DisclaimerThis is the non-commercial version of JW Player. It does not contain the same features as the commercial-use player available from. Commercial use and access to features requires a license. Learn more at.
If you are a paid customer and want a player, please download it from the 'Downloads' section of your JW Dashboard. Official Documentation.A Simple ExampleThe example below will render a video player into the div with the player id, listens to an event, and makes a few calls using the API. Grunt hooks Framework IntegrationWhile the JW team does not maintain any framework integrations of our own, there are developers in our community who do. We recommend the following libraries: FrameworkLinkReactIf you have a library which you believe is good enough to meet the needs of other developers using a certain framework, please open a pull request modifying the above table. Software LicenseThe use of this library is governed by a.
You can use, modify, copy, and distribute this edition as long as it’s for non-commercial use, you provide attribution, and share under a similar license.
Building JavaScript PluginsThis page explains the details of building JavaScript plugins for JW Player. See for a general overview and info on embedding plugins. Getting StartedBuilding JavaScript plugins for the JW Player requires a fairly minimal toolset.
Specifically, you'll need:. This JW6 plugin SDK, which contains example plugins and basic test pages. A text editor (pretty much anything except for Word will do) and a web browser (for testing your plugins).We also recommend that you set up a local web server for testing. Tools like and make this incredibly quick. Hello WorldHere is a very basic example plugin, which displays some text on top of JW Player.
And passes that to the plugin as a parameter of the initialization function. The plugin can nest whatever HTML it wants into that div.The -required- resize method of a plugin is automatically called by the player whenever it gets resized. This includes the initial setup (shortly before onReady). Use this call to ensure your visuals are correctly scaled and stretched over the player display. Note the above helloworld example uses the resize call to re-center itself over the player.Note the player controls are also displayed on top of JW Player, possibly interfering with the plugin visuals.
Plugins are z-indexed on top of the controls though, so they can obscure them if they want. If a plugin needs to be visible together with the controls, it should use the API call to find out which top and bottom margins are used by the player controls. Hybrid pluginsThe registerPlugin method has an interesting feature: it can be used to load an ActionScript (SWF) plugin in addition to the regular plugin JavaScript. With this feature, you can write hybrid plugins. These plugins can leverage the features and performance of Flash, but work in HTML5 mode too. Log( 'This text will appear in your browser console ');When you're happy with the functionalities of a plugin, it's time to wrap it up for release.
There's a few things you should do to optimize the loading of the plugin. MinificationWe highly recommend minifying your JS using a tool like the or the.
This will reduce the size of your plugin, without impacting performance. Base64 EncodingIf you're using images in your plugin, you can base64 encode and then embed them into the javascript. This will:. Speed up loading, because only one resource has to get loaded. Remove all issues around filepaths to the images, making the plugin easier to deploy.Many tools exist, both online and offline, to base64 encode an image.
Where you can simply upload your image and copy/paste the resulting Base64 hash.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |