<img src="https://img.shields.io/badge/%20-ENTERPRISE-%23B10031" style="float:left"/><br /> <img src="https://img.shields.io/badge/Android-V4-009727?logo=android" style="float:left"/>

<br />

The `JWPlayerView` is the central logic component of our SDK. This class allows you to easily load new media into the player, manage video and audio playback, and register multiple event listeners that could help you with custom analytics or error handling.



If you have unique implementation requirements, please contact your JWP representative.

<br /> <hr />

## Implementation

Use the following steps and code examples to add the `JWPlayerView` to the **app/res/layout/activity_main.xml** and **app/java/MainActivity.java** files of your app:

  1. In **app/res/layout/activity_main.xml**, add the `JWPlayerView`.


  1. In **app/java/MainActivity.java**, set your license key.



<br />

  1. Get a reference to the player.



<br />

  1. Use `PlaylistItem.Builder()` to create and define a `PlaylistItem` object.



For videos hosted with JWP, use the following steps to retrieve the URL of a video:

  1. Click the name of the video in your JWP dashboard Media Library.

  2. Under **Media Summary**, click the **View Assets**.

  3. On the **Video Renditions** tab in the row of a specific rendition, click **∨** to reveal the **DIRECT URL**.

  4. Copy the **DIRECT URL**.

  5. Click **Close**.

Hosting your videos with JWP enables you to query the Analytics API to access SDK video metrics.



<br />

  1. Create a `List<PlaylistItem>` object. Add the `PlaylistItem` object to the `List<PlaylistItem>` object.



<br />

  1. Use <code>PlayerConfig.Builder()</code> to create a `PlayerConfig` object. Assign the `List<PlaylistItem>` object to the playlist property of the `PlayerConfig` object.



<br />

  1. Set up `mPlayer` with the `PlayerConfig` object.



<br />

(Script tags will be stripped)