Content

Understand about the PlaylistItem class and its usage with content in an Android app.


Now that you have added a player to your app, this section of the Android SDK documentation focuses on how to add content to and customize content in the player.

The PlaylistItem class enables you to add content to your player and define elements of that content. When PlaylistItem has been added to your app, here are some of the actions that you can take:

  • Define content metadata like the description and title
  • Create playlists with your content
  • Add captions
  • Configure DRM-protected playback

As an example, when adding a player to an activity, you added PlaylistItem to MainActivity.java to define the video content to be shown in your player.

mPlayerView = findViewById(R.id.jwplayer);
    PlaylistItem playlistItem = new PlaylistItem.Builder()      
        .file("https://cdn.jwplayer.com/manifests/{media_id}.m3u8")
        .build();

    List<PlaylistItem> playlist = new ArrayList<>();
    playlist.add(playlistItem);
    PlayerConfig config = new PlayerConfig.Builder()
        .playlist(playlist)
        .build();
    mPlayerView.setup(config);

In the following articles in this Content section, we explore the content features and functionality that can be implemented by using the PlaylistItem class.


👍

IMPORTANT

We strongly recommend using the https:// protocol with your video URLs.


If the http:// protocol is used, the following items will fail to load:
• Ad tags with hardcoded https:// paths
• Side-loaded caption files with hardcoded http:// paths
• Poster images with https:// paths

Developers should follow Android's best practices for network security configuration.



Did this page help you?