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
Modifier and TypeClassDescriptionstatic enum
static class
static enum
-
Field Summary
Modifier and TypeFieldDescriptionThe value that will be passed as the 'destination' parameter for all analytics events.static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ModifierConstructorDescriptionAnalytics
(EventEmitter emitter, android.content.Context context) protected
Analytics
(EventEmitter emitter, android.content.Context context, Class<? extends Component> componentClass) -
Method Summary
Modifier and TypeMethodDescriptionstatic Analytics
copy
(Analytics analytics, EventEmitter emitter, android.content.Context context) Creates a new instance with the properties from the providedAnalytics
.Returns the global account override.static String
Gets the globally unique session key for this application session.boolean
Return whether the client side unique identifier feature is enabled.static String
Return a static version of the result from the getDeviceType method in this classvoid
setAccount
(String account) Sets the global account override.void
setApplication
(String application) Set an ID to the applicationvoid
setDeliveryType
(Analytics.DeliveryType deliveryType) Set theAnalytics.DeliveryType
for the currently playing item.void
setDestination
(String destination) The destination must be a valid URI.void
setIsPlaybackForegrounded
(boolean foregrounded) Set if the playback is attached to an on-going notification in a foreground service.setMediaPlayback
(MediaPlayback<?> playback) void
setMediaType
(Analytics.MediaType mediaType) Set theAnalytics.MediaType
for the currently playing item.void
setPlayerID
(String playerID) Set an ID to the playervoid
setPlayerName
(String playerName) Set a name to the playervoid
The source must be a valid URI.void
setUniqueIdentifierEnabled
(boolean uniqueIdentifierEnabled) Set whether the client side unique identifier feature is enabled.void
Methods 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.MediaType
for the currently playing item.- Parameters:
mediaType
- -Analytics.MediaType.AUDIO
if playing audio only, otherwiseAnalytics.MediaType.VIDEO
.
-
setDeliveryType
Set theAnalytics.DeliveryType
for the currently playing item.- Parameters:
deliveryType
- -Analytics.DeliveryType.LIVE
if 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
.
-