npm.io
0.2.0 • Published 3 months ago

twitch-video-element

Licence
MIT
Version
0.2.0
Deps
0
Size
45 kB
Vulns
0
Weekly
0
Stars
263

<twitch-video>

NPM Version NPM Downloads jsDelivr hits (npm) npm bundle size

A custom element for the Twitch player with an API that matches the <video> API.

Example

<script type="module" src="https://cdn.jsdelivr.net/npm/twitch-video-element@0.1/+esm"></script>
<twitch-video controls src="https://www.twitch.tv/videos/106400740"></twitch-video>

Install

First install the NPM package:

npm install twitch-video-element

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

import 'twitch-video-element';

Optionally, you can load the script directly from a CDN using JSDelivr:

<script type="module" src="https://cdn.jsdelivr.net/npm/twitch-video-element@0.1/+esm"></script>

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

Keywords