Skip to content

Instantly share code, notes, and snippets.

(function () {
videojs.plugin('playlist', function (options) {
var id = this.el().id;
var tracks = document.querySelectorAll("#" + id + "-vjs-playlist .vjs-track"),
trackCount = tracks.length,
player = this,
currentTrack = tracks[0],
index = 0,
play = true,
onTrackSelected = options.onTrackSelected;