Giter Site home page Giter Site logo

Controls are not reactive about vue-plyr HOT 1 CLOSED

redxtech avatar redxtech commented on July 19, 2024
Controls are not reactive

from vue-plyr.

Comments (1)

redxtech avatar redxtech commented on July 19, 2024

When you say reactive I'm assuming (based on the code snipped you shared) that you are using JS to change the elements as the view changes. When doing this, vue uses it's diffing to decide what's new and what's not, and from what I can tell the best way to tell vue that something has changed it by using a key to tell it that something new has happened. Unfortunately, when you do use key it reloads the entire element. This is not something that I can change myself (as far as I know) but I do have a suggestion for you:

  1. Keep doing what you are doing with CSS - that's usually the best way to add reactivity to a page as it's the best way to go about styles.

  2. If you are set on using JS for your buttons I would recommend adding a line or two of code to your fullview toggle (or wherever you're changing the value. This could end up being a watched property or something that runs whenever it changes) that takes the current timestamp and saves it in the state, and then once you have the element reloaded grabbing that timestamp back from the state and setting the player to that timestamp. Might not be as smooth as pure CSS but it should work better than restarting.

Note: It's worth checking to see if the buttons are reactive with vanilla plyr and if it isn't, open an issue there as that might be the root of the problem.

If there's something that I've missed please feel free to reopen this issue and let me know what it is.

from vue-plyr.

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.