JWTrack

@interface JWTrack : NSObject

An object providing info about captions. Supports DFXP (TTML), SRT, WebVTT formats.

Accessing Captions Track Attributes

  • Path to the captions file.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull file;
  • Label to be shown in the player in captions popup.

    Note

    not shown if only 1 captions track provided.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull label;
  • String representing kind of track.

    Note

    only ‘captions’ currently supported.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *kind;
  • If set to yes the player shows this captions track upon launch.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL defaultTrack;

Creating Captions Track Object

  • Factory method that creates JWTrack object with provided file and label.

    Declaration

    Objective-C

    + (nonnull instancetype)trackWithFile:(nonnull NSString *)file
                                    label:(nonnull NSString *)label;

    Parameters

    file

    Path to the captions file.

    label

    Label to be shown in the player in captions popup.

  • Factory method that creates JWTrack object with provided file and label and sets current captions track as default.

    Declaration

    Objective-C

    + (nonnull instancetype)trackWithFile:(nonnull NSString *)file
                                    label:(nonnull NSString *)label
                                isDefault:(BOOL)def;

    Parameters

    file

    Path to the captions file.

    label

    Label to be shown in the player in captions popup.

    def

    If set to yes the player shows this captions track upon launch.

Initializing Captions Track Object

  • Inits JWTrack object with provided file and label.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithFile:(nonnull NSString *)file
                                   label:(nonnull NSString *)label;

    Parameters

    file

    Path to the captions file.

    label

    Label to be shown in the player in captions popup.

  • Inits JWTrack object with provided file and label and sets current captions track as default.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithFile:(nonnull NSString *)file
                                   label:(nonnull NSString *)label
                               isDefault:(BOOL)def;

    Parameters

    file

    Path to the captions file.

    label

    Label to be shown in the player in captions popup.

    def

    If set to yes the player shows this captions track upon launch.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;