TypedSource

@objc(THEOplayerTypedSource)
public class TypedSource : NSObject, Codable

The TypedSource object provides the following properties:

Remark

  • This represents a media resource characterized by a URL to the resource and optionally information about the resource.
  • This optional information can be DRM parameters for that specific source.
  • src

    The ‘src’ property represents the source URL of the manifest or video file to be played.

    Declaration

    Swift

    @objc
    public var src: URL
  • Specifies the content type (MIME type) of source being played.

    Remark

    • 'application/x-mpegURL' or 'application/vnd.apple.mpegurl' indicates HLS.
    • 'video/mp4' indicates MP4.
    • 'audio/mp3' indicates MP3.

    Declaration

    Swift

    @objc
    public var type: String
  • drm

    This optional property can be used to specify required DRM parameters for a playback source.

    Remark

    Information like the license acquisition URL, request headers and other vendor-specific parameters are wrapped in an object implementing the DRMConfiguration protocol.

    Declaration

    Swift

    public var drm: DRMConfiguration?
  • This optional property can be used to specify CORS parameters.

    Declaration

    Swift

    public var crossOrigin: CrossOrigin?
  • Parse / Expose date ranges from HLS manifest.

    Declaration

    Swift

    public var hlsDateRange: Bool?
  • This optional property can be used to specify required Server-Side Ad Insertion parameters for a playback source.

    Remark

    Parameters used to configure the player to optimally play streams with server-inserted ads from specific SSAI vendors are wrapped in an object implementing the ServerSideAdInsertionConfiguration protocol.

    Declaration

    Swift

    @objc
    public var ssai: ServerSideAdInsertionConfiguration?
  • The HTTP request headers associated with the source. These headers are passed to every HTTP request that the player will make which include: master playlist, media playlist and segment requests.

    Declaration

    Swift

    public var headers: [String : String]?
  • Constructs a TypedSource.

    Declaration

    Swift

    public init(src: String, type: String, drm: DRMConfiguration? = nil, crossOrigin: CrossOrigin? = nil, ssai: ServerSideAdInsertionConfiguration? = nil, hlsDateRange: Bool? = nil, headers: [String : String]? = nil)

    Parameters

    src

    The source URL.

    type

    The content type (MIME type) of the source, defaults to nil.

    drm

    The optional DRM configuration, defaults to nil.

    crossOrigin

    The CORS policy to be used, defaults to nil.

    ssai

    The Server-side ad insertion configuration, defaults to nil.

    hlsDateRange

    Wheter to parse/expose the date ranges from the HLS manifest, defaults to nil.

    headers

    The HTTP request headers associated with the source.