Go Main page
Go Main page

Web components

cover

components

Video

v.1.0.0 | Saturn

Usage

import { Video } from '@kubit-ui-web/react-components'
12345678910
    <Video
        variant='REGULAR'
        videoSrc='/src/assets/storybook/videos/mov_bbb.mp4'
        videoType='video/mp4'
        buttonsBarPlayIcon={{ icon: 'ICON_CHEVRON_UP', altText: 'play icon alt text' }}
        buttonsBarPlayIconTooltip='play/stop'
        buttonsBarVolumeIcon={{ icon: 'ICON_CHEVRON_DOWN', altText: 'volume alt text' }}
        buttonsBarVolumeIconTooltip='Volume'
        buttonsBarSubtitlesIcon={{ icon: 'ICON_GHOST', altText: 'subtitles icon alt text' }}
        buttonsBarSubtitlesIconTooltip='Subtitles'

Props

Let's delve into the versatility of the video component by examining all its avalaible props.

PropertyTypeDefaultDescription
actionButtonVideoButtonType-Object with action button properties
autoFullScreenBooleanfalseBoolean to decide if the video should be fullscreen automatically after play
barAriaLabelString-Aria label for progress bar
buttonsBarFullScreenIcon
Required
IElementOrIcon-Select the icon to show the full screen button
buttonsBarFullScreenIconTooltip
Required
String-Text for the tooltip of fullscreen button
buttonsBarFullScreenIconToTransitionIElementOrIcon-Select the icon to show the full screen button to transition
buttonsBarPlayIcon
Required
IElementOrIcon-Select the icon to show the play button
buttonsBarPlayIconTooltip
Required
String-Text for the tooltip of play/stop button
buttonsBarPlayIconToTransitionIElementOrIcon-Select the icon to show icon to transition
buttonsBarSubtitlesIcon
Required
IElementOrIcon-Select the icon to show the subtitles button
buttonsBarSubtitlesIconTooltip
Required
String-Text for the tooltip of subtitles button
buttonsBarSubtitlesIconToTransitionIElementOrIcon-Select the icon to show the subtitles button to transition
buttonsBarVolumeIcon
Required
IElementOrIcon-Select the icon to show the volume button
buttonsBarVolumeIconTooltip
Required
String-Text for the tooltip of volume button
buttonsBarVolumeIconToTransitionIElementOrIcon-Select the icon to show icon to transition
dataTestIdOverlayString-Test id associated to overlay for testing
dataTestIdParentContainerString-Test id associated to parent container for testing
dataTestIdVideoSkeletonString-Test id associated to skeleton of the video for testing
dataTestIdVolumeInputString-Test id associated to volume input for testing
hasInitialOverlayBooleanfalseBoolean to show or not the overlay initially
hasSkeletonBoolean-Boolean to show or not the skeleton
linkAndActionButtonAlignmentLinkAndActionButtonAlignmentflex-endSet the alignment of the Link and Action button
linkTargetLinkTargetType_blankSet the link target
linkTextString-Text for link
linkUrlString-Url for link
posterUrlString-Url image for poster in video
screenLoadingIconIElementOrIcon-Select the icon to show screen loading icon
screenPlayIconIElementOrIcon-Select the icon to show screen play icon
skeletonTextString-Text for screenReader when skeleton is shown
timeToHideButtonsBarNumber4000Time in miliseconds to hide buttons bar
trackKindString-Specifies the kind of text track
trackLabelString-Specifies the title of the text track
trackSrcString-Specifies the URL of the track file
trackSrcLangString-Specifies the language of the track text data (required if kind="subtitles")
volumeBarAriaLabelString-Aria label for inputRange
videoType
Required
String-Type of video
videoSrc
Required
String-Source of the Video
variant
Required
String-Current variant of Video
onCanPlayReact.ReactEventHandler<HTMLVideoElement>-Function called when the video is ready to play
onChangeVolumeReact.MouseEventHandler<HTMLButtonElement>-Function called when user changes volume using the input range
onClickFullScreen(event: React.MouseEvent<HTMLButtonElement>, activated: boolean) => void-Function called when user click on the full screen button
onClickSubtitles(event: React.MouseEvent<HTMLButtonElement>, activated: boolean) => void-Function called when user click on the subtitles button
onClickVolumeButton(event: React.MouseEvent<HTMLButtonElement>, valume: string) => void-Function called when user click on the volume button
onLoadedMetadataReact.MouseEventHandler<HTMLButtonElement>-Function called when the video loads its metadata
onVideoPauseReact.ReactEventHandler<HTMLVideoElement>-Function called when the video pauses
onVideoPlayReact.ReactEventHandler<HTMLVideoElement>-Function called when the video plays
onTimeUpdateReact.ReactEventHandler<HTMLVideoElement>-Function called when video time changes
onTogglePlay( event: React.MouseEvent<HTMLVideoElementHTMLButtonElement, MouseEvent>, isPlaying: boolean ) => void-
onClickLinkReact.MouseEventHandler<HTMLElement>-Function called when user click on the link
onVideoPauseReact.ReactEventHandler<HTMLVideoElement>-Function called when the video pauses
ctvObject-Object used for update variant styles