Play video in a native surface. Use it for trailers, lessons and media feeds.

Play a streamed trailer with native controls

tsx
import { Video } from 'kuito';

export default function Trailer() {
  return (
    <Video
      src={{ uri: 'https://example.com/trailer/master.m3u8' }}
      height={220}
      controls
      onError={(event) => console.log(event.code, event.message)}
    />
  );
}

Behavior

Set a bounded size and handle onError. controls adds native playback controls. Use videoRef for play, pause and seek commands. Sources and playback features depend on the platform media implementation.

Continue

Read Audio for a complete workflow. See the complete prop reference for types and documented defaults.

Reference

Signatures

ts
(props: NativeViewProps<VideoViewProps, VideoMethods>): KuitoElement

Parameters

NameTypeRequiredDescription
propsNativeViewProps<VideoViewProps, VideoMethods>Yes—

Returns

KuitoElement

Props: NativeViewProps<VideoViewProps, VideoMethods>

Props (including inherited props) 100

NameTypeRequiredDescription
opacityAnimatable<number>No—
backgroundColorAnimatable<string>No—
borderRadiusAnimatable<number>No—
borderColorAnimatable<string>No—
widthAnimatable<SizeValue>No—
heightAnimatable<SizeValue>No—
translateXAnimatable<number>No—
translateYAnimatable<number>No—
scaleAnimatable<number>No—
scaleXAnimatable<number>No—
scaleYAnimatable<number>No—
rotateAnimatable<number>NoDegrees.
shadowColorAnimatable<string>No—
shadowRadiusAnimatable<number>No—
shadowOffsetXAnimatable<number>No—
shadowOffsetYAnimatable<number>No—
hiddenProp<boolean>NoTakes the view out of layout and off screen, as CSS display: none.
paddingProp<LengthPercentage>No—
positionProp<"relative" | "absolute">No—
idstringNo—
classProp<ClassNames>NoClass names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads.
styleStyleDeclarationsNoStyles of this view alone, compiled at build time: CSS properties in camelCase. A value that changes must set a native prop (opacity).
keystring | numberNo—
paddingTopProp<LengthPercentage>No—
paddingRightProp<LengthPercentage>No—
paddingBottomProp<LengthPercentage>No—
paddingLeftProp<LengthPercentage>No—
minWidthProp<SizeValue>No—
maxWidthProp<SizeValue>No—
minHeightProp<SizeValue>No—
maxHeightProp<SizeValue>No—
aspectRatioProp<number>NoWidth divided by height; sizes the missing side from the other.
topProp<LengthPercentageAuto>No—
rightProp<LengthPercentageAuto>No—
bottomProp<LengthPercentageAuto>No—
leftProp<LengthPercentageAuto>No—
marginProp<LengthPercentageAuto>No—
marginTopProp<LengthPercentageAuto>No—
marginRightProp<LengthPercentageAuto>No—
marginBottomProp<LengthPercentageAuto>No—
marginLeftProp<LengthPercentageAuto>No—
flexGrowProp<number>No—
flexShrinkProp<number>No—
flexBasisProp<SizeValue | "content">No—
flexProp<number>NoA grow factor from a zero basis, as CSS flex: n; 0 is inflexible.
alignSelfProp<"auto" | SelfAlignment>No—
directionProp<"ltr" | "rtl">NoThe way lines run; unset, the parent's, and the app's first language's at the root.
boxSizingProp<"border-box" | "content-box">No—
paddingInlineStartProp<LengthPercentage>NoPadding on the side lines start from: the left in ltr, the right in rtl.
paddingInlineEndProp<LengthPercentage>NoPadding on the side lines end at: the right in ltr, the left in rtl.
marginInlineStartProp<LengthPercentageAuto>NoMargin on the side lines start from: the left in ltr, the right in rtl.
marginInlineEndProp<LengthPercentageAuto>NoMargin on the side lines end at: the right in ltr, the left in rtl.
insetInlineStartProp<LengthPercentageAuto>Noleft in ltr, right in rtl.
insetInlineEndProp<LengthPercentageAuto>Noright in ltr, left in rtl.
roleProp<Role>No—
onAction(event: AccessibilityActionEvent) => voidNoThe screen reader action taken, by name.
accessibleProp<boolean>NoMakes the view one screen reader element, read as its label or its children's text.
labelProp<string>NoWhat a screen reader says for the view.
hintProp<string>NoWhat happens when the view is activated, read after the label.
aria-hiddenProp<boolean>NoScreen readers skip the view and its subtree.
actionsProp<readonly AccessibilityAction[]>NoActions a screen reader offers; onAction receives the one taken.
liveProp<"off" | "polite" | "assertive">NoARIA's aria-live: announces changes to the view's content, on iOS too.
aria-disabledProp<boolean>No—
aria-selectedProp<boolean>No—
aria-checkedProp<boolean | "mixed">No—
aria-busyProp<boolean>No—
aria-expandedProp<boolean>No—
aria-valueminProp<number>No—
aria-valuemaxProp<number>No—
aria-valuenowProp<number>No—
aria-valuetextProp<string>No—
gesturesreadonly Composable[]NoThe view's gestures; several race unless composed with together or orElse.
transitionPartial<Record<"opacity" | "backgroundColor" | "transform" | "borderRadius" | "borderColor" | "shadow" | "width" | "height" | "all", Animation<unknown> | AnimationSpec>>NoHow the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it.
animatePartial<Record<AnimatableProps, string | number>>NoAnimatable props whose every change moves as transition says; the first value applies at once.
enterEffectNoWhere the view enters from: fade.and(slide.up(12)).
exitProp<Effect>NoWhere the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited.
layoutAnimation<number>NoHow the view moves to a new frame the layout gives it: layout={spring()}.
overflowProp<"visible" | "hidden" | "clip" | "scroll">Nohidden and scroll clip; as in CSS, either lets a flex item shrink below its content.
borderWidthProp<number>No—
backgroundGradient{ angle: number; colors: string[];}No—
colorProp<string>No—
sharedIdProp<string>NoA view the navigation stack flies to the view with the same sharedId on the screen it pushes or pops to (docs/navigation.md#shared-elements).
refElementRef<NativeViewHandle<VideoMethods>>No—
srcBound<VideoSource>No—
pausedBound<boolean>NoFalse plays once the source loads. play() and pause() act at once; the prop applies when it changes.
mutedBound<boolean>No—
volumeBound<number>No0 to 1.
rateBound<number>NoAbove 0; 1 is normal speed.
loopBound<boolean>No—
objectFitBound<VideoObjectFit>No'contain' by default.
controlsBound<boolean>NoThe platform's playback controls over the picture.
progressIntervalBound<number>NoMilliseconds between onProgress events while playing; 250 by default, 0 for none.
onLoad(event: VideoLoadEvent) => voidNo—
onProgress(event: VideoProgressEvent) => voidNo—
onBuffer(event: VideoBufferEvent) => voidNo—
onEnd(event: VideoEndEvent) => voidNo—
onError(event: VideoErrorEvent) => voidNo—
onPlaybackStateChange(event: VideoPlaybackStateEvent) => voidNo—
onFullscreenChange(event: VideoFullscreenEvent) => voidNo—
onPictureInPictureChange(event: VideoPictureInPictureEvent) => voidNo—
onAction — method signatures

Signatures

ts
(event: AccessibilityActionEvent): void

Parameters

NameTypeRequiredDescription
eventAccessibilityActionEventYes—

Returns

void

backgroundGradient — nested fields

backgroundGradient fields

NameTypeRequiredDescription
anglenumberYes—
colorsstring[]Yes—
onLoad — method signatures

Signatures

ts
(event: VideoLoadEvent): void

Parameters

NameTypeRequiredDescription
eventVideoLoadEventYes—

Returns

void

onProgress — method signatures

Signatures

ts
(event: VideoProgressEvent): void

Parameters

NameTypeRequiredDescription
eventVideoProgressEventYes—

Returns

void

onBuffer — method signatures

Signatures

ts
(event: VideoBufferEvent): void

Parameters

NameTypeRequiredDescription
eventVideoBufferEventYes—

Returns

void

onEnd — method signatures

Signatures

ts
(event: VideoEndEvent): void

Parameters

NameTypeRequiredDescription
eventVideoEndEventYes—

Returns

void

onError — method signatures

Signatures

ts
(event: VideoErrorEvent): void

Parameters

NameTypeRequiredDescription
eventVideoErrorEventYes—

Returns

void

onPlaybackStateChange — method signatures

Signatures

ts
(event: VideoPlaybackStateEvent): void

Parameters

NameTypeRequiredDescription
eventVideoPlaybackStateEventYes—

Returns

void

onFullscreenChange — method signatures

Signatures

ts
(event: VideoFullscreenEvent): void

Parameters

NameTypeRequiredDescription
eventVideoFullscreenEventYes—

Returns

void

onPictureInPictureChange — method signatures

Signatures

ts
(event: VideoPictureInPictureEvent): void

Parameters

NameTypeRequiredDescription
eventVideoPictureInPictureEventYes—

Returns

void

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.