Utilisation

Seek a lesson video back to the beginning.

Ce type est utilisé par videoRef

tsx
// 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>
  );
}

Déclaration du type

ts
export type VideoHandle = NativeViewHandle<VideoMethods>;

Membres 16

NomTypeRequisDescription
idlecture seulestringOui—
parentlecture seuleElementHandleOui—
childrenlecture seuleElementHandle[]Oui—
focus() => voidOui—
blur() => voidOui—
setProperty<K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null) => voidOuiSets 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;}) => voidOui—
removeEventListener(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean;}) => voidOui—
dispatchEvent(event: { type: string; bubbles?: boolean; cancelable?: boolean;}) => booleanOuiSends 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>OuiSeconds from the start; exact, not the nearest key frame.
play() => Promise<void>Oui—
pause() => Promise<void>Oui—
enterFullscreen() => Promise<void>Oui—
exitFullscreen() => Promise<void>Oui—
startPictureInPicture() => Promise<void>OuiiOS only: rejects with ERR_UNSUPPORTED on Android (docs/video.md).
stopPictureInPicture() => Promise<void>Oui—
focus — signatures de méthode

Signatures

ts
(): void

Paramètres

Aucun paramètre.

Retourne

void

blur — signatures de méthode

Signatures

ts
(): void

Paramètres

Aucun paramètre.

Retourne

void

setProperty — signatures de méthode

Signatures

ts
<K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null): void

Paramètres de type

NomContraintePar défaut
Kkeyof ElementProperties—

Paramètres

NomTypeRequisDescription
keyKOui—
valueElementProperties[K]Oui—

Retourne

void

addEventListener — signatures de méthode

Signatures

ts
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal; }): void

Paramètres

NomTypeRequisDescription
typestringOui—
fn(e: KuitoNativeEvent) => voidOui—
optionsboolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;}Non—

Retourne

void

removeEventListener — signatures de méthode

Signatures

ts
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; }): void

Paramètres

NomTypeRequisDescription
typestringOui—
fn(e: KuitoNativeEvent) => voidOui—
optionsboolean | { capture?: boolean;}Non—

Retourne

void

dispatchEvent — signatures de méthode

Signatures

ts
(event: { type: string; bubbles?: boolean; cancelable?: boolean; }): boolean

Paramètres

NomTypeRequisDescription
event{ type: string; bubbles?: boolean; cancelable?: boolean;}Oui—

Retourne

boolean

seek — signatures de méthode

Signatures

ts
(seconds: number): Promise<void>

Paramètres

NomTypeRequisDescription
secondsnumberOui—

Retourne

Promise<void>

play — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

pause — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

enterFullscreen — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

exitFullscreen — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

startPictureInPicture — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

stopPictureInPicture — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.