PlayerMediaTrackSelectable

public protocol PlayerMediaTrackSelectable

The player interface for media track selection and retrieval

  • API to fetch all MediaTrack. Deprecated: Use the async variant instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Use the async API tracks(for:﹚ async throws instead on iOS/tvOS 15+.")
    func tracks(for trackType: MediaTrackType) -> [MediaTrack]?
  • tracks(for:) Asynchronous

    API to fetch all MediaTrack.

    Declaration

    Swift

    @available(iOS 15.0, tvOS 15.0, *)
    func tracks(for trackType: MediaTrackType) async throws -> [MediaTrack]?
  • API to fetch active track. Deprecated: Use the async variant instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Use the async API selectedTrack(for:﹚ async throws instead on iOS/tvOS 15+.")
    func selectedTrack(for trackType: MediaTrackType) -> MediaTrack?
  • selectedTrack(for:) Asynchronous

    API to fetch all MediaTrack asynchronously.

    Declaration

    Swift

    @available(iOS 15.0, tvOS 15.0, *)
    func selectedTrack(for trackType: MediaTrackType) async throws -> MediaTrack?

    Return Value

    The active MediaTrack or nil if none is selected.

  • API to set track. Pass nil to deselect selected track. Deprecated: Use the async variant instead

    Declaration

    Swift

    @available(*, deprecated, message: "Use the async API selectTrack(_:for:﹚ async throws instead on iOS/tvOS 15+.")
    func selectTrack(_ track: MediaTrack?, for trackType: MediaTrackType)
  • selectTrack(_:for:) Asynchronous

    API to set track asynchronously. Pass nil to deselect selected track.

    Declaration

    Swift

    @available(iOS 15.0, tvOS 15.0, *)
    func selectTrack(_ track: MediaTrack?, for trackType: MediaTrackType) async throws