# Playlist

Note

This feature is available only to ByteArk Video Cloud for Business customers. Please contact sales@byteark.com if you would like to use it.

ByteArk Player supports continuous playback of multiple videos in a playlist. Configure via the playlist option.

# Playlist display

Playlist

# Options

Name Type Required Description
playlist Object No Playlist configuration
playlist.items Array Yes List of items to play
playlist.items[].title String No Title of the item
playlist.items[].image String No Thumbnail URL
playlist.items[].sources Array Yes Sources for the item
playlist.autoPlay Boolean No Automatically play the next item (default true)

# Example

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <div id="video-player"></div>
    <script src="https://byteark-sdk.cdn.byteark.com/player/v2/byteark-player.min.js"></script>
    <script>
      var player = bytearkPlayer('video-player', {
        fluid: true,
        playlist: {
          autoPlay: true,
          items: [
            {
              title: 'Episode 1',
              image: '/assets/samples/player/images/ep1.jpg',
              sources: [{
                src: '<EP1_URL>',
                type: 'application/x-mpegURL',
              }],
            },
            {
              title: 'Episode 2',
              image: '/assets/samples/player/images/ep2.jpg',
              sources: [{
                src: '<EP2_URL>',
                type: 'application/x-mpegURL',
              }],
            },
          ],
        },
      });
    </script>
  </body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# Player API

Method Description
player.playlist.next() Play the next item
player.playlist.previous() Play the previous item
player.playlist.currentItem(index) Get / set the current item by index

# Events

Event Description
playlistitem Fired when the active item in the playlist changes