Protocols

The following protocols are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISAdAnalyticsProtocol <CISStreamAnalyticsProtocol>
    
    /**
    * Sets ad info.
    * @param adInfo ad related info.
    */
    - (void) setAdInfo:(NSDictionary*)adInfo;
    
    /**
    * Sets Ad PlayerInfo.
    * @param adPlayerInfo ad player info.
    */
    - (void) setAdPlayerInfo:(NSDictionary*)adPlayerInfo;
    
    /**
    * Reports ad failure.
    * @param errorMessage error message.
    * @param adInfo ad related info.
    */
    - (void) reportAdFailed:(NSString*)errorMessage adInfo:(nullable NSDictionary*)adInfo;
    
    /**
    * Reports ad load event.
    * @param adInfo ad related info.
    */
    - (void) reportAdLoaded:(nullable NSDictionary*)adInfo;
    
    /**
    * Reports ad start event.
    * @param adInfo ad related info.
    */
    - (void) reportAdStarted:(nullable NSDictionary*)adInfo;
    
    /**
    * Reports ad end event.
    */
    - (void) reportAdEnded;
    
    /**
    * Reports ad error event.
    * @param errorMessage Error message.
    * @param severity Severity of the error.
    */
    - (void) reportAdError:(NSString*)errorMessage severity:(ErrorSeverity)severity;
    
    /**
    * Reports ad skip event.
    */
    - (void) reportAdSkipped;
    
    /**
    * Reports ad player event.
    * @param eventType Event type.
    * @param details Event details.
    */
    - (void) reportAdPlayerEvent:(NSString*)eventType details:(nullable NSDictionary*)details;
    
    /**
    * Reports ad metirc.
    * @param key Metric key.
    * @param value Metric value.
    */
    - (void) reportAdMetric:(NSString*)key value:(id)value;
    
    /**
    * Used to set content session id.If already customer integrated EI using legacy api and wanted to integrate AI or other products using this sdk shall use this.
    * @param sessionID Video playback session id.
    */
    - (void) setContentSessionID:(int)sessionID;
    
    @end

    Swift

    protocol CISAdAnalyticsProtocol : CISStreamAnalyticsProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISAnalyticsProtocol <NSObject>
    
    /**
    * Returns client id.
    * @return clientid.
    */
    - (NSString*) getClientId;
    
    /**
    * Creates video analytics objects.
    * @return CISVideoAnalytics instance.
    */
    - (CISVideoAnalytics) createVideoAnalytics;
    
    /**
    * Applicable only incase of  Conviva Module case. Creates video analytics objects.
    * @param options Refer USER OPTIONS section defined in CSSConstants.h
    * @return CISVideoAnalytics instance.
    */
    - (CISVideoAnalytics) createVideoAnalytics:(NSDictionary*)options;
    
    /**
    * Creates ad analytics objects.
    * @return CISAdAnalytics instance.
    */
    - (CISAdAnalytics) createAdAnalytics;
    
    /**
    * Creates ad analytics object by linking already created video analytics object.
    * @param videoAnalytics Video analytcis object.
    * @return CISAdAnalytics instance.
    */
    - (CISAdAnalytics) createAdAnalyticsWithVideoAnalytics:(CISVideoAnalytics) videoAnalytics;
    
    /**
    * Reports app level event.
    * @param event Event name.
    * @param details Event details.
    */
    - (void) reportAppEvent:(NSString*)event details:(NSDictionary*)details;
    
    /**
    * Reports app background event useful to initiate cleanup.
    */
    - (void) reportAppBackgrounded;
    
    /**
    * Reports app forground event useful to resume the analytics session.
    */
    - (void) reportAppForegrounded;
    
    /**
    * @brief Set user preferences for data collection.
    * @param userPrefs pass key value pair as user preferences.
    * Currently Supported keys: "idfa", "idfv".
    * Expected Values:
    * YES - Will collect id for mentioned key.
    * NO - Will stop collecting id for mentioned key.
    * Sample Usage:
    * [clientSettings setUserPreferenceForDataCollection:[NSDictionary dictionaryWithObjectsAndKeys: @YES, @"idfa", @NO, @"idfv", nil]];
    */
    - (void) setUserPrefsForDataCollection:(NSDictionary *)userPrefs;
    
    /**
     * @brief Set user preferences for data collection.
     * @param userPrefs pass key value pair as user preferences.
     * Currently Supported keys: "idfa", "idfv".
     * Expected Values:
     * YES - Will stop collecting id for mentioned key and delete previously collected data.
     * NO - Will not have any effect.
     * Sample Usage:
     * [clientSettings setUserPreferenceForDataDeletion:[NSDictionary dictionaryWithObjectsAndKeys: @NO, @"idfa", @YES, @"idfv", nil]];
    */
    - (void) setUserPrefsForDataDeletion:(NSDictionary *)userPrefs;
    
    /**
    * Performs required cleanup.
    */
    - (void) cleanup;
    
    @end

    Swift

    protocol CISAnalyticsProtocol : NSObjectProtocol
  • Callback interface used by SystemInterface implementation to notify Conviva.

    See more

    Declaration

    Objective-C

    @protocol CISCallbackProtocol

    Swift

    protocol CISCallbackProtocol
  • Includes CISCallbackProtocol & CISRunnableProtocol platform classes where its instance is passed may need to call Run or Done methods of CISCallbackProtocol or CISRunnableProtocol

    Declaration

    Objective-C

    @protocol
        CISCallback_RunnableProtocol <CISCallbackProtocol, CISRunnableProtocol>

    Swift

    protocol CISCallback_RunnableProtocol : CISCallbackProtocol, CISRunnableProtocol
  • A protocol that can be used to cancel the actions.

    See more

    Declaration

    Objective-C

    @protocol CISCancelProtocol

    Swift

    protocol CISCancelProtocol
  • An instance of a client. The class conforming to this protocol manages the SDK lifecycle and video sessions.
    Generally, in an application, a single instance of class conforming to this protocol is required.
    The class instance conforming to this protocol can be used to manage, create PlayerStateManager sessions and perform other important tasks.

    See more

    Declaration

    Objective-C

    @protocol CISClientProtocol <NSObject>

    Swift

    protocol CISClientProtocol : NSObjectProtocol
  • Settings for the client instance. This class handles setting for client required parameters Customer Key, Heartbeat Interval & Gateway URL.
    The instance of this class is created while creating an instance of class conforming to CISClientSettingProtocol.

    See more

    Declaration

    Objective-C

    @protocol CISClientSettingProtocol <NSObject>

    Swift

    protocol CISClientSettingProtocol : NSObjectProtocol
  • Class conforming to this will be responsible for implementing required methods for HTTP(s) tasks, this is used by the Conviva library to make HTTP(S) requests.

    See more

    Declaration

    Objective-C

    @protocol CISHTTPProtocol <NSObject>

    Swift

    protocol CISHTTPProtocol : NSObjectProtocol
  • Reports player related metrics required by Conviva SDK.
    Class conforming to this protocol needs to implement required methods for SDK to fetch information.
    Generally, the player interface class will conform to this protocol.

    See more

    Declaration

    Objective-C

    @protocol CISIClientMeasureInterface <NSObject>

    Swift

    protocol CISIClientMeasureInterface : NSObjectProtocol
  • Required to set the name and version of a client module.

    See more

    Declaration

    Objective-C

    @protocol CISIModuleVersion <NSObject>

    Swift

    protocol CISIModuleVersion : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISLoggerProtocol <NSObject>
    @required
    /**
     * Associates a module name with this Logger.
     * @param moduleName The module name to use for this logger.
     */
    -(void)setModuleName:(NSString *)moduleName;
    
    /**
     * Associates a session ID with this Logger.
     * @param sessionId The session ID to use for this logger.
     */
    -(void)setSessionId:(int)sessionId;
    
    /**
    * Logs a message to the console at func level.
    * @param message The message to log at func level.
    */
    -(void)func:(NSString *)message;
    
    /**
     * Logs a message to the console at DEBUG level.
     * @param message The message to log at DEBUG level.
     */
    -(void)debug:(NSString *)message;
    
    /**
     * Logs a message to the console at INFO level.
     * @param message The message to log at INFO level.
     */
    -(void)info:(NSString *)message;
    
    /**
     * Logs a message to the console at WARNING level.
     * @param message The message to log at WARNING level.
     */
    -(void)warning:(NSString *)message;
    
    /**
     * Logs a message to the console at ERROR level.
     * @param message The message to log at ERROR level.
     */
    -(void)error:(NSString *)message;
    
    @optional
    /*
     * Used only for for debugging when we want to log to console
     * but not log to buffer
     * @praram  NSString logger message
     * @param LogLevel Log level
     */
    -(void)consoleLog:(NSString *)message logLevel:(LogLevel)LogLevel;
    
    @end

    Swift

    protocol CISLoggerProtocol : NSObjectProtocol
  • Class conforming to this will be responsible for implementing required methods for logging, this is used by the Conviva library to log.

    See more

    Declaration

    Objective-C

    @protocol CISLoggingProtocol <NSObject>

    Swift

    protocol CISLoggingProtocol : NSObjectProtocol
  • Class conforming to this will be responsible for implementing required methods for system information, this is used by the Conviva library to gather system information.

    See more

    Declaration

    Objective-C

    @protocol CISMetadataProtocol <NSObject>

    Swift

    protocol CISMetadataProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISPlayerEventsListenerProtocol <NSObject>
    
    /// @brief Signal a change in the bitrate, resource or CDN
    ///
    /// \param bitrateKbps New bitrate
    /// \param cdn New CDN
    /// \param resource New resource
    /// \note Use -1 or null to keep previous value
    - (void)setStream:(int)bitrateKbps cdn:(nullable NSString *)cdn resource:(nullable NSString *)resource;
    
    /// @brief Signal change in average bitrate
    ///
    /// \param avgbitrateKbps New bitrate
    - (void)setAverageBitrate:(int)avgbitrateKbps;
    
    
    /// @brief Signal change in playing state
    ///
    /// \param newState the new playing state (one of the constants in PlayerStates)
    - (void)setPlayingState:(int)newState;
    
    /// @brief Signal an error
    ///
    /// \param err Error Message
    //- (void)onError:(ConvivaStreamerError *)err;
    
    - (void)onError:(NSString *)errMsg fatal:(BOOL)fatal;
    
    /// @brief Signal an error
    ///
    /// \param videoWidth Video Width
    /// \param videoHeight Video Height
    - (void)setVideoDimensionChages:(NSInteger)videoWidth videoHeight:(NSInteger)videoHeight;
    
    /// @brief Signal an player seeking
    -(BOOL)isPlayerSeeking;
    
    //-(void)setSeekEvent:(SeekActionType)type seekPosition:(NSInteger)seekToPosition;
    
    -(void)setSeekStart:(NSInteger)seekToPosition;
    
    -(void)setSeekStop:(NSInteger)seekToPosition;
    
    /// @brief sets the module version
    ///
    /// \param moduleVersion module version
    -(void)setModuleVersion:(NSString*)moduleVersion;
    
    /// @brief sets the module name
    ///
    /// \param moduleName module version
    -(void)setModuleName:(NSString*)moduleName;
    
    /// @brief sets the framework name
    ///
    /// \param fwName module version
    -(void)setFrameworkName:(NSString*)fwName;
    
    /// @brief  sets the framework version
    ///
    /// \param fwVersion module version
    -(void)setFrameworkVersion:(NSString*)fwVersion;
    
    /// @brief  sets the streamUrl
    ///
    /// \param streamUrl Stream url
    -(void)setStreamUrl:(NSString*)streamUrl;
    
    /// @brief  sets the content length
    ///
    /// \param contentLength length
    -(void)setContentLength:(NSInteger)contentLength;
    
    /// @brief  sets the cdn ip
    ///
    /// \param cdnIp cdn ip address
    -(void)setCdnIp:(NSString*)cdnIp;
    
    /// @brief Sets play head time
    ///
    /// \param pht Play head time
    - (void)setPHT:(int64_t)pht;
    
    /// @brief Sets buffer length
    ///
    /// \param bl Buffer length
    - (void)setBufferLength:(int64_t)bl;
    
    /// @brief Sets average frame rate
    ///
    /// \param fps Average frame rate.
    - (void)setAverageFrameRate:(int)fps;
    
    /// @brief Sets encoded frame rate
    ///
    /// \param fps Encoded frame rate.
    - (void)setEncodedFrameRate:(int)fps;
    
    /// @brief Tells whether simplified sdk/legacy sdk api's used.
    ///
    - (BOOL) isSimplifiedSDKApiUsed;
    @end

    Swift

    protocol CISPlayerEventsListenerProtocol : NSObjectProtocol
  • Helper class to store and relay pertinent video player data to Conviva. Lifecycle is tied to an instance of the video player.
    Collects/Reports player’s data to SDK.
    The lifecycle of the class conforming to this protocol is managed by application client instance.

    See more

    Declaration

    Objective-C

    @protocol CISPlayerStateManagerProtocol <NSObject>

    Swift

    protocol CISPlayerStateManagerProtocol : NSObjectProtocol
  • Used by the Conviva library to run timer action.

    See more

    Declaration

    Objective-C

    @protocol CISRunnableProtocol

    Swift

    protocol CISRunnableProtocol
  • Class conforming to this will be responsible for implementing required methods for storing data, this is used by the Conviva library to store required data.The underlying storage technology must be reliable and data must be persisted for as long as possible.

    See more

    Declaration

    Objective-C

    @protocol CISStorageProtocol <NSObject>

    Swift

    protocol CISStorageProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISStreamAnalyticsProtocol <NSObject>
    
    /**
    *  Reports player state. Please refer PlayerState for possible values.
    *  @param playerState Player state.
    */
    - (void) reportPlayerState:(PlayerState)playerState;
    
    /**
    * Returns session id.
    * @return session id.
    */
    - (int) getSessionId;
    
    /**
    * Reports playback metric.
    * @param key Metric key.Please refer "PLAYBACK METRIC KEYS" section defined in CSSConstants.h for all possible keys.
    * @param value Metric value.
    */
    - (void) reportPlaybackMetric:(NSString*)key value:(nullable id)value;
    
    /**
    * Update Handler callback function.
    */
    typedef void (^UpdateHandler)(void);
    
    /**
    * Sets update handler callback function.
    * @param updateHandler UpdateHandler callback function.
    */
    - (void) setUpdateHandler:(UpdateHandler)updateHandler;
    
    /**
    * Tells whether this is ad analytics interface or not.
    * @return TRUE or FALSE.
    */
    - (BOOL) isAdAnalytics;
    
    /**
    * Tells whether this is video analytics interface or not.
    * @return TRUE or FALSE.
    */
    - (BOOL) isVideoAnalytics;
    
    /**
    * Performs required cleanup.
    */
    - (void) cleanup;
    
    @end

    Swift

    protocol CISStreamAnalyticsProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISStreamerProxyFactoryProtocol <NSObject>
    
    @optional
    - (CISStreamerProxy)createStreamerProxy:(id)streamer
                       playerEventsListener:(CISPlayerEventsListener)playerEventsListener
                                     logger:(id<CISLoggerProtocol>)logger;
    
    - (CISStreamerProxy)createStreamerProxy:(CISPlayerEventsListener)playerEventsListener
                                     logger:(id<CISLoggerProtocol>)logger;
    
    @end

    Swift

    protocol CISStreamerProxyFactoryProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISStreamerProxyProtocol <NSObject>
    
    - (void) cleanup;
    
    @end

    Swift

    protocol CISStreamerProxyProtocol : NSObjectProtocol
  • Provides access to system information and utilities according to chosen settings.
    Class conforming to this protocol manages the instance of all the required helper classes
    which were created with class conforming to CISSystemInterfaceProtocol.

    Declaration

    Objective-C

    @protocol CISSystemFactoryProtocol <NSObject>

    Swift

    protocol CISSystemFactoryProtocol : NSObjectProtocol
  • Used by the Conviva library to access system information and utilities.
    This class contains instance of classes implementing CISHTTPProtocol, CISTimeProtocol, CISTimerProtocol, CISLoggingProtocol,
    CISMetadataProtocol, CISStorageProtocol protocols required by the Conviva iOS SDK.

    Declaration

    Objective-C

    @protocol CISSystemInterfaceProtocol <NSObject>

    Swift

    protocol CISSystemInterfaceProtocol : NSObjectProtocol
  • Class conforming to this will be responsible for implementing required methods for a fetching time,
    this is used by the Conviva library to query time.

    See more

    Declaration

    Objective-C

    @protocol CISTimeProtocol <NSObject>

    Swift

    protocol CISTimeProtocol : NSObjectProtocol
  • Class conforming to this will be responsible for implementing required methods for initiating timers, this is used by the Conviva library access system timers.

    See more

    Declaration

    Objective-C

    @protocol CISTimerProtocol <NSObject>

    Swift

    protocol CISTimerProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol CISVideoAnalyticsProtocol <CISStreamAnalyticsProtocol>
    
    /**
     * Set content metadata for an existing monitoring session.
     * @param contentInfo Content meta data. Please refer "METADATA CONSTANTS" section defined in CSSConstants.h for possible keys.
     */
    - (void) setContentInfo:(NSDictionary*)contentInfo;
    
    /**
    * Set player metadata for an existing monitoring session.
    * @param playerInfo Content meta data.Please refer "PLAYER INFO CONSTANTS" section defined in CSSConstants.h for possible keys.
    */
    - (void) setPlayerInfo:(NSDictionary*)playerInfo;
    
    /**
    * Reports playback start.
    * @param contentInfo Content meta data.Please refer "METADATA CONSTANTS" section defined in CSSConstants.h for possible keys.
    */
    - (void) reportPlaybackRequested:(nullable NSDictionary*)contentInfo;
    
    /**
    * Reports playback end.
    */
    - (void) reportPlaybackEnded;
    
    /**
    * Reports playback faiulure.
    * @param errorMessage Error message.
    * @param contentInfo Content meta data.Please refer "METADATA CONSTANTS" section defined in CSSConstants.h for possible keys.
    */
    - (void) reportPlaybackFailed:(NSString*)errorMessage contentInfo:(nullable NSDictionary*)contentInfo;
    
    /**
     * Reports an error for this monitoring session.
     * @param errorMessage The error message to be reported.
     * @param severity The severity of the error.
     */
    - (void) reportPlaybackError:(NSString*)errorMessage errorSeverity:(ErrorSeverity)severity;
    
    /**
     * Send a playback event to Conviva.
     * @param eventName Name of the custom event.
     * @param attributes A dictionary of key-value pairs associated with the event.
     */
    - (void) reportPlaybackEvent:(NSString*)eventName withAttributes:(nullable NSDictionary*)attributes;
    
    /**
     * Notify Conviva that an ad is about to start for the monitoring session.
     * @param adPlayer Whether the ad is played by the same player as the original video content.
     * @param adType Whether the ad is embedded in the content stream.
     * @param adBreakInfo Ad Break info.Please refer "AD BREAK CONSTANTS"  section defined in CSSConstants.h for possible keys.
     */
    - (void) reportAdBreakStarted:(AdPlayer)adPlayer adType:(AdTechnology)adType adBreakInfo:(NSDictionary*)adBreakInfo;
    
    /**
     * Notify Conviva that an ad has ended for the monitoring session.
     */
    - (void) reportAdBreakEnded;
    
    /**
    * If customer uses modules developed conviva for AVPlayer,AVQueuePlayer and Brightcove, shall use this method to pass player instance to enable auto
    * detecction of required metrics.
    * @param player Player object(Support AVPlayer,AVQueuePlayer and Brightcove).
    */
    - (void) setPlayer:(id)player;
    
    /**
    * Reports playback metric.
    * @param key Metric key.Please refer "PLAYBACK METRIC KEYS" section defined in CSSConstants.h for all possible keys.
    * @param value Metric value.
    */
    - (void) reportPlaybackMetric:(NSString*)key value:(id)value;
    
    /**
    * Set ad analytics object on video analytics to enable seamlessly passing common data from video analytics to ad analytcis.
    * @param adAnalytics  Ad analytics.
    */
    - (void) setAdAnalytics:(CISAdAnalytics)adAnalytics;
    
    @end

    Swift

    protocol CISVideoAnalyticsProtocol : CISStreamAnalyticsProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol ConvivaRequestDelegate <NSObject>
    
    - (void)handleRequest:(NSURLRequest *)request
        completionHandler:(void(^)(NSData *responseData, NSURLResponse *response, NSError *error))completionHandler;
    
    @end

    Swift

    protocol ConvivaRequestDelegate : NSObjectProtocol