@luwes/youtube-video-element

0.4.0 • Public • Published

<youtube-video>

A custom element (web component) for YouTube.

The element API matches the HTML5 <video> tag, so it can be easily swapped with other media, and be compatible with other UI components that work with the video tag.

One of the goals was to have <youtube-video> seamlessly integrate with Media Chrome.

Example (CodeSandbox)

<script type="module" src="https://unpkg.com/@luwes/youtube-video-element@0"></script>
<youtube-video controls src="https://www.youtube.com/watch?v=H3KSKS3TTbc"></youtube-video>

Installing

<youtube-video> is packaged as a javascript module (es6) only, which is supported by all evergreen browsers and Node v12+.

Loading into your HTML using <script>

<script type="module" src="https://unpkg.com/@luwes/youtube-video-element@0"></script>

Adding to your app via npm

npm install @luwes/youtube-video-element --save

Include in your app javascript (e.g. src/App.js)

import '@luwes/youtube-video-element';

This will register the custom elements with the browser so they can be used as HTML.

Related

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i @luwes/youtube-video-element

    Weekly Downloads

    1

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    48.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • luwes