SubtitleTrack

@objcMembers
@objc(BMPSubtitleTrack)
public class SubtitleTrack : Track, @unchecked Sendable

Describes a subtitle track.

  • Type of the SubtitleTrack. Default is WebVTT.

    Declaration

    Swift

    public let format: SubtitleFormat
  • The IETF BCP 47 language tag associated with the subtitle track.

    Declaration

    Swift

    public let language: String?
  • The subtitle track controller for this track.

    Declaration

    Swift

    public let controller: SubtitleTrackController
  • Tells if a subtitle track is forced. If set to true it means that the player should automatically select and switch this subtitle according to the selected audio language. Forced subtitles do not appear in BitmovinPlayer.getAvailableSubtitles.

    Declaration

    Swift

    public internal(set) var isForced: Bool { get }
  • Creates a new subtitle track based on the given URL and provided metadata.

    Declaration

    Swift

    public init(
        url: URL?,
        format: SubtitleFormat,
        label: String,
        identifier: String,
        isDefaultTrack: Bool,
        language: String?,
        forced: Bool
    )

    Parameters

    url

    The URL to the timed file, e.g. WebVTT file.

    format

    Type of the subtitle track file, WebVTT or TTML.

    label

    The label for this track.

    identifier

    The unique identifier for this track.

    isDefaultTrack

    If set to true, this track would be considered as default.

    language

    The IETF BCP 47 language tag associated with this track

    forced

    If set to true, this track would be considered as forced subtitle track.

    Return Value

    A new subtitle track initialized with the given subtitle URL and the provided metadata.

  • Creates a new subtitle track based on the given URL and provided metadata.

    Declaration

    Swift

    public convenience init(
        url: URL?,
        label: String,
        identifier: String,
        isDefaultTrack: Bool,
        language: String?
    )

    Parameters

    url

    The URL to the timed file, e.g. WebVTT file.

    label

    The label for this track.

    identifier

    The unique identifier for this track.

    isDefaultTrack

    If set to true, this track would be considered as default.

    language

    The IETF BCP 47 language tag associated with this track

    Return Value

    A new subtitle track initialized with the given subtitle URL and the provided metadata.

  • Creates a new subtitle track based on the given URL and provided metadata.

    Declaration

    Swift

    public convenience init(
        url: URL?,
        format: SubtitleFormat,
        label: String,
        identifier: String,
        isDefaultTrack: Bool,
        language: String?
    )

    Parameters

    url

    The URL to the timed file, e.g. WebVTT file.

    format

    Type of the subtitle track file, WebVTT or TTML.

    label

    The label for this track.

    identifier

    The unique identifier for this track.

    isDefaultTrack

    If set to true, this track would be considered as default.

    language

    The IETF BCP 47 language tag associated with this track

    Return Value

    A new subtitle track initialized with the given subtitle URL and the provided metadata.

  • Creates a new subtitle track based on the given URL and provided metadata.

    Declaration

    Swift

    public convenience init(
        url: URL?,
        label: String,
        identifier: String,
        isDefaultTrack: Bool,
        language: String?,
        forced: Bool
    )

    Parameters

    url

    The URL to the timed file, e.g. WebVTT file.

    label

    The label for this track.

    identifier

    The unique identifier for this track.

    isDefaultTrack

    If set to true, this track would be considered as default.

    language

    The IETF BCP 47 language tag associated with this track

    forced

    If set to true, this track would be considered as forced subtitle track.

    Return Value

    A new subtitle track initialized with the given subtitle URL and the provided metadata.