Classes
The following classes are available globally.
-
SmartLib library
See moreDeclaration
Objective-C
@interface SmartLib : NSObject -
Undocumented
See moreDeclaration
Objective-C
@interface AdBreakData : NSObject /** * Ad break id */ @property (nonatomic,strong) NSString *adBreakId; /** * Start position in millis */ @property (nonatomic,assign) long startPosition; /** * Duration in millis * Includes all ads */ @property (nonatomic,assign) long duration; /** * Ad list */ @property (nonatomic,strong) NSMutableArray<AdData *> *ads; /** * Total ad count * If live content, adCount will be -1 */ @property (nonatomic,assign) int adCount; - (id)initWithJSON:(NSDictionary *)value; @end -
Undocumented
See moreDeclaration
Objective-C
@interface AdData : NSObject /** * Ad index in the ad break */ @property (nonatomic,assign) int index; /* * Ad creative id */ @property (nonatomic,strong) NSString *creativeId; /* * Ad id * If the same ad is played in the content, the id will be the same */ @property (nonatomic,strong) NSString *adId; /* * Start position in millis */ @property (nonatomic,assign) long startPosition; /* * Skip position in millis * 0 if not defined */ @property (nonatomic,assign) long skipPosition; /* * Duration in millis */ @property (nonatomic,assign) long duration; /* * Click URL * Empty string if not defined */ @property (nonatomic,assign) NSString *clickURL; - (id)initWithJSON:(NSDictionary *)value; @end -
Undocumented
See moreDeclaration
Objective-C
@interface AdManager : NSObject + (AdManager *)sharedManager; /** * Get ad manager version * @return ad manager version */ - (NSString*)getVersion; /** * Set Google consent settings * It has to be set before PAL parameters * @param consentSettings consent settings, please refer to the Google PAL documentation */ - (void)setConsentSettings:(NSObject *)consentSettings; /** * Set Google PAL parameters * * @param descriptionURL Google PAL parameter, set nil if not used * @param partnerName Google PAL parameter, set nil if not used * @param partnerVersion Google PAL parameter, set nil if not used * @param omidVersion Google PAL parameter, set nil if not used * @param playerType Google PAL parameter, set nil if not used * @param playerVersion Google PAL parameter, set nil if not used * @param ppid Google PAL parameter, set nil if not used * @param videoPlayerHeight Google PAL parameter, set 0 if not used * @param videoPlayerWidth Google PAL parameter, set 0 if not used * @param willAdAutoPlay Google PAL parameter, set false if not used * @param willAdPlayMuted Google PAL parameter, set false if not used */ - (void)setPalParameters:(NSString *)descriptionURL partnerName:(NSString *)partnerName partnerVersion:(NSString *)partnerVersion omidVersion:(NSString *)omidVersion playerType:(NSString *)playerType playerVersion:(NSString *)playerVersion ppid:(NSString *)ppid videoPlayerHeight:(NSUInteger)videoPlayerHeight videoPlayerWidth:(NSUInteger)videoPlayerWidth willAdAutoPlay:(BOOL)willAdAutoPlay willAdPlayMuted:(BOOL)willAdPlayMuted; /** * 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 the ad events listener * Reset at SmartLib release * * @param listener Ad events listener */ - (void)setAdEventsListener:(nullable id<AdEventsListener>) listener; @end -
Undocumented
See moreDeclaration
Objective-C
@interface LoggerManager : NSObject @property (nonatomic,assign) BPLogLevel logLevel; /** * Log redirect listener * Change the default output the log * If set, SmartLib stops printing to the default output and only use the log redirect listener */ @property (nonatomic,weak) id<LogRedirectListener> logRedirectListener; + (LoggerManager *)sharedManager; - (void)printLogs:(int)level tag:(NSString *)tag logs:(NSString*)logs; - (void)printVerboseLogs:(NSString *)tag logs:(NSString*)logs; - (void)printDebugLogs:(NSString *)tag logs:(NSString*)logs; - (void)printInfoLogs:(NSString *)tag logs:(NSString*)logs; - (void)printWarnLogs:(NSString *)tag logs:(NSString*)logs; - (void)printErrorLogs:(NSString *)tag logs:(NSString*)logs; - (void)setLogLevel:(BPLogLevel)logLevel; - (LoggerHandler *)getLoggerHandler; @end -
Undocumented
Declaration
Objective-C
@interface GenericPlayerAdapter : PlayerAdapterHandler @end -
Undocumented
See moreDeclaration
Objective-C
@interface GenericPlayerApi : NSObject <GenericPlayerApi> - (void)setPlayerAdapter:(PlayerAdapterHandler *)playerAdapterHandler; - (void)notifyFirstImage; - (void)notifyPause; - (void)notifyResume; - (void)notifyLayerSwitch:(int)bitrate; - (void)notifyStallStart; - (void)notifyStallEnd:(BOOL)playing; - (void)notifySeek:(double)start end:(double)end; - (void)setPlayerErrorCode:(NSString *)playerErrorCode; @end -
Event listener for SmartLib Generic
See moreDeclaration
Objective-C
@interface GenericPlayerEventListenerClass : NSObject -
Undocumented
See moreDeclaration
Objective-C
@interface PlayerAdapterHandler : NSObject @property (nonatomic,strong) JSValue *jsValue; - (id)initWithRuntime:(JSContext *)runtime; - (NSString *)getName; - (NSString *)getVersion; - (int)getBitrate; - (double)getPosition; - (double)getDuration; - (JSValue *)getCapabilities; - (void)notifyLoading; - (void)notifyFirstImage; - (void)notifyPause; - (void)notifyResume; - (void)notifyLayerSwitch:(int)bitrate; - (void)notifySeek:(double)start end:(double)end; - (void)notifyStallStart; - (void)notifyStallEnd:(BOOL)playing; - (void)notifyClose; - (void)setStatusCode:(int)statusCode; - (void)setPlayerErrorCode:(NSString *)playerErrorCode; - (void)setCustomParameter:(NSString *)name value:(NSString *)value; - (BOOL)isStarted; - (BOOL)isPlaying; - (BOOL)isBuffering; - (double)getDeviceInitDate; - (double)getManifestInitDate; - (BOOL)checkPlayer:(NSObject *)player listener:(NSObject *)listener; - (BOOL)attachPlayer:(NSObject *)player listener:(NSObject *)listener; - (void)detachPlayer; - (void)initSessionPlayerObjects; - (void)releaseSessionPlayerObjects; @end -
Undocumented
See moreDeclaration
Objective-C
@interface RealTimeMonitoringManager : NSObject + (RealTimeMonitoringManager *)sharedManager; - (void)initMonitoring:(NSString *)address; // - (void)releaseMonitoring; @end -
Undocumented
Declaration
Objective-C
@interface AnalyticsSession : AbstractSession @end -
Undocumented
See moreDeclaration
Objective-C
@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 -
Once a session has been created, all next calls have to be done on that object. The “getURL” way will also use the StreamingSession API internally with the actual “one session at a time” limitation (i.e only 1 StreamingSession object stored).
See moreDeclaration
Objective-C
@interface StreamingSession : AbstractSession -
Global level options can be set with SmartLib.setOption(option, value). All global level options can be override at the session level. Options can be set on a session with session.setOption(option, value). All options have a default values, no extra configuration is required by the app.
See moreDeclaration
Objective-C
@interface StreamingSessionOptions : NSObject -
Undocumented
See moreDeclaration
Objective-C
@interface StreamingSessionResult : NSObject - (id)initWithJSValue:(JSValue *)value; /** * Get the final streaming URL. Empty string if an error occurred, use getErrorCode() and getErrorMessage() for more details. * @return Streaming URL */ - (NSString *)getURL; /** * Get the list of fallback URLs. * Diversity * @return URL list */ - (NSArray *)getFallbackURLList; /** * Session request ended with an error code * @return True if the request ended with an error code */ - (BOOL)isError; /** * Get the error status code if an error occurred during the session creation. 0 if no error. * @return Error code */ - (int)getErrorCode; /** * Get the error message if an error occurred during the session creation. empty if no error. * @return Error message */ - (NSString *)getErrorMessage; /** * Get the detailed error code if an error occurred during the session creation. 0 if no detail associated to the error or no error. * @return Detailed error code */ - (int)getDetailedErrorCode; /** * Get the detailed error message if an error occurred during the session creation. empty string if no detail associated to the error or no error. * @return Detailed error message */ - (NSString *)getDetailedErrorMessage; /** * Is the session started on a nanoCDN * @return true if a nanoCDN is used */ - (BOOL)isNanoCDNUsed; @end
Install in Dash
Classes Reference