Supports for Google Cast API.
Name | cast |
Path | vlitejs/plugins/cast |
Entry point | vlitejs/plugins/cast/cast.js |
Stylesheet | vlitejs/plugins/cast/cast.css |
Provider² | 'html5' |
Media type³ | 'video' |
<video id="player" src="<path_to_video_mp4>"></video>
import 'vlitejs/vlite.css';
import 'vlitejs/plugins/cast.css';
import Vlitejs from 'vlitejs';
import VlitejsCast from 'vlitejs/plugins/cast.js';
Vlitejs.registerPlugin('cast', VlitejsCast);
new Vlitejs('#player', {
plugins: ['cast']
});
The plugin exposes the following native Event
on the .v-vlite
element.
Event Type | Description |
---|---|
castsessionstarted |
Sent when the cast session is established. |
castsessionended |
Sent when the cast session is disconnected. |
The plugin allows customization with an optional object as the third parameter of the registerPlugin
function.
Describes style information for a text subtitle.
Vlitejs.registerPlugin('cast', VlitejsCast, {
textTrackStyle: {
backgroundColor: '#21212190'
}
});
See the TextTrackStyle reference for available fields.
Describes media metadata description.
Vlitejs.registerPlugin('cast', VlitejsCast, {
metadata: {
title: 'The Jungle Book',
subtitle: 'Walt Disney Animation Studios'
}
});
The
images
field automatically displays the poster available in the Vlitejs options.
See the Metadata reference for available fields.