Radiant Media Player

Playlist support




Documentation sections


Features

Radiant Media Player playlist layout allows for a collection of video items to be displayed with an easy-to-use UI. Playlist items are displayed on a scroll-able side panel and in-player arrows also permit navigation between playlist items.

Video ads can be played each time a new playlist item is loaded within the player. The playlist UI is fully compatible with mobile devices. A built-in error-recovery mechanism is also provided to skip playlist items that may be unavailable.

The playlist layout is compatible with most player features including HLS & DASH streaming, Google Analytics and a dedicated playlist API exists to programmatically control the playlist layout. With Radiant Media Player 4.5.10+ the playlist layout is fully compatible with Google Cast and AirPlay allowing for a top-nocth second-screen viewing experience of multiple media items.


Playlist data set with a JSON file

The playlist player can be initialised by passing through the playlistLoc setting a URI to a JSON file holding playlist data. Here is a full example of well-formatted JSON file that can be used with Radiant Media Player playlist layout.

The general structure is as below. The required fields for each item are:

  • bitrates - streaming URI for the playlist item
  • poster - poster frame for the playlist item - size should be 832x468
  • contentTitle - title for the playlist item
  • contentDescription - description for the playlist item

All items within the playlist must have the same bitrates type information (e.g. if you use HLS - each playlist item must have a HLS URI in its bitrates information; if you use MP4 progressive download - each playlist item must have a MP4 URI in its bitrates information)

Optional fields for each playlist item are:

  • adTagUrl - the URI to the adTag to be loaded when the playlist item starts - if you use ads you must also set the player setting ads to true
  • adTagWaterfall - an array of URI to be used for client-side waterfalling - see here for more information
  • thumbnail (highly recommended) - thumbnail frame for the playlist item (size should be 80x45) - if thumbnail information is not found poster data will be used
{
  "playlist": [
    {
      "bitrates": {
        "hls": "your-hls-url.m3u8"
      },
      "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
      "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg",
      "adTagUrl": "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
      "contentTitle": "Playlist Item 1",
      "contentDescription": "Description for playlist item 1"
    },
    {
      "bitrates": {
        "hls": "your-hls-url.m3u8"
      },
      "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-2.jpg",
      "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-2-thumbnail.jpg",
      "adTagUrl": "https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml",
      "contentTitle": "Playlist Item 2",
      "contentDescription": "Description for playlist item 2"
    },
    {
      "bitrates": {
        "hls": "your-hls-url.m3u8"
      },
      "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-3.jpg",
      "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-3-thumbnail.jpg",
      "adTagUrl": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=",
      "contentTitle": "Playlist Item 3",
      "contentDescription": "Description for playlist item 3"
    }
  ]
}

If you are using MP4 progressive download instead of HLS each item in the playlist would look like the following. Remember that all items in the playlist must have the same streaming protocol.

{
  "bitrates": {
    "mp4": [
      "https://your-mp4-url.mp4"
    ]
  },
  "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
  "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg",
  "adTagUrl": "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
  "contentTitle": "Playlist Item 1",
  "contentDescription": "Description for playlist item 1"
}

You can also use a combination of streaming protocols, like DASH + MP4 fallback. In this case all items in the playlist must have the same combination of streaming protocols.

{
  "bitrates": {
    "dash": "your-dash-url.mpd",
    "mp4": [
      "https://your-mp4-url.mp4"
    ]
  },
  "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
  "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg",
  "adTagUrl": "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
  "contentTitle": "Playlist Item 1",
  "contentDescription": "Description for playlist item 1"
}

Client-side ad waterfalling with playlist items:

{
  "bitrates": {
    "hls": "your-hls-url.m3u8"
  },
  "poster": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
  "thumbnail": "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg",
  "adTagUrl": "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
  "adTagWaterfall": [
    "https://www.radiantmediaplayer.com/vast/tags/inline-linear-1.xml?cb=__random-number__",
    "https://www.radiantmediaplayer.com/vast/tags/inline-linear-2.xml?url=__page-url__"
  ],
  "contentTitle": "Playlist Item 1",
  "contentDescription": "Description for playlist item 1"
}

Playlist data set with a JavaScript array of objects

Alternatively to passing playlist data as a JSON file you can pass those data through the playlistData setting as an array of objects. Each item of the array is an object representing a playlist item. The structure of this object follows the same pattern as the one described in the JSON file section above. Example:

var playlistData = [{
  bitrates: {
    hls: "https://your-hls-url-1.m3u8"
  },
  poster: "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
  thumbnail: "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg",
  adTagUrl: "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
  contentTitle: "Playlist Item 1",
  contentDescription: "Description for playlist item 1"
}, {
  bitrates: {
    hls: "https://your-hls-url-2.m3u8"
  },
  poster: "https://www.radiantmediaplayer.com/media/playlist/poster/item-2.jpg",
  thumbnail: "https://www.radiantmediaplayer.com/media/playlist/poster/item-2-thumbnail.jpg",
  adTagUrl: "https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml",
  contentTitle: "Playlist Item 2",
  contentDescription: "Description for playlist item 2"
}];
...
var settings = {
  licenseKey: 'your-license-key',
  // if you want ads to show uncomment this next setting
  // ads: true,
  // our playlist settings
  playlistUpNextAutoplay: true,
  playlistEndedLoop: false,
  playlistData: playlistData
};

Player settings

playlistLoc: String

This set the location to the JSON file that hold information about the playlist. It can either be a fully qualified URL or a local/absolute path. Note that the playlist JSON file is loaded with XMLHttpRequest and thus it must be delivered with proper CORS setting for cross-site requests. Default: ''.

playlistData: Array

This setting sets the initial playlist data based on an JavaScript array of objects. Default: []. If both playlistLoc and playlistData are set playlistData will prevail. See above for an example. Default: [].

playlistUpNextAutoplay: Boolean

By default when a playlist item ends the next playlist item is automatically played. Default: true. Setting this setting to false will cause the player to not autoplay the next item.

playlistEndedLoop: Boolean

By default when the last item of the playlist ends the player stops and remains on the last item. When playlistEndedLoop is set to true and the last item of the playlist ends the player will automatically start loading and displaying the first item in the playlist (e.g. playlist loop). Default: false. When playlistEndedLoop is set to true playlistUpNextAutoplay must also be set to true to have effect.


Player code example

The below code is used to display the playlist example at top of this page:

Take note of the additional div elements required to display the playlist UI.

<script src="https://cdn.radiantmediatechs.com/rmp/4.10.5/js/rmp.min.js" 
  integrity="sha384-C/ULeCJDlenAbw9Hm+dhOlswTP+pmQHD+i4ihKhNzkzPz02MB5xJMUD1uUpT8kcY"
  crossorigin="anonymous"></script>
<!-- Here is our specific markup for playlist -->
<div class="rmp-playlist-container">
  <div class="rmp-playlist-player-wrapper">
    <div id="rmpPlayer"></div>
  </div>
</div>
<script>
var settings = {
  licenseKey: 'your-license-key',
  // if you want ads to show uncomment this next setting
  // ads: true,
  // our playlist settings
  playlistUpNextAutoplay: true,
  playlistEndedLoop: false,
  playlistLoc: 'https://www.radiantmediaplayer.com/media/playlist/playlist.json'
};
var elementID = 'rmpPlayer';
var rmp = new RadiantMP(elementID);
rmp.init(settings);
</script>

Playlist API

getCurrentPlaylistItemIndex()
rmp.getCurrentPlaylistItemIndex();

This getter returns a Number representing the index of the current playlist item being displayed. Index starts at 0.

setPlaylistItem(index)
rmp.setPlaylistItem(1);

This method sets the current playlist item being displayed. index input parameter should be a number representing the desired playlist item to be displayed.

isPlaylist()
rmp.isPlaylist();

This method returns a boolean stating if the player is used with a playlist layout.

getPlaylistData()
rmp.getPlaylistData();

This method returns an ordered Array of Object where each Object represents a playlist item. Example of Object playlist item:

{
  adTagUrl: "https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml",
  bitrates: { 
    hls : "your-hls-url.m3u8"
  },
  contentDescription: "Description for playlist item 1",
  contentTitle: "Playlist Item 1",
  poster: "https://www.radiantmediaplayer.com/media/playlist/poster/item-1.jpg",
  thumbnail: "https://www.radiantmediaplayer.com/media/playlist/poster/item-1-thumbnail.jpg"
}
setPlaylistData(playlistLoc|playlistData)
rmp.setPlaylistData('https://www.radiantmediaplayer.com/media/playlist/playlist.json');
rmp.setPlaylistData(playlistData);

This method allows to dynamically update the playlist player with a new set of data. You can either pass a URI to new JSON file (see playlistLoc setting) or a new array of object (see playlistData setting).


Additional support notes


Sizing considerations

The playlist UI uses media queries to adjust itself based on viewport dimensions. It is meant to be a central element within a web page. Review the playlist.less Less CSS file from within the self-hosted package for further sizing information and customisation.


Live content

You can use live content with the playlist layout (use isLive: true setting) but all items from the playlist must be live content.


Logging & billing considerations

Each time a new item starts in the playlist layout, a player start is counted (PLATFORM Edition).


Analytics consideration

Each time a new item starts in the playlist layout, a playerstart event is sent to Google Analytics, but it will use as label the contentTitle of the new item. This allows to identify when a specific playlist item is started. Other events, like adimpression or enterfullscreen, will also be sent to Google Analytics when a new media item starts in the playlist layout, but with the updated label as well.


Unsupported features with the playlist layout:

  • Ad scheduler
  • Audio-only
  • Closed captions through the ccFiles setting (embedded captions in HLS or DASH streams are supported)
  • 360 video content
  • DVR content will be treated as simple live content
  • DRM content
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.