Represents a source configuration that be loaded into a player instance.

interface SourceConfig {
    analyticsSourceMetadata?: SourceMetadata;
    description?: string;
    drmConfig?: DrmConfig;
    isPosterPersistent?: boolean;
    metadata?: Record<string, string>;
    nativeId?: string;
    options?: SourceOptions;
    poster?: string;
    subtitleTracks?: SideLoadedSubtitleTrack[];
    thumbnailTrack?: string;
    title?: string;
    type?: SourceType;
    url: string;
}

Hierarchy

  • NativeInstanceConfig
    • SourceConfig

Properties

analyticsSourceMetadata?: SourceMetadata

The SourceMetadata for the Source to setup custom analytics tracking

description?: string

The description of the video source.

drmConfig?: DrmConfig

The DRM config for the source.

isPosterPersistent?: boolean

Indicates whether to show the poster image during playback. Useful, for example, for audio-only streams.

metadata?: Record<string, string>

The optional custom metadata. Also sent to the cast receiver when loading the Source.

nativeId?: string

Optionally user-defined string id for the native instance. Used to access a certain native instance from any point in the source code then call methods/properties on it.

When left empty, a random UUIDv4 is generated for it.

Example

Accessing or creating the Player with nativeId equal to my-player:

const player = new Player({ nativeId: 'my-player' })
player.play(); // call methods and properties...
options?: SourceOptions

The SourceOptions for this configuration.

poster?: string

The URL to a preview image displayed until the video starts.

subtitleTracks?: SideLoadedSubtitleTrack[]

External subtitle tracks to be added into the player.

thumbnailTrack?: string

External thumbnails to be added into the player.

title?: string

The title of the video source.

type?: SourceType

The SourceType for this configuration.

url: string

The url for this source configuration.