vue-youtube-iframe
This plugin makes it easy to integrate the YouTube Iframe API into your Vue app. This plugin is Vue V3 compatible.
Usage
Installation
npm install vue-youtube-iframe --save
or
yarn add vue-youtube-iframe
Basic usage
main.js
import { createApp } from 'vue';
import App from './App.vue';
import VueYouTubeIframe from 'vue-youtube-iframe';
createApp(App).use(VueYouTubeIframe).mount('#app');
YourComponent.vue
<template>
<youtube-iframe :video-id="YT_VIDEO_ID"></youtube-iframe>
</template>
Advanced usage
YourComponent.vue
<template>
<youtube-iframe
:video-id="YT_VIDEO_ID"
:player-width="WIDTH"
:player-height="HEIGHT"
:player-parameters="YT_PLAYER_PARAMS"
@EVENT="CALLBACK"
></youtube-iframe>
</template>
Available player parameters
For the available player parameters see here
Available Events
@ready, @error, @ended, @playing, @paused, @buffering and @cued
For detailed event information check here
Contributing / Building
Contributions and pull request are welcome!
cd vue-youtube-iframe
yarn install / npm install
yarn run build / npm run build