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

Updating Source File, ex. with a Playlist #17

Open
kershner opened this issue Jul 10, 2020 · 3 comments
Open

Updating Source File, ex. with a Playlist #17

kershner opened this issue Jul 10, 2020 · 3 comments

Comments

@kershner
Copy link

Hi there, thanks for the great plugin. How can we update the VTT file source/re-init the plugin when the player's content changes, for example when a new video is loaded from the playlist?
If I try and call
player.vttThumbnails({ src: 'https://new-vtt-file.vtt'});
I get:
player.vttThumbnails is not a function

Any tips would be great appreciated. Let me know if you need more information.

@Ashwin0994
Copy link

Any Solution for this please???

@zout
Copy link

zout commented Aug 18, 2021

What i've figured out is that you can't reinitialise. My solution was this:

    if (typeof player.vttThumbnails.src === 'function') {
      player.vttThumbnails.src(constructAssetUrl(thumbnails));
    } else {
      player.vttThumbnails({ src: constructAssetUrl(thumbnails) });
    }

It detects if there is a src function and if not the plugin is not initialised yet. Not very happy with the solution though.

PS: The constructAssetUrl function is something from our own codebase by the way.

@mayeaux
Copy link

mayeaux commented May 10, 2022

@zout This works to dynamically change the src ? Looks like a decent solution to me

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

4 participants