Class ConvivaAnalyticsSession

java.lang.Object
com.castlabs.analytics.AnalyticsSession
com.castlabs.sdk.conviva.ConvivaAnalyticsSession
All Implemented Interfaces:
IAnalyticsSession, PlayerControllerPlugin.Component

public class ConvivaAnalyticsSession extends AnalyticsSession

This class allows to get ConvivaVideoAnalytics API access. You can get the instance with the getVideoAnalytics() method.

To get the instance of this class use PlayerController.getComponent(Class) as follows:


 ConvivaAnalyticsSession convivaAnalyticsSession = playerView.getPlayerController().getComponent(ConvivaAnalyticsSession.class);
 

To send a custom Conviva event do the following:


 if (convivaAnalyticsSession != null) {
     // Fill custom map
     HashMap<String, Object> customData = new HashMap<>();
     customData.put("now", Long.toString(System.currentTimeMillis()));
     customData.put("fizz", "buzz");

     String eventType = "customEvent";
     ConvivaVideoAnalytics videoAnalytics = convivaAnalyticsSession.getVideoAnalytics();
     // Send event
     if (videoAnalytics != null) {
       convivaAnalyticsSession.getVideoAnalytics().reportPlaybackEvent(eventType, customData);
     }
}
 

  • Field Details

    • META_KEY_ENCODED_FRAMERATE

      public static final String META_KEY_ENCODED_FRAMERATE
      Key that can be used to add encodedFrameRate to the analytics meta-data. The value must be of type int.
      See Also:
    • META_KEY_DEFAULT_RESOURCE

      public static final String META_KEY_DEFAULT_RESOURCE
      Key that can be used to add defaultResource to the analytics meta-data. The value must be of type String.
      See Also:
    • META_KEY_APPLICATION_NAME

      public static final String META_KEY_APPLICATION_NAME
      Key that can be used to add applicationName to the analytics meta-data. The value must be of type String.
      See Also:
  • Method Details

    • getVideoAnalytics

      @Nullable public com.conviva.sdk.ConvivaVideoAnalytics getVideoAnalytics()
      Getter for the Conviva Video Analytics instance, can be used to send custom player insight events associated with the video playback.
      Returns:
      The underlying instance of Conviva's ConvivaVideoAnalytics. null if session hasn't started yet, already released, or failed initialization.
    • getAdAnalytics

      @Nullable public com.conviva.sdk.ConvivaAdAnalytics getAdAnalytics()
      Getter for the Conviva ad analytics instance.
    • startInternal

      public void startInternal(@NonNull PlayerController playerController, @NonNull AnalyticsMetaData analyticsMetaData)
    • stopInternal

      public void stopInternal()
    • releaseInternal

      public void releaseInternal()
    • detachFromControllerInternal

      public void detachFromControllerInternal()
    • onExoPlayerStateChangedInternal

      public void onExoPlayerStateChangedInternal(boolean playWhenReady, int playbackState)
    • id

      @NonNull public Class id()
    • onDestroy

      public void onDestroy(@NonNull PlayerController playerController)
    • onOpenBundle

      public void onOpenBundle(@NonNull PlayerController playerController, @NonNull Bundle bundle)
    • onOpenState

      public void onOpenState(PlayerController playerController, PlayerConfig playerConfig)
    • adWillStartInternal

      public void adWillStartInternal(Ad ad)
    • adStartInternal

      public void adStartInternal(Ad ad)
    • adStopInternal

      public void adStopInternal()
    • adErrorInternal

      public void adErrorInternal(Ad ad, CastlabsPlayerException exception)
    • adSkippedInternal

      public void adSkippedInternal()
    • reportPlayerStateInternal

      public void reportPlayerStateInternal(PlayerController.State state)
    • sendErrorInternal

      public void sendErrorInternal(String code, String message, int severity)
    • seekStartInternal

      public void seekStartInternal(long newPosition)
    • seekEndInternal

      public void seekEndInternal()
    • seekProcessedInternal

      public void seekProcessedInternal()