N
Nuxt7mo ago
LighterChu

Adding npm packages to Nuxt3

I have been tryin to get this npm package to work in my project. How ever I am not sure how to import it properly. My background is React and I have only just started using Nuxt. I have added this
import VideoPlayer from 'nuxt-video-player'

require('nuxt-video-player/src/assets/css/main.css')

components: {
VideoPlayer
}
import VideoPlayer from 'nuxt-video-player'

require('nuxt-video-player/src/assets/css/main.css')

components: {
VideoPlayer
}
How ever its saying that its not pulling from the package.json. So I dont know if I need to add it to the plugins folder or what.
1 Reply
Sam  K
Sam K7mo ago
@LighterChu this module nuxt-video-player is for Nuxt 2. Take a look at vueUse library that has a lot of awesome perks. For working with video you have this composable https://vueuse.org/core/useMediaControls/
VueUse
Collection of essential Vue Composition Utilities
Want results from more Discord servers?
Add your server