Type Aliases

The following type aliases are available globally.

  • A dictionary matching the JSON standard.

    Declaration

    Swift

    public typealias JSONObject = [String : Any]
  • An array matching the JSON standard on JSON arrays.

    Declaration

    Swift

    public typealias JSONArray = [Any]
  • A closure used by the JWPlayerPlaylistItemCallback to return a JWPlayerItem object.

    Declaration

    Swift

    public typealias JWPlayerItemCompletion = (JWPlayerItem?) -> ()
  • A closure used by the JWPlayerProtocol.setPlaylistItemCallback(:) API to notify developers about playlist progression.

    if shouldModifyPlayerItem {
      // Returning a modified item the player will reflect any change in the item.
       completion(modifiedItem)
    } else if shouldSkipPlayerItem {
       // Returning nil the player will skip the next item in the playlist.
       completion(nil)
    } else {
       // Returning the same item the player will continue with the media playback.
       completion(item)
    }
    

    Declaration

    Swift

    public typealias JWPlayerPlaylistItemCallback = (_ item: JWPlayerItem, _ index: Int, _ completion: @escaping JWPlayerItemCompletion) -> Void

    Parameters

    item

    The next item in the playlist.

    index

    The index of the next item.

    completion

    A closure block used to notify the player about any change with the next item.