Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bdbch/customelement-youtube
Custom Element for YouTube Embeds
https://github.com/bdbch/customelement-youtube
custom-elements customelement customelements embed youtube
Last synced: about 2 months ago
JSON representation
Custom Element for YouTube Embeds
- Host: GitHub
- URL: https://github.com/bdbch/customelement-youtube
- Owner: bdbch
- Created: 2018-04-22T13:45:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T23:51:57.000Z (9 months ago)
- Last Synced: 2024-10-12T20:03:23.155Z (3 months ago)
- Topics: custom-elements, customelement, customelements, embed, youtube
- Language: JavaScript
- Homepage: https://bdbch.github.io/customelement-youtube/
- Size: 159 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ``
> Easy to embed Youtube Embeds
### [Live Demo (try to change attributes in dev tools)](https://bdbch.github.io/customelement-youtube/)
`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:
```js
import "customelement-youtube"
```#### Via `` in ES6
```js
<script src="build/youtube.js">
```#### Via `` in ES5
```js
<script src="build/youtube.es5.js">
```When customelement-youtube is loaded correctly, you can just use it like this:
```html
```
## 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.