Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.35 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.35 KB

Provider: Youtube

Supports for Youtube player with the Youtube player API.

The Youtube API is automatically loaded by the provider.

Overview

Name youtube
Global name¹ window.VlitejsYoutube
Path vlitejs/dist/providers/youtube
Entry point vlitejs/dist/providers/youtube.js
  • ¹ The global name is only useful if vLitejs is included with a <script> tag (see CDN section).

Usage

HTML

<div id="player" class="vlite-js" data-youtube-id="<video_id>"></div>

JavaScript

import 'vlitejs/dist/vlite.css';
import Vlitejs from 'vlitejs';
import VlitejsYoutube from 'vlitejs/dist/providers/youtube';

Vlitejs.registerProvider('youtube', VlitejsYoutube);

new Vlitejs('#player', {
  provider: 'youtube'
});

Demo

See the Youtube provider demo.

SDK documentation

See the Youtube player API documentation.