GithubHelp home page GithubHelp logo

Comments (3)

phloxic avatar phloxic commented on May 27, 2024

So spriteUrl works? - Have you tried to pass something like interval: spriteInterval? I.e., an integer variable instead of a value of this spriteInfo object. Or the other way round, i.e., spriteInfo.spriteUrl.

Of course I can only guess, but both interval and url are plugin options, so presumably the handling notation in your app should be structurally/hierarchically the same, no?

Did you try to set up other videojs plugins this way?

from videojs-sprite-thumbnails.

mbaljeetsingh avatar mbaljeetsingh commented on May 27, 2024

Hi @phloxic
I got it working with the following, when I get sprite info, only then I'm adding the config to plugins. When I pass the plugin options at first, it always takes that config, and doesn't take the updated interval value.

Not sure if it is the correct approach, but works for now

async function fetchSpriteInfo() { fetch(spriteInfoUrl) .then((res) => res.json()) .then((res) => { const { interval } = res; plugins.value = { ...plugins.value, spriteThumbnails: { interval, width: 160, height: 90, url: spriteUrl, }, }; }) .catch((err) => console.error(err)); }

from videojs-sprite-thumbnails.

phloxic avatar phloxic commented on May 27, 2024

From the plugin perspective the configuration is updated/merged as described here:

  1. when the plugin is loaded.
  2. when a video is loaded on loadstart as in the playlist example.

The second method – loading (parts of) the config as a src object - should work. It updates the configuration at runtime, once loadstart is triggered, one cannot change the config anymore while this video is playing. Whether the json parsing of your app allows the video to be loaded that way, I don't know (my guess it that you just use the source property of the video tag). It could be that you have better control of your app's timing with your current approach.

from videojs-sprite-thumbnails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.