Package com.brightcove.player.analytics
Class Analytics
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.player.analytics.Analytics
- All Implemented Interfaces:
Component
@Emits(events={"account","analyticsMetricsRequest","didSetAnalyticsBaseParams","error"})
@ListensFor(events={"account","activityStarted","activityStopped","activityDestroyed","adBreakStarted","adBreakCompleted","adProgress","addAnalyticsBaseParams","analyticsCatalogRequest","analyticsCatalogResponse","analyticsVideoEngagement","bufferingCompleted","bufferingStarted","completed","didPause","didPlay","didSeekTo","didSetVideo","error","fragmentStarted","fragmentStopped","fragmentDestroyed","play","progress","setAnalyticsBaseParams","version","videoDurationChanged","videoSizeKnown","willChangeVideo","videoDownloadStarted","videoDownloadCompleted","videoDownloadCancelled","videoDownloadFailed","adViewableImpression","adError","adStarted","adCompleted"})
public class Analytics
extends AbstractComponent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionThe value that will be passed as the 'destination' parameter for all analytics events.static final StringFields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens -
Constructor Summary
ConstructorsModifierConstructorDescriptionAnalytics(EventEmitter emitter, android.content.Context context) protectedAnalytics(EventEmitter emitter, android.content.Context context, Class<? extends Component> componentClass) -
Method Summary
Modifier and TypeMethodDescriptionstatic Analyticscopy(Analytics analytics, EventEmitter emitter, android.content.Context context) Creates a new instance with the properties from the providedAnalytics.Returns the global account override.static StringGets the globally unique session key for this application session.booleanReturn whether the client side unique identifier feature is enabled.static StringReturn a static version of the result from the getDeviceType method in this classvoidsetAccount(String account) Sets the global account override.voidsetApplication(String application) Set an ID to the applicationvoidsetDeliveryType(Analytics.DeliveryType deliveryType) Set theAnalytics.DeliveryTypefor the currently playing item.voidsetDestination(String destination) The destination must be a valid URI.voidsetIsPlaybackForegrounded(boolean foregrounded) Set if the playback is attached to an on-going notification in a foreground service.setMediaPlayback(MediaPlayback<?> playback) voidsetMediaType(Analytics.MediaType mediaType) Set theAnalytics.MediaTypefor the currently playing item.voidsetPlayerID(String playerID) Set an ID to the playervoidsetPlayerName(String playerName) Set a name to the playervoidThe source must be a valid URI.voidsetUniqueIdentifierEnabled(boolean uniqueIdentifierEnabled) Set whether the client side unique identifier feature is enabled.voidMethods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
TAG
-
destination
The value that will be passed as the 'destination' parameter for all analytics events. This must be a valid URI.
-
-
Constructor Details
-
Analytics
-
Analytics
protected Analytics(EventEmitter emitter, android.content.Context context, Class<? extends Component> componentClass)
-
-
Method Details
-
getSessionKey
Gets the globally unique session key for this application session.- Returns:
- the unique session key
-
setMediaPlayback
-
getAccount
Returns the global account override. -
setAccount
Sets the global account override. -
setIsPlaybackForegrounded
public void setIsPlaybackForegrounded(boolean foregrounded) Set if the playback is attached to an on-going notification in a foreground service.- Parameters:
foregrounded- If the playback is attached to a service.
-
setDestination
The destination must be a valid URI. -
setSource
The source must be a valid URI. -
setPlayerName
Set a name to the player- Parameters:
playerName- - The value to be set to the player field
-
setPlayerID
Set an ID to the player- Parameters:
playerID- - The value to be set to the player_id field
-
setApplication
Set an ID to the application- Parameters:
application- - The value to be set to the application field
-
setVideo
-
getAnalyticParams
-
sendAnalyticsRequest
-
getUserAgentDeviceType
Return a static version of the result from the getDeviceType method in this class- Returns:
- the static version of the device type, to build the SDK User-Agent string
-
getUniqueIdentifierEnabled
public boolean getUniqueIdentifierEnabled()Return whether the client side unique identifier feature is enabled. -
setUniqueIdentifierEnabled
public void setUniqueIdentifierEnabled(boolean uniqueIdentifierEnabled) Set whether the client side unique identifier feature is enabled. By default, unique user tracking is implemented by the Brightcove Analytics server using the client IP address and user agent, but when the client side unique identifier feature is enabled, the device's android ID is used to uniquely identify the user.- See Also:
-
Settings.Secure.ANDROID_ID
-
setMediaType
Set theAnalytics.MediaTypefor the currently playing item.- Parameters:
mediaType- -Analytics.MediaType.AUDIOif playing audio only, otherwiseAnalytics.MediaType.VIDEO.
-
setDeliveryType
Set theAnalytics.DeliveryTypefor the currently playing item.- Parameters:
deliveryType- -Analytics.DeliveryType.LIVEif playing live, otherwiseAnalytics.DeliveryType.ON_DEMAND.
-
copy
@RestrictTo(LIBRARY) public static Analytics copy(Analytics analytics, EventEmitter emitter, android.content.Context context) Creates a new instance with the properties from the providedAnalytics.- Parameters:
analytics- The analytics used to initialize the properties of the new instance.emitter- The event emitter associated with playback.context- The application context.- Returns:
- A new instance of
Analytics.
-