Playlist
pluginThree items with next, previous and auto-advance, driven by the plugin API.
Up next
The code
tsximport { playlist } from '@tomato-player/plugin-playlist';import { hls } from '@tomato-player/provider-hls';const player = createPlayer('#player', {skin: stream({ onNext: () => player.plugin('playlist').next() }),providers: [hls()],plugins: [playlist({items: [{ src: 'bunny.webm', title: 'Big Buck Bunny' },{ src: 'tears-of-steel.m3u8', title: 'Tears of Steel' },{ src: 'bunny.m3u8', title: 'Big Buck Bunny (HLS)' },],loop: true,}),],});player.on('plugin:playlistchange', ({ index }) => console.log('now playing', index));