Socket
Socket
Sign inDemoInstall

vue3-youtube

Package Overview
Dependencies
24
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-youtube

Wrapper for YouTube IFrame Player API


Version published
Maintainers
1
Weekly downloads
2,109
decreased by-20.56%

Weekly downloads

Readme

Source

vue3-youtube

Wrapper for YouTube IFrame Player API

Installation

npm install vue3-youtube
# or
yarn add vue3-youtube

Usage

Browser:

<script src="dist/vue3-youtube.umd.min.js"></script>

Global registration:

import Vue from 'vue'
import YouTube from 'vue3-youtube'

Vue.component('YouTube', YouTube)

or locally:

<template>
    <YouTube 
        src="https://www.youtube.com/watch?v=jNQXAC9IVRw" 
        @ready="onReady"
        ref="youtube" />
</template>

<script>
import { defineComponent } from 'vue'
import YouTube from 'vue3-youtube'

export default defineComponent({
    components: { YouTube },
    methods: {
        onReady() {
            this.$refs.youtube.playVideo()
        },
    },
})
</script>

Props

NameTypeDefaultDescription
srcStringYoutube video link or ID. Required.
widthNumber, String640Player width.
heightNumber, String360Player height.
hostStringPoints host to correct origin for CORS.
varsObjectPlayer parameters.

Events

  • ready
  • state-change
  • playback-quality-change
  • playback-rate-change
  • error
  • api-change

Methods

https://developers.google.com/youtube/iframe_api_reference#Functions

Keywords

FAQs

Last updated on 30 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc