VideoHandle
What a Video's ref holds, for seeking, playing, pausing and entering full screen or picture in picture from code.
Verwendung
Seek a lesson video back to the beginning.
Dieser Typ wird verwendet von 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>
);
}Typdeklaration
export type VideoHandle = NativeViewHandle<VideoMethods>;Mitglieder 16
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
idschreibgeschützt | string | Ja | — |
parentschreibgeschützt | ElementHandle | Ja | — |
childrenschreibgeschützt | ElementHandle[] | Ja | — |
focus | () => void | Ja | — |
blur | () => void | Ja | — |
setProperty | <K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null) => void | Ja | 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 | Ja | — |
removeEventListener | (type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean;}) => void | Ja | — |
dispatchEvent | (event: { type: string; bubbles?: boolean; cancelable?: boolean;}) => boolean | Ja | 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> | Ja | Seconds from the start; exact, not the nearest key frame. |
play | () => Promise<void> | Ja | — |
pause | () => Promise<void> | Ja | — |
enterFullscreen | () => Promise<void> | Ja | — |
exitFullscreen | () => Promise<void> | Ja | — |
startPictureInPicture | () => Promise<void> | Ja | iOS only: rejects with ERR_UNSUPPORTED on Android (docs/video.md). |
stopPictureInPicture | () => Promise<void> | Ja | — |
focus — Methodensignaturen
Signaturen
(): voidParameter
Keine Parameter.
Rückgabe
void
blur — Methodensignaturen
Signaturen
(): voidParameter
Keine Parameter.
Rückgabe
void
setProperty — Methodensignaturen
Signaturen
<K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null): voidTypparameter
| Name | Einschränkung | Standard |
|---|---|---|
K | keyof ElementProperties | — |
Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
key | K | Ja | — |
value | ElementProperties[K] | Ja | — |
Rückgabe
void
addEventListener — Methodensignaturen
Signaturen
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal; }): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | string | Ja | — |
fn | (e: KuitoNativeEvent) => void | Ja | — |
options | boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;} | Nein | — |
Rückgabe
void
removeEventListener — Methodensignaturen
Signaturen
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; }): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | string | Ja | — |
fn | (e: KuitoNativeEvent) => void | Ja | — |
options | boolean | { capture?: boolean;} | Nein | — |
Rückgabe
void
dispatchEvent — Methodensignaturen
Signaturen
(event: { type: string; bubbles?: boolean; cancelable?: boolean; }): booleanParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | { type: string; bubbles?: boolean; cancelable?: boolean;} | Ja | — |
Rückgabe
boolean
seek — Methodensignaturen
Signaturen
(seconds: number): Promise<void>Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
seconds | number | Ja | — |
Rückgabe
Promise<void>
play — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
pause — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
enterFullscreen — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
exitFullscreen — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
startPictureInPicture — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
stopPictureInPicture — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<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.