The MediaTrackRole interface represents the role of a media track in a media stream.

interface MediaTrackRole {
    id?: string;
    schemeIdUri: string;
    value?: string;
}

Properties

id?: string

The unique identifier for this role instance.

  • On Android: Corresponds to the native MediaTrackRole.id. May be undefined.
  • On iOS and tvOS: undefined, as HLS characteristics do not have inherent IDs in this context.
schemeIdUri: string

The URI identifying the scheme used for the role definition.

  • On Android: Corresponds to the native MediaTrackRole.schemeIdUri (e.g., "urn:mpeg:dash:role:2011").
  • On iOS and tvOS: predefined URN urn:hls:characteristic representing HLS characteristics.
value?: string

The value of the role within the specified scheme.

  • On Android: Corresponds to the native MediaTrackRole.value (e.g., "main", "caption", "description").
  • On iOS and tvOS: The raw HLS characteristic string (e.g., "public.accessibility.describes-music-and-sound", "public.accessibility.transcribes-spoken-dialog").