M3U8Parser

public class M3U8Parser

M3U8Parser handles parsing all type of playlists (master/video/audio/subtitles).

The parser can be used multiple times, but make sure to reset the state.

  • Undocumented

    Declaration

    Swift

    public init()
  • M3U8Parser required params

    See more

    Declaration

    Swift

    public struct Params
  • M3U8Parser extra params

    See more

    Declaration

    Swift

    public struct ExtraParams
  • This property is used to cancel the parser.

    Important

    To be able to use this, the parser call must be performed async (parse function is synchronous), otherwise the change will have no effect.

    Declaration

    Swift

    public var isCancelled = false
  • Parse a playlist using the provided params.

    Throws

    malformedPlaylist when missing requred tags in the playlist, and tag errors when there was an issue with parsing a tag.

    Declaration

    Swift

    public func parse(params: M3U8Parser.Params, extraParams: M3U8Parser.ExtraParams? = nil) throws -> ParserResult

    Parameters

    params

    The required params for the parsing.

    extraParams

    Extra params for additional handling.

    Return Value

    Parser result, which can be master/media/cancelled.

  • cancels the parsing by changing isCancelled property to true.

    Declaration

    Swift

    public func cancel()