videojs-markers
videojs-markers copied to clipboard
How can I use this with videojs-playlist?
Hey,
I want to use this with videojs-playlist, but I can't find a way to update the new markers properly when switching track. It seems like videojs-markers
gets confused to which timeline it's supposed to put the markers on.
When I'm running this:
player.on('beforeplaylistitem', function() {
this.markers.removeAll();
});
player.on('playlistitem', function() {
this.markers({//...});
});
I get this error:
this.markers is not a function
I've also tried:
player.on('beforeplaylistitem', function() {
this.markers.removeAll();
});
player.on('playlistitem', function() {
this.markers.add([//...]);
});
And that doesn't give me an error, but the markers are off as soon as I switched track in the playlist. Is there a way to run a this.markers.update()
or similar? Thanks!
I know this is an old post, but I was able to update the markers by completely resetting the plugin.
player.on('playlistitem', function() {
if (typeof this.markers !== 'function') {
this.markers.destroy();
}
this.markers({//...});
});