Giter Site home page Giter Site logo

Can It Work For Nuxt.js? about vue-plyr HOT 6 CLOSED

mbengchan avatar mbengchan commented on June 20, 2024
Can It Work For Nuxt.js?

from vue-plyr.

Comments (6)

mbengchan avatar mbengchan commented on June 20, 2024 3

@Nidzan import vue-plyr as plugin and add it to your nuxt-config.js like these

  1. Under your plugins folder name the file anything and do your import there and call vue.use() there too.

  2. Go to your nuxt-config.js file add the plugin to your plugins array like so
    { src: '~/plugins/vue-plyr', ssr: false },

disabling the server-side-rendering option

OPTIONAL
You can also add the plugin to you build bundle like so
build: { extractCSS: true, vendor: [ 'vue-plyr' ], }

Now You are good to go, you can use Vue-Plyr player anywhere in your components.

from vue-plyr.

Devilkas avatar Devilkas commented on June 20, 2024 1
  1. In your plugins folder create file vue-plyr.js
    Insert to this file code
    import Vue from 'vue' import VuePlyr from 'vue-plyr' Vue.use(VuePlyr)

  2. Next step go to your nuxt-config.js file and add
    css: [ 'vue-plyr/dist/vue-plyr.css' ], plugins: [ '~/plugins/vue-plyr' ],

from vue-plyr.

thegeminisociety avatar thegeminisociety commented on June 20, 2024

Yes, I am currently using vue-plyr running Nuxt.js

from vue-plyr.

 avatar commented on June 20, 2024

Hello.
Does anyone have working example on the plugin running in Nuxt.js?
I'm trying couple of different configurations, but nothing seems to work:

Any help or suggestion would be much appreciated.

from vue-plyr.

 avatar commented on June 20, 2024

@shadomax thank you very much, this did the trick.
However, I have another issue now regarding transitions. Looks like that transition hook on leave and destroy triggers plyr destroy as well - http://prntscr.com/jdmpix

On load, plyr looks like this - http://prntscr.com/jdmlq0
but during transition to another page I get this - http://prntscr.com/jdmm4t
and whole buch of erros in console - http://prntscr.com/jdmmx9

Any suggestion how to work around these issues?

from vue-plyr.

redxtech avatar redxtech commented on June 20, 2024

This can work just fine with nuxt. Thanks @shadomax for the tips on how to use is (I haven't used nuxt before) and I will add it to the readme in the next version.

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.