Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
youtube-video-element
Advanced tools
<youtube-video>
A custom element (web component) for the YouTube player.
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.
<html>
<head>
<script type="module" src="https://unpkg.com/youtube-video-element"></script>
</head>
<body>
<youtube-video controls src="https://www.youtube.com/watch?v=rubNgGj3pYo"></youtube-video>
</body>
</html>
<youtube-video>
is packaged as a javascript module (es6) only, which is supported by all evergreen browsers and Node v12+.
<script>
Note the type="module"
, that's important.
Modules are always loaded asynchronously by the browser, so it's ok to load them in the head :thumbsup:, and best for registering web components quickly.
<head>
<script type="module" src="https://unpkg.com/youtube-video-element"></script>
</head>
npm
npm install youtube-video-element --save
Or yarn
yarn add youtube-video-element
Include in your app javascript (e.g. src/App.js)
import 'youtube-video-element';
This will register the custom elements with the browser so they can be used as HTML.
FAQs
Custom element (web component) for the YouTube player.
The npm package youtube-video-element receives a total of 2,053 weekly downloads. As such, youtube-video-element popularity was classified as popular.
We found that youtube-video-element demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.