Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thelevicole/youtube-to-html5-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thelevicole/youtube-to-html5-loader

A javascript library to load YoutTube videos as HTML5 emebed elements.

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
121
decreased by-71.93%
Maintainers
1
Weekly downloads
 
Created
Source

Load YoutTube videos as HTML5 emebed element

Latest Stable Version Total Downloads

Basic usage example

Replacing YOUTUBE_URL_OR_ID_GOES_HERE with your video URL or ID.

<video data-yt2html5="YOUTUBE_URL_OR_ID_GOES_HERE"></video>  
  
<script src="YouTubeToHtml5.js"></script>  
<script>new YouTubeToHtml5();</script>  

Options example

<video class="youtube-video" data-yt="https://youtube.com/watch?v=ScMzIvxBSi4"></video>  
  
<script src="YouTubeToHtml5.js"></script>  
<script>new YouTubeToHtml5( {  
  selector: '.youtube-video',  
  attribute: 'data-yt'  
} );</script>  

Internal API example

<video data-yt2html5="YOUTUBE_URL_OR_ID_GOES_HERE"></video>  
  
<script src="YouTubeToHtml5.js"></script>  
<script>  
 var player = new YouTubeToHtml5( {  
  autoload: false  
 } );  
  
  player.addAction( 'api.before', function( element ) {  
  element.classList.add( 'is-loading' );  
 } );  
    
  player.addAction( 'api.end', function( element ) {  
  element.classList.remove( 'is-loading' );  
 } );  
  
  player.load();  
</script>  

Accepted URL patterns

Below is a list of varying YouTube url patterns, which include http/s and www/non-www.

youtube.com/watch?v=ScMzIvxBSi4
youtube.com/watch?vi=ScMzIvxBSi4
youtube.com/v/ScMzIvxBSi4
youtube.com/vi/ScMzIvxBSi4
youtube.com/?v=ScMzIvxBSi4
youtube.com/?vi=ScMzIvxBSi4
youtu.be/ScMzIvxBSi4
youtube.com/embed/ScMzIvxBSi4
youtube.com/v/ScMzIvxBSi4
youtube.com/watch?v=ScMzIvxBSi4&wtv=wtv
youtube.com/watch?dev=inprogress&v=ScMzIvxBSi4&feature=related
m.youtube.com/watch?v=ScMzIvxBSi4
youtube-nocookie.com/embed/ScMzIvxBSi4

Keywords

FAQs

Package last updated on 05 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc