Package com.castlabs.sdk.conviva
Class ConvivaAnalyticsSession
java.lang.Object
com.castlabs.analytics.AnalyticsSession
com.castlabs.sdk.conviva.ConvivaAnalyticsSession
- All Implemented Interfaces:
IAnalyticsSession
,PlayerControllerPlugin.Component
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Key that can be used to add applicationName to the analytics meta-data.static final String
Key that can be used to add defaultResource to the analytics meta-data.static final String
Key that can be used to add encodedFrameRate to the analytics meta-data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
adErrorInternal
(Ad ad, CastlabsPlayerException exception) void
void
adStartInternal
(Ad ad) void
void
void
com.conviva.sdk.ConvivaAdAnalytics
Getter for the Conviva ad analytics instance.com.conviva.sdk.ConvivaVideoAnalytics
Getter for the Conviva Video Analytics instance, can be used to send custom player insight events associated with the video playback.id()
void
onDestroy
(PlayerController playerController) void
onExoPlayerStateChangedInternal
(boolean playWhenReady, int playbackState) void
onOpenBundle
(PlayerController playerController, Bundle bundle) void
onOpenState
(PlayerController playerController, PlayerConfig playerConfig) void
void
void
void
void
seekStartInternal
(long newPosition) void
sendErrorInternal
(String code, String message, int severity) void
startInternal
(PlayerController playerController, AnalyticsMetaData analyticsMetaData) void
Methods inherited from class com.castlabs.analytics.AnalyticsSession
adClick, adError, adPause, adResume, adSkipped, adStart, adStop, adWillStart, detachFromController, getEnabled, onExoPlayerStateChanged, release, reportPlayerState, seekEnd, seekProcessed, seekStart, sendError, setEnabled, start, stop
-
Field Details
-
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
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
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
-
onDestroy
-
onOpenBundle
-
onOpenState
-
adWillStartInternal
-
adStartInternal
-
adStopInternal
public void adStopInternal() -
adErrorInternal
-
adSkippedInternal
public void adSkippedInternal() -
reportPlayerStateInternal
-
sendErrorInternal
-
seekStartInternal
public void seekStartInternal(long newPosition) -
seekEndInternal
public void seekEndInternal() -
seekProcessedInternal
public void seekProcessedInternal()
-