Socket
Socket
Sign inDemoInstall

you-tube

Package Overview
Dependencies
341
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    you-tube

YouTube Web Component built with Stencil


Version published
Maintainers
1
Created

Readme

Source

Built With Stencil

you-tube web component

you-tube is a web component built on top of the YouTube Iframe API

API

Properties

  • width (string)
  • height (string)
  • video_id (string)
  • autoplay (string) : "1" to auto play & "0" to not
  • controls (string) : "1" to show & "0" to hide

Event handler Properties

  • onPlayerReady (Function)
  • onPlayerStateChange (Function)
  • onPlaybackQualityChange (Function)
  • onPlaybackRateChange: (Function)
  • onApiChange (Function)
  • onError: (Function)

Using this component

Usage example

html
 <you-tube  
    height='390' 
    width='640'
    video_id='sZQ1DESaDfg'
    controls="0"
    autoplay="1"></you-tube>
jsx
 <you-tube  
    height='390' 
    width='640'
    video_id='sZQ1DESaDfg'
    onPlayerReady={evt => evt.target.playVideo()}></you-tube>

The player

Script tag

  • Put a script tag similar to this <script src='https://unpkg.com/you-tube@0.0.4/dist/youtube.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install you-tube --save
  • Put a script tag similar to this <script src='node_modules/you-tube/dist/youtube.js></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

FAQs

Last updated on 05 Oct 2017

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