Supports for Youtube player with the Youtube player API.
The Youtube API is automatically loaded by the provider.
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).
<div id="player" class="vlite-js" data-youtube-id="<video_id>"></div>
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'
});
See the Youtube provider demo.
See the Youtube player API documentation.