Video
A tradução desta página não existe ou está desatualizada, por isso é mostrada em inglês. Ler em inglês
Play video in a native surface. Use it for trailers, lessons and media feeds.
Play a streamed trailer with native controls
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.
Referência
Assinaturas
(props: NativeViewProps<VideoViewProps, VideoMethods>): KuitoElementParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
props | NativeViewProps<VideoViewProps, VideoMethods> | Sim | — |
Devolve
Props: NativeViewProps<VideoViewProps, VideoMethods>
Props (incluindo props herdadas) 100
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
opacity | Animatable<number> | Não | — |
backgroundColor | Animatable<string> | Não | — |
borderRadius | Animatable<number> | Não | — |
borderColor | Animatable<string> | Não | — |
width | Animatable<SizeValue> | Não | — |
height | Animatable<SizeValue> | Não | — |
translateX | Animatable<number> | Não | — |
translateY | Animatable<number> | Não | — |
scale | Animatable<number> | Não | — |
scaleX | Animatable<number> | Não | — |
scaleY | Animatable<number> | Não | — |
rotate | Animatable<number> | Não | Degrees. |
shadowColor | Animatable<string> | Não | — |
shadowRadius | Animatable<number> | Não | — |
shadowOffsetX | Animatable<number> | Não | — |
shadowOffsetY | Animatable<number> | Não | — |
padding | Prop<LengthPercentage> | Não | — |
position | Prop<"relative" | "absolute"> | Não | — |
id | string | Não | — |
class | Prop<ClassNames> | Não | Class names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads. |
style | StyleDeclarations | Não | Styles of this view alone, compiled at build time: CSS properties in
camelCase. A value that changes must set a native prop (opacity). |
key | string | number | Não | — |
paddingTop | Prop<LengthPercentage> | Não | — |
paddingRight | Prop<LengthPercentage> | Não | — |
paddingBottom | Prop<LengthPercentage> | Não | — |
paddingLeft | Prop<LengthPercentage> | Não | — |
minWidth | Prop<SizeValue> | Não | — |
maxWidth | Prop<SizeValue> | Não | — |
minHeight | Prop<SizeValue> | Não | — |
maxHeight | Prop<SizeValue> | Não | — |
aspectRatio | Prop<number> | Não | Width divided by height; sizes the missing side from the other. |
top | Prop<LengthPercentageAuto> | Não | — |
right | Prop<LengthPercentageAuto> | Não | — |
bottom | Prop<LengthPercentageAuto> | Não | — |
left | Prop<LengthPercentageAuto> | Não | — |
margin | Prop<LengthPercentageAuto> | Não | — |
marginTop | Prop<LengthPercentageAuto> | Não | — |
marginRight | Prop<LengthPercentageAuto> | Não | — |
marginBottom | Prop<LengthPercentageAuto> | Não | — |
marginLeft | Prop<LengthPercentageAuto> | Não | — |
flexGrow | Prop<number> | Não | — |
flexShrink | Prop<number> | Não | — |
flexBasis | Prop<SizeValue | "content"> | Não | — |
flex | Prop<number> | Não | A grow factor from a zero basis, as CSS flex: n; 0 is inflexible. |
alignSelf | Prop<"auto" | SelfAlignment> | Não | — |
direction | Prop<"ltr" | "rtl"> | Não | The way lines run; unset, the parent's, and the app's first language's at the root. |
boxSizing | Prop<"border-box" | "content-box"> | Não | — |
paddingInlineStart | Prop<LengthPercentage> | Não | Padding on the side lines start from: the left in ltr, the right in rtl. |
paddingInlineEnd | Prop<LengthPercentage> | Não | Padding on the side lines end at: the right in ltr, the left in rtl. |
marginInlineStart | Prop<LengthPercentageAuto> | Não | Margin on the side lines start from: the left in ltr, the right in rtl. |
marginInlineEnd | Prop<LengthPercentageAuto> | Não | Margin on the side lines end at: the right in ltr, the left in rtl. |
insetInlineStart | Prop<LengthPercentageAuto> | Não | left in ltr, right in rtl. |
insetInlineEnd | Prop<LengthPercentageAuto> | Não | right in ltr, left in rtl. |
role | Prop<Role> | Não | — |
onAction | (event: AccessibilityActionEvent) => void | Não | The screen reader action taken, by name. |
accessible | Prop<boolean> | Não | Makes the view one screen reader element, read as its label or its children's text. |
label | Prop<string> | Não | What a screen reader says for the view. |
hint | Prop<string> | Não | What happens when the view is activated, read after the label. |
actions | Prop<readonly AccessibilityAction[]> | Não | Actions a screen reader offers; onAction receives the one taken. |
live | Prop<"off" | "polite" | "assertive"> | Não | ARIA's aria-live: announces changes to the view's content, on iOS too. |
aria-disabled | Prop<boolean> | Não | — |
aria-selected | Prop<boolean> | Não | — |
aria-checked | Prop<boolean | "mixed"> | Não | — |
aria-busy | Prop<boolean> | Não | — |
aria-expanded | Prop<boolean> | Não | — |
aria-valuemin | Prop<number> | Não | — |
aria-valuemax | Prop<number> | Não | — |
aria-valuenow | Prop<number> | Não | — |
aria-valuetext | Prop<string> | Não | — |
gestures | readonly Composable[] | Não | The view's gestures; several race unless composed with together or orElse. |
transition | Partial<Record<"opacity" | "backgroundColor" | "transform" | "borderRadius" | "borderColor" | "shadow" | "width" | "height" | "all", Animation<unknown> | AnimationSpec>> | Não | How the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it. |
animate | Partial<Record<AnimatableProps, string | number>> | Não | Animatable props whose every change moves as transition says; the first value applies at once. |
enter | Effect | Não | Where the view enters from: fade.and(slide.up(12)). |
exit | Prop<Effect> | Não | Where the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited. |
layout | Animation<number> | Não | How the view moves to a new frame the layout gives it: layout={spring()}. |
overflow | Prop<"visible" | "hidden" | "clip" | "scroll"> | Não | hidden and scroll clip; as in CSS, either lets a flex item shrink below its content. |
borderWidth | Prop<number> | Não | — |
backgroundGradient | { angle: number; colors: string[];} | Não | — |
color | Prop<string> | Não | — |
sharedId | Prop<string> | Não | A 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). |
ref | ElementRef<NativeViewHandle<VideoMethods>> | Não | — |
src | Bound<VideoSource> | Não | — |
paused | Bound<boolean> | Não | False plays once the source loads. play() and pause() act at once; the prop applies when it changes. |
muted | Bound<boolean> | Não | — |
volume | Bound<number> | Não | 0 to 1. |
rate | Bound<number> | Não | Above 0; 1 is normal speed. |
loop | Bound<boolean> | Não | — |
objectFit | Bound<VideoObjectFit> | Não | 'contain' by default. |
controls | Bound<boolean> | Não | The platform's playback controls over the picture. |
progressInterval | Bound<number> | Não | Milliseconds between onProgress events while playing; 250 by default, 0 for none. |
onLoad | (event: VideoLoadEvent) => void | Não | — |
onProgress | (event: VideoProgressEvent) => void | Não | — |
onBuffer | (event: VideoBufferEvent) => void | Não | — |
onEnd | (event: VideoEndEvent) => void | Não | — |
onError | (event: VideoErrorEvent) => void | Não | — |
onPlaybackStateChange | (event: VideoPlaybackStateEvent) => void | Não | — |
onFullscreenChange | (event: VideoFullscreenEvent) => void | Não | — |
onPictureInPictureChange | (event: VideoPictureInPictureEvent) => void | Não | — |
onAction — assinaturas de método
Assinaturas
(event: AccessibilityActionEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | AccessibilityActionEvent | Sim | — |
Devolve
void
backgroundGradient — campos aninhados
backgroundGradient campos
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
angle | number | Sim | — |
colors | string[] | Sim | — |
onLoad — assinaturas de método
Assinaturas
(event: VideoLoadEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoLoadEvent | Sim | — |
Devolve
void
onProgress — assinaturas de método
Assinaturas
(event: VideoProgressEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoProgressEvent | Sim | — |
Devolve
void
onBuffer — assinaturas de método
Assinaturas
(event: VideoBufferEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoBufferEvent | Sim | — |
Devolve
void
onEnd — assinaturas de método
Assinaturas
(event: VideoEndEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoEndEvent | Sim | — |
Devolve
void
onError — assinaturas de método
Assinaturas
(event: VideoErrorEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoErrorEvent | Sim | — |
Devolve
void
onPlaybackStateChange — assinaturas de método
Assinaturas
(event: VideoPlaybackStateEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoPlaybackStateEvent | Sim | — |
Devolve
void
onFullscreenChange — assinaturas de método
Assinaturas
(event: VideoFullscreenEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoFullscreenEvent | Sim | — |
Devolve
void
onPictureInPictureChange — assinaturas de método
Assinaturas
(event: VideoPictureInPictureEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | VideoPictureInPictureEvent | Sim | — |
Devolve
void
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.