vue-youtube
vue-youtube copied to clipboard
Cannot read property 'getIdFromUrl' of undefined
I really commend the great effort put into this package.
I'm currently using version 1.3.4
I have a method as below
getId() { return this.$youtube.getIdFromUrl(this.videoUrl); }
The out output of console.log(this.$youtube);
is shown in the attached screenshot

Please how can i resolve this?
There are no any problems - https://codesandbox.io/s/vue-template-474dz Show your code, for example using codesandbox.
Thank you so much @TitanFighter .
I'm using this inside a nuxt app.
I created a plugin with the following code.
import Vue from 'vue'
import VueYoutube from 'vue-youtube'
Vue.use(VueYoutube)
Then i have a method inside my page that looks like below
getId() {
return this.$youtube.getIdFromUrl(this.videoUrl);
}
I do not use nuxt :(
Here is shown how to use vue-youtube with nuxt.