Skip to content

bdbch/customelement-youtube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<youtube-player>

Easy to embed Youtube Embeds

youtube-player creates a simple youtube embed player without any iframe attributes. Easy to embed from any URL.

Installation

npm install --save customelement-youtube

Usage

ES6:

import "customelement-youtube"

Via <script> in ES6

<script src="build/youtube.js"></script>

Via <script> in ES5

<script src="build/youtube.es5.js"></script>

When customelement-youtube is loaded correctly, you can just use it like this:

<youtube-player url="https://www.youtube.com/watch?v=jJWPmYSbN5c" >

Available Attributes

  • url - YouTube Embed Url
  • start-at="60" - Start a youtube video at 60 seconds
  • recommendations - Shows recommendations on pause or videoend
  • hide-info - Hide video information
  • hide-controls - Hide player controls
  • extended-privacy - Activate nocookies mode
  • autoplay - Autoplay the video
  • allow-fullscreen - Allow the player to go fullscreen

Browser Support

This will need an update to find out what browsers are currently supporting all features

Contribution

Feel free to send in Pull Requests. I'll take my time to look into them.