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.

Referenz

Signaturen

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

Parameter

NameTypErforderlichBeschreibung
propsNativeViewProps<VideoViewProps, VideoMethods>Ja—

Rückgabe

KuitoElement

Props: NativeViewProps<VideoViewProps, VideoMethods>

Props (einschließlich geerbter Props) 100

NameTypErforderlichBeschreibung
opacityAnimatable<number>Nein—
backgroundColorAnimatable<string>Nein—
borderRadiusAnimatable<number>Nein—
borderColorAnimatable<string>Nein—
widthAnimatable<SizeValue>Nein—
heightAnimatable<SizeValue>Nein—
translateXAnimatable<number>Nein—
translateYAnimatable<number>Nein—
scaleAnimatable<number>Nein—
scaleXAnimatable<number>Nein—
scaleYAnimatable<number>Nein—
rotateAnimatable<number>NeinDegrees.
shadowColorAnimatable<string>Nein—
shadowRadiusAnimatable<number>Nein—
shadowOffsetXAnimatable<number>Nein—
shadowOffsetYAnimatable<number>Nein—
hiddenProp<boolean>NeinTakes the view out of layout and off screen, as CSS display: none.
paddingProp<LengthPercentage>Nein—
positionProp<"relative" | "absolute">Nein—
idstringNein—
classProp<ClassNames>NeinClass names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads.
styleStyleDeclarationsNeinStyles of this view alone, compiled at build time: CSS properties in camelCase. A value that changes must set a native prop (opacity).
keystring | numberNein—
paddingTopProp<LengthPercentage>Nein—
paddingRightProp<LengthPercentage>Nein—
paddingBottomProp<LengthPercentage>Nein—
paddingLeftProp<LengthPercentage>Nein—
minWidthProp<SizeValue>Nein—
maxWidthProp<SizeValue>Nein—
minHeightProp<SizeValue>Nein—
maxHeightProp<SizeValue>Nein—
aspectRatioProp<number>NeinWidth divided by height; sizes the missing side from the other.
topProp<LengthPercentageAuto>Nein—
rightProp<LengthPercentageAuto>Nein—
bottomProp<LengthPercentageAuto>Nein—
leftProp<LengthPercentageAuto>Nein—
marginProp<LengthPercentageAuto>Nein—
marginTopProp<LengthPercentageAuto>Nein—
marginRightProp<LengthPercentageAuto>Nein—
marginBottomProp<LengthPercentageAuto>Nein—
marginLeftProp<LengthPercentageAuto>Nein—
flexGrowProp<number>Nein—
flexShrinkProp<number>Nein—
flexBasisProp<SizeValue | "content">Nein—
flexProp<number>NeinA grow factor from a zero basis, as CSS flex: n; 0 is inflexible.
alignSelfProp<"auto" | SelfAlignment>Nein—
directionProp<"ltr" | "rtl">NeinThe way lines run; unset, the parent's, and the app's first language's at the root.
boxSizingProp<"border-box" | "content-box">Nein—
paddingInlineStartProp<LengthPercentage>NeinPadding on the side lines start from: the left in ltr, the right in rtl.
paddingInlineEndProp<LengthPercentage>NeinPadding on the side lines end at: the right in ltr, the left in rtl.
marginInlineStartProp<LengthPercentageAuto>NeinMargin on the side lines start from: the left in ltr, the right in rtl.
marginInlineEndProp<LengthPercentageAuto>NeinMargin on the side lines end at: the right in ltr, the left in rtl.
insetInlineStartProp<LengthPercentageAuto>Neinleft in ltr, right in rtl.
insetInlineEndProp<LengthPercentageAuto>Neinright in ltr, left in rtl.
roleProp<Role>Nein—
onAction(event: AccessibilityActionEvent) => voidNeinThe screen reader action taken, by name.
accessibleProp<boolean>NeinMakes the view one screen reader element, read as its label or its children's text.
labelProp<string>NeinWhat a screen reader says for the view.
hintProp<string>NeinWhat happens when the view is activated, read after the label.
aria-hiddenProp<boolean>NeinScreen readers skip the view and its subtree.
actionsProp<readonly AccessibilityAction[]>NeinActions a screen reader offers; onAction receives the one taken.
liveProp<"off" | "polite" | "assertive">NeinARIA's aria-live: announces changes to the view's content, on iOS too.
aria-disabledProp<boolean>Nein—
aria-selectedProp<boolean>Nein—
aria-checkedProp<boolean | "mixed">Nein—
aria-busyProp<boolean>Nein—
aria-expandedProp<boolean>Nein—
aria-valueminProp<number>Nein—
aria-valuemaxProp<number>Nein—
aria-valuenowProp<number>Nein—
aria-valuetextProp<string>Nein—
gesturesreadonly Composable[]NeinThe 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>>NeinHow the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it.
animatePartial<Record<AnimatableProps, string | number>>NeinAnimatable props whose every change moves as transition says; the first value applies at once.
enterEffectNeinWhere the view enters from: fade.and(slide.up(12)).
exitProp<Effect>NeinWhere the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited.
layoutAnimation<number>NeinHow the view moves to a new frame the layout gives it: layout={spring()}.
overflowProp<"visible" | "hidden" | "clip" | "scroll">Neinhidden and scroll clip; as in CSS, either lets a flex item shrink below its content.
borderWidthProp<number>Nein—
backgroundGradient{ angle: number; colors: string[];}Nein—
colorProp<string>Nein—
sharedIdProp<string>NeinA 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>>Nein—
srcBound<VideoSource>Nein—
pausedBound<boolean>NeinFalse plays once the source loads. play() and pause() act at once; the prop applies when it changes.
mutedBound<boolean>Nein—
volumeBound<number>Nein0 to 1.
rateBound<number>NeinAbove 0; 1 is normal speed.
loopBound<boolean>Nein—
objectFitBound<VideoObjectFit>Nein'contain' by default.
controlsBound<boolean>NeinThe platform's playback controls over the picture.
progressIntervalBound<number>NeinMilliseconds between onProgress events while playing; 250 by default, 0 for none.
onLoad(event: VideoLoadEvent) => voidNein—
onProgress(event: VideoProgressEvent) => voidNein—
onBuffer(event: VideoBufferEvent) => voidNein—
onEnd(event: VideoEndEvent) => voidNein—
onError(event: VideoErrorEvent) => voidNein—
onPlaybackStateChange(event: VideoPlaybackStateEvent) => voidNein—
onFullscreenChange(event: VideoFullscreenEvent) => voidNein—
onPictureInPictureChange(event: VideoPictureInPictureEvent) => voidNein—
onAction — Methodensignaturen

Signaturen

ts
(event: AccessibilityActionEvent): void

Parameter

NameTypErforderlichBeschreibung
eventAccessibilityActionEventJa—

Rückgabe

void

backgroundGradient — verschachtelte Felder

backgroundGradient Felder

NameTypErforderlichBeschreibung
anglenumberJa—
colorsstring[]Ja—
onLoad — Methodensignaturen

Signaturen

ts
(event: VideoLoadEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoLoadEventJa—

Rückgabe

void

onProgress — Methodensignaturen

Signaturen

ts
(event: VideoProgressEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoProgressEventJa—

Rückgabe

void

onBuffer — Methodensignaturen

Signaturen

ts
(event: VideoBufferEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoBufferEventJa—

Rückgabe

void

onEnd — Methodensignaturen

Signaturen

ts
(event: VideoEndEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoEndEventJa—

Rückgabe

void

onError — Methodensignaturen

Signaturen

ts
(event: VideoErrorEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoErrorEventJa—

Rückgabe

void

onPlaybackStateChange — Methodensignaturen

Signaturen

ts
(event: VideoPlaybackStateEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoPlaybackStateEventJa—

Rückgabe

void

onFullscreenChange — Methodensignaturen

Signaturen

ts
(event: VideoFullscreenEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoFullscreenEventJa—

Rückgabe

void

onPictureInPictureChange — Methodensignaturen

Signaturen

ts
(event: VideoPictureInPictureEvent): void

Parameter

NameTypErforderlichBeschreibung
eventVideoPictureInPictureEventJa—

Rückgabe

void

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.