Add a player library

Learn how to add a player library to a page.

JW Player provides you several ways to add the video player library to a page. The following table lists and describes each of these implementations.

TIP

If you are not a developer, do not have developer resources, or prefer a simpler implementation, read How to embed a JW Player.

Implementation Description
Cloud-hosted
(Recommended)
Best option for most developers who want an implementation that provides the most flexibility:

   • Access to the latest player features and functionality
   • Test pre-release player versions
   • Manage player configurations by JSON or in a dashboard UI
   • Create custom user experiences with JSON or through API calls

Player license keys are automatically rotated.
Cloud-hosted with API calls Same feature set as Client-side configuration above, but the best option for most developers who want to manage implementations solely via API calls
Self-hosted Best option for developers who need to control the version of a player:

   • Maintain a consistent player version
   • Manage player configurations through JSON
   • Create custom user experiences with JSON or through API calls

Player license keys are NOT automatically rotated.


Cloud-hosted

  1. From your Player Downloads & Keys page, scroll down to the Cloud Hosted Player Libraries section.
  2. In the Cloud Hosted Player Libraries section, select a Player Title from the dropdown menu.
  3. Copy the Cloud Player Library Url.
  4. Within the <head> of your page, copy and paste the URL to the player library.
<script src="{CLOUD-HOSTED_PLAYER_LIBRARY_URL}"></script>



Cloud-hosted by JW Player with API calls

  1. Make a call to api.jwplatform.com to list the existing players in your account (GET /players/list) or create a new player (POST /v1/players/create) . If this is your first time creating (POST) an item with the Management API, read our documentation on authentication and call syntax.
GET api.jwplatform.com/v1/players/list
POST api.jwplatform.com/v1/players/create HTTP/1.1
HOST: my-server
Content-Type:application/json
Accept:application/json

{
    "name": "{PLAYER_NAME}",
    "api_format": "{API_FORMAT}",
    "api_key": "{API_KEY}",
    "api_timestamp": "{API_TIMESTAMP}",
    "api_nonce": "{API_NONCE}",
    "api_signature": "{API_SIGNATURE}"
}
POST api.jwplatform.com/v1/players/create HTTP/1.1
HOST: my-server
Content-Type:application/json
Accept:application/json

{
    "name": "{PLAYER_NAME}",
    "advertising_outstream": true,
    "advertising_endstate": "suspended",
    "api_format": "{API_FORMAT}",
    "api_key": "{API_KEY}",
    "api_timestamp": "{API_TIMESTAMP}",
    "api_nonce": "{API_NONCE}",
    "api_signature": "{API_SIGNATURE}"
}
  1. Locate the key in the response, for example: {key: "aBCdE12G"}.
  2. Construct the cloud-hosted player library URL with the key: https://cdn.jwplayer.com/libraries/{key}.js.
  3. Within the <head> of your page, copy and paste the URL to the player library.


<script src="{CLOUD-HOSTED_PLAYER_LIBRARY_URL}"></script>

TIP

You can also use one of our client libraries to simplify authorization and authentication.



Self-hosted

The use of a self-hosted JW Player library requires an Enterprise license. Please contact our team if you would like to upgrade your account.

  1. From your Player Downloads & Keys page, scroll down to the Downloads section.
  2. In the Downloads section in the JW Player X (Self-Hosted) row, select Production - X.XX.X from the VERSION drop-down 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.
  6. Within the <head> of your page, copy and paste the URL to the player library and your license key.
<script src="https://www.yourdomain.com/{player_folder}/jwplayer.js"></script>
<script>jwplayer.key="{player_key}"</script>


Updated 20 days ago


Next step

After adding the player library to a page, you can either embed the player with content or embed an outstream (ads-only) player.

Embed a player
Embed an outstream player

Add a player library


Learn how to add a player library to a page.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.