Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use this with videojs-playlist? #102

Open
seabasss opened this issue Oct 15, 2019 · 1 comment
Open

How can I use this with videojs-playlist? #102

seabasss opened this issue Oct 15, 2019 · 1 comment

Comments

@seabasss
Copy link

seabasss commented Oct 15, 2019

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!

@uvanchang
Copy link

uvanchang commented Feb 17, 2022

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({//...});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants