JWConfig

@interface JWConfig : NSObject

Configuration object used to create JW Player instance.

  • Video URL to play using JW Player.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *file;
  • An array of JWSource objects representing multiple quality levels of a video.

    See

    JWSource

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSArray<JWSource *> *sources;
  • An array of JWPlaylistItem objects containing information about different video items to be reproduced in a sequence.

    See

    JWPlaylistItem

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable)
        NSArray<JWPlaylistItem *> *playlist;
  • Item within a playlist to start playback. @discussion Within the playlist, the first index is 0. If the playlistIndex value is negative, the index starts counting from the end of the playlist. @warning A negative value cannot exceed the absolute number of playlist items. For example, in a playlist of 5 items, playlistIndex: -5 is the lowest acceptable negative number.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSInteger playlistIndex;
  • Title (or name) of the video

    Note

    Shown in the play button container in the center of the screen, before the video starts to play, in addition to the device lock screen and in the multimedia controls in the multitasking UI. It will also be used in other relevant setups, such as when connecting to an Apple TV via AirPlay, or to an iPod accessory.

    Note

    If nil, the app name will be set as the title by default.

    Warning

    Trying to set the title directly via MPNowPlayingInfoCenter[MPMediaItemPropertyTitle] can lead to unpredictable behavior.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *title;
  • The URL of the thumbnail image.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *image;
  • A description of your video or audio item.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *desc;
  • Unique identifier of this item. Used by advertising, analytics and discovery services

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *mediaId;
  • An array of JWTrack objects providing captions for different languages or thumbnails images.

    See

    JWTrack

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSArray<JWTrack *> *tracks;
  • A dictionary containing asset initialization options.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        NSDictionary *assetOptions;
  • The image you wish to display if the user gets disconnected from the internet. If this is nil, your thumbnail image will be displayed.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) UIImage *offlinePoster;
  • The message you wish to display if the user gets disconnected from the internet. If this is nil, Internet Lost will be displayed.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSString *offlineMessage;
  • Player view size.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) CGSize size;
  • Configures when the Next Up card displays during playback. Defaults to -10.

    Note

    A positive value is an offset from the start of the video. A negative number is an offset from the end of the video

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSInteger nextupOffset;
  • Configures when the Next Up card displays during playback, based on the percentage of the duration.

    Note

    A positive value is a percentage offset from the start of the video. A negative number is a percentage offset from the end of the video

    Note

    i.e. setting the value to 50 will result in the Next Up card showing when half of the video is played. Setting the value to -25 will result in the Next Up card showing when playback reaches 75% of the video duration.

    Note

    takes precedence over nextupOffset if both properties are set.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSInteger nextupOffsetPercentage;
  • Set to false to disable the “Next Up” tooltip. Defaults to true.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL nextUpDisplay;
  • Array of metadata that can be passed externally to supplement the encoded metadata of the underlying media asset. @discussion Applies to all playlist items that do not specify their own externalMetadata.

    Note

    Capped at 5 metadata instances; the instances in excess will be excluded.

    See

    JWExternalMetadata

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite, nullable)
        NSArray<JWExternalMetadata *> *externalMetadata;
  • adConfig object providing info about ad handling.

    See

    JWAdConfig

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) JWAdConfig *advertising;
  • Config object containing related settings.

    See

    JWRelatedConfig

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        JWRelatedConfig *related;
  • A boolean value that determines whether player controls are shown.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL controls;
  • A boolean value that determines whether video should repeat after it’s done playing.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL repeat;
  • Configures if the title of a media file should be displayed. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL displayTitle;
  • Configures if the description title of a media file should be displayed. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        BOOL displayDescription;
  • A boolean value that determines whether video should start automatically after loading.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL autostart;
  • Tells the player if content should be loaded prior to playback. Defaults to JWPreloadAuto.

    Note

    JWPreloadAuto — Loads the manifest before playback is requested. Default value.

    Note

    JWPreloadNone — Player will explicitly not preload content. (Recommended if you are concerned about excess content usage.)

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) JWPreload preload;
  • Enables the display of a settings menu to adjust the playback speed. Defaults to NO.

    Note

    When set to YES, the pre-defined options available in the menu are 0.5x, 1x, 1.25x, 1.5x, and 2x.

    Note

    Use the playbackRates array to customize the menu options.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        BOOL playbackRateControls;
  • Custom playback rate options to display in the settings menu.

    Note

    Only accepts value in the 0.0 to 4.0 range.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable)
        NSArray<NSNumber *> *playbackRates;
  • Provides an option to stretch the video.

    Note

    JWStretchingUniform (default) - Will fit JW Player dimensions while maintaining original aspect ratio (Black bars)

    Note

    JWStretchingExactFit - Will fit JW Player dimensions without maintaining aspect ratio

    Note

    JWStretchingFill - Will stretch and zoom video to fill dimensions, while maintaining aspect ratio

    Note

    JWStretchingNone - Displays the actual size of the video file. (Black borders)

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        JWStretching stretching;
  • Sets the maximum bitrate that can be reached during automatic quality switching.

    Note

    If network bandwidth usage cannot be reduced to meet the bitRateUpperBound, it will be lowered as much as possible while continuing playback.

    Note

    Useful in limiting bandwidth consumption for viewers.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        CGFloat bitRateUpperBound;
  • The customization options for the player’s skin.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) JWSkinStyling *skin;
  • The configuration options for a clickable watermark that is overlayed on the video.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) JWLogo *logo;
  • Configuration object used to customize the captions.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) JWCaptionStyling *captions;
  • Prevents the JW Player SDK from overriding application level audio settings. Defaults to true.

    Note

    setting to false will break AirPlay and background playback.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        BOOL audioSwitchingEnabled;
  • Inits a JWConfig object with provided video url.

    Declaration

    Objective-C

    + (nonnull instancetype)configWithContentURL:(nonnull NSString *)contentUrl;

    Parameters

    contentUrl

    URL of the video content.

  • Factory method that creates a JWConfig object with url of video content.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithContentUrl:(nonnull NSString *)contentUrl;

    Parameters

    contentUrl

    URL of the video content.