-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
@Emits(events = {EventType.ACCOUNT, EventType.ANALYTICS_METRICS_REQUEST, EventType.DID_SET_ANALYTICS_BASE_PARAMS, EventType.ERROR})@ListensFor(events = {EventType.ACCOUNT, EventType.ACTIVITY_STARTED, EventType.ACTIVITY_STOPPED, EventType.ACTIVITY_DESTROYED, EventType.AD_BREAK_STARTED, EventType.AD_BREAK_COMPLETED, EventType.AD_PROGRESS, EventType.ADD_ANALYTICS_BASE_PARAMS, EventType.ANALYTICS_CATALOG_REQUEST, EventType.ANALYTICS_CATALOG_RESPONSE, EventType.ANALYTICS_VIDEO_ENGAGEMENT, EventType.BUFFERING_COMPLETED, EventType.BUFFERING_STARTED, EventType.COMPLETED, EventType.DID_PAUSE, EventType.DID_PLAY, EventType.DID_SEEK_TO, EventType.DID_SET_VIDEO, EventType.ERROR, EventType.FRAGMENT_STARTED, EventType.FRAGMENT_STOPPED, EventType.FRAGMENT_DESTROYED, EventType.PLAY, EventType.PROGRESS, EventType.SET_ANALYTICS_BASE_PARAMS, EventType.VERSION, EventType.VIDEO_DURATION_CHANGED, EventType.VIDEO_SIZE_KNOWN, EventType.WILL_CHANGE_VIDEO, EventType.VIDEO_DOWNLOAD_STARTED, EventType.VIDEO_DOWNLOAD_COMPLETED, EventType.VIDEO_DOWNLOAD_CANCELLED, EventType.VIDEO_DOWNLOAD_FAILED, EventType.AD_VIEWABLE_IMPRESSION, EventType.AD_ERROR, EventType.AD_STARTED, EventType.AD_COMPLETED}) public class Analytics extends AbstractComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Analytics.MediaType
public enum
Analytics.DeliveryType
public class
Analytics.Fields
-
Field Summary
Fields Modifier and Type Field Description public final static String
TAG
private static String
userAgentDeviceType
private boolean
isPlaybackForegrounded
private Analytics.MediaType
mediaType
private Analytics.DeliveryType
deliveryType
private String
account
public String
destination
private String
source
private String
playerName
private String
playerID
private boolean
uniqueIdentifierEnabled
-
Constructor Summary
Constructors Constructor Description Analytics(EventEmitter emitter, Context context)
-
Method Summary
Modifier and Type Method Description static String
getUserAgentDeviceType()
Return a static version of the result from the getDeviceType method in this class void
setIsPlaybackForegrounded(boolean foregrounded)
Set if the playback is attached to an on-going notification in a foreground service. void
setMediaType(Analytics.MediaType mediaType)
Set the MediaType for the currently playing item. void
setDeliveryType(Analytics.DeliveryType deliveryType)
Set the DeliveryType for the currently playing item. String
getAccount()
Returns the global account override. void
setAccount(String account)
Sets the global account override. void
setDestination(String destination)
The destination must be a valid URI. void
setSource(String source)
The source must be a valid URI. void
setPlayerName(@NonNull() String playerName)
Set a name to the player void
setPlayerID(@NonNull() String playerID)
Set an ID to the player boolean
getUniqueIdentifierEnabled()
Return whether the client side unique identifier feature isenabled. void
setUniqueIdentifierEnabled(boolean uniqueIdentifierEnabled)
Set whether the client side unique identifier feature isenabled. static String
getSessionKey()
Gets the globally unique session key for this application session. Analytics
setMediaPlayback(MediaPlayback<out Object> playback)
void
setApplication(@NonNull() String application)
Set an ID to the application void
setVideo(Video video)
void
setBcovAuthToken(String brightcoveAuthorizationToken)
Set the authorization token. static Analytics
copy(Analytics analytics, EventEmitter emitter, Context context)
Creates a new instance with the properties from the provided Analytics. -
-
Constructor Detail
-
Analytics
Analytics(EventEmitter emitter, Context context)
-
-
Method Detail
-
getUserAgentDeviceType
static String getUserAgentDeviceType()
Return a static version of the result from the getDeviceType method in this class
-
setIsPlaybackForegrounded
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.
-
setMediaType
void setMediaType(Analytics.MediaType mediaType)
Set the MediaType for the currently playing item.
- Parameters:
mediaType
- - AUDIO if playing audio only, otherwise VIDEO.
-
setDeliveryType
void setDeliveryType(Analytics.DeliveryType deliveryType)
Set the DeliveryType for the currently playing item.
- Parameters:
deliveryType
- - LIVE if playing live, otherwise ON_DEMAND.
-
getAccount
String getAccount()
Returns the global account override.
-
setAccount
void setAccount(String account)
Sets the global account override.
-
setDestination
void setDestination(String destination)
The destination must be a valid URI.
-
setPlayerName
void setPlayerName(@NonNull() String playerName)
Set a name to the player
- Parameters:
playerName
- - The value to be set to the player field
-
setPlayerID
void setPlayerID(@NonNull() String playerID)
Set an ID to the player
- Parameters:
playerID
- - The value to be set to the player_id field
-
getUniqueIdentifierEnabled
boolean getUniqueIdentifierEnabled()
Return whether the client side unique identifier feature isenabled.
-
setUniqueIdentifierEnabled
void setUniqueIdentifierEnabled(boolean uniqueIdentifierEnabled)
Set whether the client side unique identifier feature isenabled. By default, unique user tracking is implemented bythe Brightcove Analytics server using the client IP address anduser agent, but when the client side unique identifier featureis enabled, the device's android ID is used to uniquelyidentify the user.
-
getSessionKey
@NonNull() static String getSessionKey()
Gets the globally unique session key for this application session.
-
setMediaPlayback
Analytics setMediaPlayback(MediaPlayback<out Object> playback)
-
setApplication
void setApplication(@NonNull() String application)
Set an ID to the application
- Parameters:
application
- - The value to be set to the application field
-
setBcovAuthToken
void setBcovAuthToken(String brightcoveAuthorizationToken)
Set the authorization token.
-
copy
@RestrictTo(value = RestrictTo.Scope.LIBRARY) static Analytics copy(Analytics analytics, EventEmitter emitter, Context context)
Creates a new instance with the properties from the provided Analytics.
- Parameters:
analytics
- The analytics used to initialize the properties of the new instance.emitter
- The event emitter associated with playback.context
- The application context.
-
-
-
-