VideoHandle
What a Video's ref holds, for seeking, playing, pausing and entering full screen or picture in picture from code.
Utilização
Seek a lesson video back to the beginning.
Este tipo é usado por videoRef
// Seek a lesson video back to the beginning.
import { Button, Video, VStack, videoRef } from 'kuito';
export function Lesson() {
const player = videoRef();
return (
<VStack flex={1}>
<Video ref={player} src={{ uri: 'https://example.com/lesson.mp4' }} height={240} controls />
<Button onPress={() => void player.current?.seek(0).catch(console.error)}>
Restart lesson
</Button>
</VStack>
);
}Declaração do tipo
export type VideoHandle = NativeViewHandle<VideoMethods>;Membros 16
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
idsó de leitura | string | Sim | — |
parentsó de leitura | ElementHandle | Sim | — |
childrensó de leitura | ElementHandle[] | Sim | — |
focus | () => void | Sim | — |
blur | () => void | Sim | — |
setProperty | <K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null) => void | Sim | Sets a native prop on the view now, until its binding writes it again. |
addEventListener | (type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;}) => void | Sim | — |
removeEventListener | (type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean;}) => void | Sim | — |
dispatchEvent | (event: { type: string; bubbles?: boolean; cancelable?: boolean;}) => boolean | Sim | Sends an event through the tree, capture to bubble, as a native one travels:
a KuitoCustomEvent, or any object with a type. False when a listener
called preventDefault() on a cancelable event. |
seek | (seconds: number) => Promise<void> | Sim | Seconds from the start; exact, not the nearest key frame. |
play | () => Promise<void> | Sim | — |
pause | () => Promise<void> | Sim | — |
enterFullscreen | () => Promise<void> | Sim | — |
exitFullscreen | () => Promise<void> | Sim | — |
startPictureInPicture | () => Promise<void> | Sim | iOS only: rejects with ERR_UNSUPPORTED on Android (docs/video.md). |
stopPictureInPicture | () => Promise<void> | Sim | — |
focus — assinaturas de método
Assinaturas
(): voidParâmetros
Sem parâmetros.
Devolve
void
blur — assinaturas de método
Assinaturas
(): voidParâmetros
Sem parâmetros.
Devolve
void
setProperty — assinaturas de método
Assinaturas
<K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null): voidParâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
K | keyof ElementProperties | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
key | K | Sim | — |
value | ElementProperties[K] | Sim | — |
Devolve
void
addEventListener — assinaturas de método
Assinaturas
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal; }): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
type | string | Sim | — |
fn | (e: KuitoNativeEvent) => void | Sim | — |
options | boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;} | Não | — |
Devolve
void
removeEventListener — assinaturas de método
Assinaturas
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; }): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
type | string | Sim | — |
fn | (e: KuitoNativeEvent) => void | Sim | — |
options | boolean | { capture?: boolean;} | Não | — |
Devolve
void
dispatchEvent — assinaturas de método
Assinaturas
(event: { type: string; bubbles?: boolean; cancelable?: boolean; }): booleanParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | { type: string; bubbles?: boolean; cancelable?: boolean;} | Sim | — |
Devolve
boolean
seek — assinaturas de método
Assinaturas
(seconds: number): Promise<void>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
seconds | number | Sim | — |
Devolve
Promise<void>
play — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
pause — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
enterFullscreen — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
exitFullscreen — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
startPictureInPicture — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
stopPictureInPicture — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<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.