M3U8Manager

public class M3U8Manager

M3U8Manager is an helper class for fetching and parsing playlists. This class is used for convenience, and its functionality can be mimiced by using the M3U8Parser, PlaylistFetcher and other required params.

  • Fetches and parses a single playlist object. Returns a general playlist cast according to the type you requested.

    Declaration

    Swift

    public func fetchAndParsePlaylist<T: Playlist>(from operationData: PlaylistOperationData, playlistType: T.Type,
                                                   operationHandler: ((PlaylistOperation) -> Void)? = nil,
                                                   completionHandler: @escaping (M3U8Manager.Result<T>) -> Void)

    Parameters

    operationData

    The data params neeeded to make the request.

    playlistType

    The playlist type to to return in the result. used to save extra casting.

    operationHandler

    Handler for making actions on the operation performing the fetch and parse. can be used to cancel the request for example.

    completionHandler

    The completion handler to be called when finished with the result of the operation.

  • Helper method to fetch and parse multiple media playlists

    Declaration

    Swift

    public func fetchAndParseMediaPlaylists(from operationDataList: [PlaylistOperationData],
                                            operationsHandler: (([PlaylistOperation]) -> Void)? = nil,
                                            completionHandler: @escaping (M3U8Manager.Result<[MediaPlaylist]>) -> Void)

    Parameters

    operationDataList

    The data params neeeded to make all the requests.

    operationsHandler

    Handler for making actions on the operations performing the fetch and parse. can be used to cancel a single/multiple request/s for example.

    completionHandler

    The completion handler to be called when finished with the result of the operations.

  • Cancels all the running operations on the manager.

    Declaration

    Swift

    public func cancel()