AbstractSession

@interface AbstractSession : NSObject

@property (nonatomic,strong) JSValue *value;
@property (nonatomic,strong) PlayerAdapterHandler *playerAdapter;
@property (nonatomic,strong,nullable) JSValue *adEventsListenerJSValue;
@property (nonatomic,strong,nullable) JSValue *adDataListenerJSValue;
@property (nonatomic,strong,nullable) JSValue *multicastStatusListenerJSValue;

- (id)initWithJSValue:(JSValue *)value;

/**
 * Attach a player to the session to handle analytics
 *
 * <p>Workflow: attachPlayer(...) -> getURL(...) -> session is playing -> stopStreamingSession()</p>
 * <p>Note: call before getURL</p>
 *
 * @param player Player instance
 */
- (void)attachPlayer:(id)player;

/**
 * Attach a player to the session to handle analytics
 *
 * <p>Workflow: attachPlayer(...) -> getURL(...) -> session is playing -> stopStreamingSession()</p>
 * <p>Note: call before getURL</p>
 *
 * @param player Player instance
 * @param listener Listener instance (depending on the player you use)
 */
- (void)attachPlayer:(id)player listener:(nullable id)listener;

/**
 * Set an option for the current session. It does not replace values at the global level.
 *
 * <p>Note: It has to be called before getQuery and getURL.</p>
 *
 * @param option The option to update. The list if available as static constants values in class StreamingSessionOptions.
 * @param value Option value
 */
- (void)setOption:(int)option valueWithBool:(BOOL)value;

/**
 * Set an option for the current session. It does not replace values at the global level.
 *
 * <p>Note: It has to be called before getQuery and getURL.</p>
 *
 * @param option The option to update. The list if available as static constants values in class StreamingSessionOptions.
 * @param value Option value
 */
- (void)setOption:(int)option valueWithInt:(int)value;

/**
 * Set an option for the current session. It does not replace values at the global level.
 *
 * <p>Note: It has to be called before getQuery and getURL.</p>
 *
 * @param option The option to update. The list if available as static constants values in class StreamingSessionOptions.
 * @param value Option value
 */
- (void)setOption:(int)option valueWithString:(NSString *)value;

/**
 * Activate advertising workflow (including analytics and tracking)
 * The method setAdParameter automatically calls this method
 */
- (void)activateAdvertising;

/**
 * This method set a parameter used for the ad insertion
 * Activate the advertising workflow
 * @param name  Parameter name
 * @param value Parameter value
 */
- (void)setAdParameter:(NSString *)name value:(NSString *)value;

/**
 * Set ad view (PAL SDK)
 * @param view view object
 */
- (void)setAdView:(UIView *)view;

/**
 * Trigger an ad user interaction (OMSDK, PAL SDK)
 * @param interactionType see AdInteractionType class to get types
 */
- (void)adUserInteraction:(NSString *)interactionType;

/**
 * Set a custom parameter to be added to the session report
 *
 * <p>Note: Only sent during non-Broadpeak sessions</p>
 *
 * @param name Parameter name
 * @param value Parameter value
 */
- (void)setCustomParameter:(NSString *)name value:(NSString *)value;

/**
 * Set the ad events listener
 * Reset at SmartLib release
 *
 * @param listener Ad events listener
 */
- (void)setAdEventsListener:(nullable id<AdEventsListener>) listener;

/**
 * Set the ad events listener
 *
 * @param listener Ad events listener
 */
- (void)setAdDataListener:(nullable id<AdDataListener>) listener;

/**
 * Return the current ad list
 * It can be called after or inside onAdData event
 * @return list of ad breaks
 */
- (NSArray <AdBreakData *> *)getAdList;

/**
 * Return the current ad
 * @return current ad or nil
 */
- (AdData *)getCurrentAd;

/**
 * Return the current ad break
 * @return current ad break or nil
 */
- (AdBreakData *)getCurrentAdBreak;

/**
 * Return the current position within the content without ads
 * This position can be saved to be restored later through getPositionForPlayback(positionInBookmark)
 * For VOD contents only
 *
 * @return Position in milliseconds in the content without ads
 */
- (long)getPositionForBookmark;

/**
 * Return the position following current ads with the position in the content without ads
 * Can be called after or inside onAdData
 * For VOD contents only
 *
 * @param positionInBookmark position in milliseconds in the content without ad (with the stored value got from the method getPositionForBookmark())
 * @return Position following current ads in milliseconds
 */
- (long)getPositionForPlayback:(long)positionInBookmark;

/**
 * Set the multicast status listener
 * Reset at SmartLib release
 *
 * @param listener Multicast status listener
 */
- (void)setMulticastStatusListener:(nullable id<MulticastStatusListener>) listener;

@end

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) JSValue *value
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) PlayerAdapterHandler *playerAdapter
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) JSValue *adEventsListenerJSValue
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) JSValue *adDataListenerJSValue
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) JSValue *multicastStatusListenerJSValue
  • Undocumented

    Declaration

    Objective-C

    - (id)initWithJSValue:(JSValue *)value;
  • Attach a player to the session to handle analytics

    Workflow: attachPlayer(…) -> getURL(…) -> session is playing -> stopStreamingSession()

    Note: call before getURL

    Declaration

    Objective-C

    - (void)attachPlayer:(nonnull id)player;

    Parameters

    player

    Player instance

  • Attach a player to the session to handle analytics

    Workflow: attachPlayer(…) -> getURL(…) -> session is playing -> stopStreamingSession()

    Note: call before getURL

    Declaration

    Objective-C

    - (void)attachPlayer:(nonnull id)player listener:(nullable id)listener;

    Parameters

    player

    Player instance

    listener

    Listener instance (depending on the player you use)

  • Set an option for the current session. It does not replace values at the global level.

    Note: It has to be called before getQuery and getURL.

    Declaration

    Objective-C

    - (void)setOption:(int)option valueWithBool:(BOOL)value;

    Parameters

    option

    The option to update. The list if available as static constants values in class StreamingSessionOptions.

    value

    Option value

  • Set an option for the current session. It does not replace values at the global level.

    Note: It has to be called before getQuery and getURL.

    Declaration

    Objective-C

    - (void)setOption:(int)option valueWithInt:(int)value;

    Parameters

    option

    The option to update. The list if available as static constants values in class StreamingSessionOptions.

    value

    Option value

  • Set an option for the current session. It does not replace values at the global level.

    Note: It has to be called before getQuery and getURL.

    Declaration

    Objective-C

    - (void)setOption:(int)option valueWithString:(nonnull NSString *)value;

    Parameters

    option

    The option to update. The list if available as static constants values in class StreamingSessionOptions.

    value

    Option value

  • Activate advertising workflow (including analytics and tracking) The method setAdParameter automatically calls this method

    Declaration

    Objective-C

    - (void)activateAdvertising;
  • This method set a parameter used for the ad insertion Activate the advertising workflow

    Declaration

    Objective-C

    - (void)setAdParameter:(nonnull NSString *)name value:(nonnull NSString *)value;

    Parameters

    name

    Parameter name

    value

    Parameter value

  • Set ad view (PAL SDK)

    Declaration

    Objective-C

    - (void)setAdView:(nonnull UIView *)view;

    Parameters

    view

    view object

  • Trigger an ad user interaction (OMSDK, PAL SDK)

    Declaration

    Objective-C

    - (void)adUserInteraction:(nonnull NSString *)interactionType;

    Parameters

    interactionType

    see AdInteractionType class to get types

  • Set a custom parameter to be added to the session report

    Note: Only sent during non-Broadpeak sessions

    Declaration

    Objective-C

    - (void)setCustomParameter:(nonnull NSString *)name
                         value:(nonnull NSString *)value;

    Parameters

    name

    Parameter name

    value

    Parameter value

  • Set the ad events listener Reset at SmartLib release

    Declaration

    Objective-C

    - (void)setAdEventsListener:(nullable id<AdEventsListener>)listener;

    Parameters

    listener

    Ad events listener

  • Set the ad events listener

    Declaration

    Objective-C

    - (void)setAdDataListener:(nullable id<AdDataListener>)listener;

    Parameters

    listener

    Ad events listener

  • Return the current ad list It can be called after or inside onAdData event

    Declaration

    Objective-C

    - (nonnull NSArray<AdBreakData *> *)getAdList;

    Return Value

    list of ad breaks

  • Return the current ad

    Declaration

    Objective-C

    - (nonnull AdData *)getCurrentAd;

    Return Value

    current ad or nil

  • Return the current ad break

    Declaration

    Objective-C

    - (nonnull AdBreakData *)getCurrentAdBreak;

    Return Value

    current ad break or nil

  • Return the current position within the content without ads This position can be saved to be restored later through getPositionForPlayback(positionInBookmark) For VOD contents only

    Declaration

    Objective-C

    - (long)getPositionForBookmark;

    Return Value

    Position in milliseconds in the content without ads

  • Return the position following current ads with the position in the content without ads Can be called after or inside onAdData For VOD contents only

    Declaration

    Objective-C

    - (long)getPositionForPlayback:(long)positionInBookmark;

    Parameters

    positionInBookmark

    position in milliseconds in the content without ad (with the stored value got from the method getPositionForBookmark())

    Return Value

    Position following current ads in milliseconds

  • Set the multicast status listener Reset at SmartLib release

    Declaration

    Objective-C

    - (void)setMulticastStatusListener:(nullable id)listener;

    Parameters

    listener

    Multicast status listener