Repository: expo/expo
File: packages/expo-video/src/VideoPlayer.types.ts (TypeScript)

Code before:
  /**
   * Generates thumbnails from the currently played asset. The thumbnails are references to native images,
   * thus they can be used as a source of the `Image` component from `expo-image`.
   * @platform ios
   */
  generateThumbnailsAsync(times: number | number[]): Promise<VideoThumbnail[]>;

  // We re-declare some of the functions from the event emitter to explicitly hide them in the docs without adding
  // expo-video specific exceptions in the docs code.
  /**
   * @hidden
   */
  emit<EventName extends keyof VideoPlayerEvents>(
    eventName: EventName,
    ...args: Parameters<VideoPlayerEvents[EventName]>
  ): void;

  /**
   * @hidden
   */
  startObserving?<EventName extends keyof VideoPlayerEvents>(eventName: EventName): void;

  /**
   * @hidden
   */
  stopObserving?<EventName extends keyof VideoPlayerEvents>(eventName: EventName): void;
}

/**
 * Describes the current status of the player.
 * - `idle`: The player is not playing or loading any videos.
 * - `loading`: The player is loading video data from the provided source
 * - `readyToPlay`: The player has loaded enough data to start playing or to continue playback.
 * - `error`: The player has encountered an error while loading or playing the video.
 */
export type VideoPlayerStatus = 'idle' | 'loading' | 'readyToPlay' | 'error';

export type VideoSource =
  | string
  | number
  | null
  | {
      /**
       * The URI of the video.
       *
       * This property is exclusive with the `assetId` property. When both are present, the `assetId` will be ignored.
       */
      uri?: string;

      /**
       * The asset ID of a local video asset, acquired with the `require` function.

Review comment (suggestion):
Please, don't do this 😅 We're already trying to hide inherited methods in the docs, see https://github.com/expo/expo/blob/b86f1fe71efe421b2ebeb152d5b59ebd554e14cb/docs/components/plugins/api/APISectionClasses.tsx#L43-L48
Maybe there is an issue in that logic.

Code after:
   */
  seekBy(seconds: number): void;

  /**
   * Seeks the playback to the beginning.
   */
  replay(): void;

  /**
   * Generates thumbnails from the currently played asset. The thumbnails are references to native images,
   * thus they can be used as a source of the `Image` component from `expo-image`.
   * @platform ios
   */
  generateThumbnailsAsync(times: number | number[]): Promise<VideoThumbnail[]>;
}

/**
 * Describes the current status of the player.
 * - `idle`: The player is not playing or loading any videos.
 * - `loading`: The player is loading video data from the provided source
 * - `readyToPlay`: The player has loaded enough data to start playing or to continue playback.
 * - `error`: The player has encountered an error while loading or playing the video.
 */
export type VideoPlayerStatus = 'idle' | 'loading' | 'readyToPlay' | 'error';

export type VideoSource =
  | string
  | number
  | null
  | {
      /**
       * The URI of the video.
       *
       * This property is exclusive with the `assetId` property. When both are present, the `assetId` will be ignored.
       */
      uri?: string;

      /**
       * The asset ID of a local video asset, acquired with the `require` function.
       * This property is exclusive with the `uri` property. When both are present, the `assetId` will be ignored.
       */
      assetId?: number;

      /**
       * Specifies the DRM options which will be used by the player while loading the video.
       */
      drm?: DRMOptions;

      /**
       * Specifies information which will be displayed in the now playing notification.
       * When undefined the player will display information contained in the video metadata.