@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
257 lines (252 loc) • 5.52 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "Base class for video-player",
"name": "VideoPlayer",
"slots": [
{
"description": "Default slot",
"name": ""
}
],
"members": [
{
"kind": "field",
"name": "poster",
"type": {
"text": "string | undefined"
},
"description": "Reference to an image which is displayed before the video is played",
"privacy": "public"
},
{
"kind": "field",
"name": "src",
"type": {
"text": "string | undefined"
},
"description": "URL of a video file",
"privacy": "public"
},
{
"kind": "field",
"name": "autoplay",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Allows the video will play automatically (muted)",
"privacy": "public"
},
{
"kind": "field",
"name": "loop",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Allows the video to loop back to the beginning when finished",
"privacy": "public"
},
{
"kind": "field",
"name": "playbackRates",
"type": {
"text": "string"
},
"default": "'0.5, 1, 1.5, 2'",
"description": "Sets the available playback rates. When an empty string, no choices will be available",
"privacy": "public"
},
{
"kind": "field",
"name": "skipBy",
"type": {
"text": "VideoPlayerMediaSkipBy"
},
"description": "Allows the video to loop back to the beginning when finished",
"privacy": "public"
},
{
"kind": "field",
"name": "#noSourceErrorElement",
"privacy": "private",
"readonly": true
},
{
"kind": "method",
"name": "#disposePlayer"
},
{
"kind": "method",
"name": "#setupVideoElement"
},
{
"kind": "field",
"name": "#controlElement",
"privacy": "private",
"readonly": true
},
{
"kind": "method",
"name": "#hideNoSourceError",
"parameters": [
{
"name": "show",
"default": "true"
}
]
},
{
"kind": "method",
"name": "#setupVideoPlayer",
"parameters": [
{
"name": "settings",
"type": {
"text": "any"
}
}
]
},
{
"kind": "method",
"name": "#setupPlayerEvents"
},
{
"kind": "field",
"name": "VIVID_VERSION",
"static": true,
"default": "__PACKAGE_VERSION__",
"description": "The current version of the Vivid library, which is useful for debugging.\nIt can be accessed from any Vivid element via `<el>.constructor.VIVID_VERSION`.",
"type": {
"text": "string"
},
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
},
{
"kind": "field",
"name": "componentName",
"type": {
"text": "string"
},
"static": true,
"description": "Core component name, without prefix",
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
}
],
"events": [
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Fired when the video is played",
"name": "play"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Fired when the video is paused",
"name": "pause"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Fired when the video is ended",
"name": "ended"
}
],
"attributes": [
{
"name": "poster",
"type": {
"text": "string | undefined"
},
"description": "Reference to an image which is displayed before the video is played",
"fieldName": "poster"
},
{
"name": "src",
"type": {
"text": "string | undefined"
},
"description": "URL of a video file",
"fieldName": "src"
},
{
"name": "autoplay",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Allows the video will play automatically (muted)",
"fieldName": "autoplay"
},
{
"name": "loop",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Allows the video to loop back to the beginning when finished",
"fieldName": "loop"
},
{
"name": "playback-rates",
"type": {
"text": "string"
},
"default": "DEFAULT_PLAYBACK_RATES",
"description": "Sets the available playback rates. When an empty string, no choices will be available",
"resolveInitializer": {
"module": "src/lib/video-player/video-player.ts"
},
"fieldName": "playbackRates"
},
{
"name": "skip-by",
"type": {
"text": "VideoPlayerMediaSkipBy"
},
"description": "Allows the video to loop back to the beginning when finished",
"fieldName": "skipBy"
}
],
"mixins": [
{
"name": "Localized",
"module": "/src/shared/patterns"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "video-player"
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerVideoPlayer } from '@vonage/vivid'
registerVideoPlayer('vvd3')
const VwcVideoPlayer = wrapper(`vvd3-video-player`, {
events: [{"name":"ended","propName":"onEnded"},{"name":"pause","propName":"onPause"},{"name":"play","propName":"onPlay"}],
attributes: [],
properties: ['poster', 'src', 'autoplay', 'loop', 'playbackRates', 'skipBy', 'VIVID_VERSION', 'componentName']
})
VwcVideoPlayer.displayName = 'VwcVideoPlayer'
export default VwcVideoPlayer