Create a playlist (iOS)
Create and add playlists to your iOS app.
The JWPlayerItem class enables you to add content to your player and define the unique characteristics of that content:
- Title
- Description
- Poster Image
There are multiple ways to load and play content in your player. As best practice approaches, we recommend the following:
- Use
JWPlayerConfigurationBuilder()to create single-item or multiple-item playlists with media hosted in your JWP account. - Use
JWPlayerItemBuilder()to create single-item or multiple-item playlists with self-hosted media. - Use
JWPlayerConfigurationBuilder()to associate a playlist to a player and to initiate media playback. - All
JWPlayerItemmust have either a video source or a file set. If neither or both are set, theJWPlayerItemBuilderwill throw an exception.
While you can use other approaches to create, associate, and play playlists, JWPlayerItemBuilder() and JWPlayerConfigurationBuilder() enable you to add functionality, such as, customization and advertising.
The following sections explain how to create a playlist with one or more items and to add multiple sources to a playlist item.
Creating a playlist
Use the following steps to add items to a playlist to a player:
-
Use
JWPlayerItemBuilder()to create one or moreJWPlayerItemobjects. All items require that afilebe specified. This is the URL to the media file theJWPlayerItemwill play.To increase user engagement, we strongly recommend defining the
title,description, andposterImagefor theJWPlayerItem. -
Use
JWPlayerConfigurationBuilder()to add theJWPlayerItemobjects to an array and set the player configuration. -
Hand your configuration to the
JWPlayerobject.
Updated about 2 years ago
