Bitmovin Player React Native SDK - v1.31.0
    Preparing search index...

    Class Source

    Represents audio and video content that can be loaded into a player.

    Hierarchy

    Index
    config?: SourceConfig

    The configuration object used to initialize this instance.

    drm?: Drm

    Provides access to DRM runtime APIs for this source. Use drm.fairplay to access FairplayDrmApi for FairPlay-specific APIs such as FairplayDrmApi.renewExpiringLicense.

    undefined if the source was created without a DrmConfig.

    isDestroyed: boolean = false

    Whether the native Source object has been disposed.

    isInitialized: boolean = false

    Whether the native Source object has been created.

    nativeId: string

    Optionally user-defined string id for the native instance, or UUIDv4.

    remoteControl: SourceRemoteControlConfig | null = null

    The remote control config for this source. This is only supported on iOS.

    iOS

    • Destroys the native Source and releases all of its allocated resources. All listeners are removed.

      Returns void

    • The duration of the source in seconds if it’s a VoD or INFINITY if it’s a live stream. Default value is 0 if the duration is not available or not known.

      Returns Promise<number>

    • Parameters

      • time: number

        The time in seconds for which to retrieve the thumbnail.

      Returns Promise<Thumbnail | null>

      a Thumbnail for the specified playback time if available. Supported thumbnail formats are:

      • WebVtt configured via SourceConfig.thumbnailTrack, on all supported platforms
      • HLS Image Media Playlist in the multivariant playlist, Android-only
      • DASH Image Adaptation Set as specified in DASH-IF IOP, Android-only If a WebVtt thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
    • Allocates the native Source instance and its resources natively. Calls made while an initialization is in progress share it. Has no effect on a destroyed source.

      Returns Promise<void>

    • Whether the source is currently active in a player (i.e. playing back or paused). Only one source can be active in the same player instance at any time.

      Returns Promise<boolean>

    • Whether the source is currently attached to a player instance.

      Returns Promise<boolean>

    • Metadata for the currently loaded source.

      Returns Promise<Record<string, any> | null>

    • Registers listener to be called whenever this source emits eventName.

      Unlike Player.on, which only receives the source events of the active source, the source emits all of its events, including while it is inactive, e.g. sourceLoaded of a preloaded playlist source. Listeners registered before the source is initialized are attached during Source.initialize. Calling it on a destroyed source has no effect and logs a warning. Registering the same listener again for eventName has no effect; use Source.off to remove it.

      Type Parameters

      Parameters

      • eventName: K

        The name of the event, e.g. sourceLoaded.

      • listener: (event: SourceEventMap[K]) => void

        The function called with the event.

      Returns void

    • Set metadata for the currently loaded source. Setting the metadata to null clears the metadata object in native source.

      Parameters

      • metadata: Record<string, any> | null

        metadata to be set.

      Returns void