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.
  • 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.