JWChapterTrackBuilder

@objcMembers
public class JWChapterTrackBuilder : NSObject, JWBuilder

The builder for creating a JWMediaTrack used for chapters.

  • Declaration

    Swift

    public typealias Output = JWChapterTrack
  • Builds a media track based off the settings provided.

    Throws

    throws An error if the track is not setup properly.

    Declaration

    Swift

    public func build() throws -> JWChapterTrack
  • Sets the path to the thumbnail track file.

    Note

    Files must be in WebVTT format.

    Declaration

    Swift

    @discardableResult
    public func file(_ file: URL) -> JWChapterTrackBuilder

    Parameters

    file

    Path to the chapter track file.

    Return Value

    The builder, so setters can be chained.

  • Designates a list of chapters which are skippable.

    Note

    Chapter ids should be unique.

    Declaration

    Swift

    @available(iOS, unavailable)
    @discardableResult
    public func skippableChapters(ids: [String]) -> JWChapterTrackBuilder

    Parameters

    ids

    An array of chapter identifiers as specified in the WebVTT file.

    Return Value

    The builder, so setters can be chained.

  • Sets the number of seconds a skip button is displayed for skippable chapters.

    Note

    If a chapter duration is shorter than the life of the button, the button will not be displayed past the end of the chapter.

    Declaration

    Swift

    @available(iOS, unavailable)
    @discardableResult
    public func skipButtonDuration(seconds: TimeInterval) -> JWChapterTrackBuilder

    Parameters

    seconds

    The number of seconds a skip button will stay on the screen during the chapter.

    Return Value

    The builder, so setters can be chained.