Add an HTML5 player to a site
Last Updated: June 26, 2019
To add a player to your site, you must add a reference to the player library, embed the player, and configure the player with content.
Get a player library
You can get a player library in several ways. The following table explains the cloud-hosted and self-hosted approaches that you can use. Review the approaches and follow the process for the approach that suits your implementation needs.
|Cloud-hosted by JW Player without API calls||1. From your dashboard, click Players > Downloads & Keys.
2. In the Cloud Hosted Player Libraries section, select a Player Title from the dropdown menu.
3. Copy the Cloud Player Library Url.
|Cloud-hosted by JW Player with API calls||1. Make a call to
2. Locate the
3. Construct the cloud-hosted player library URL with the
|Self-hosted||Use of a self-hosted JW Player library requires a JW Player Enterprise license. Please contact our team if you would like to upgrade your account.
1. From your dashboard, click Players > Downloads & Keys.
2. In the Downloads section, select a VERSION of the self-hosted JW Player library from the dropdown menu.
3. Click the icon in the DOWNLOAD column.
4. Copy the LICENSE KEY for the JW Player library.
5. Rename and upload the unzipped library folder to your server. When renaming the folder, remove the periods from the folder name.
Add library reference and embed player to a page
Now that you have the URL for your player library, you can add a library reference to a page and embed a player.
- In the
- Create a named
<body>of your page in the location where the player should appear.
setup()with the playlist property to instantiate the player in the named
In addition to instantiating an instance of a player,
setup()allows you to enable and configure player features.
setup()is one of several methods that can be used to interact with the player.
Use the Code examples section to validate your implementation.
The following code examples illustrate the code structure of a cloud-hosted or self-hosted player that has been implemented correctly.
Example 1: Cloud-hosted player with playlist defined by a URL referring to a JSON file containing a list of videos
Example 2: Self-hosted player with playlist defined by an array of videos