Package com.brightcove.omniture
Class OmnitureComponent
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.omniture.OmnitureComponent
- All Implemented Interfaces:
Component
@Emits(events="registerPlugin")
@ListensFor(events={"didSelectSource","didSetVideo","didPlay","didPause","didSeekTo","progress","completed","activityStopped","setHeartbeatConfigData","collectLifecycleData","pauseCollectLifecycleData"})
public class OmnitureComponent
extends AbstractComponent
implements Component
Implements an integration with the Adobe Mobile Library for Android.
This component will respond to playback events emitted by video players using the
Brightcove Native Player for Android, and track the appropriate events via the Media interface
for video tracking.
For more information on the Media interface, see below:
http://microsite.omniture.com/t2/help/en_US/mobile/android/video_qs.html
This class also supports the use of Video Heartbeat as an alternative to milestone tracking
provided by the above. For information on the use of Video Heartbeat can be found at:
http://microsite.omniture.com/t2/help/en_US/sc/appmeasurement/hbvideo/
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Default implementation of MediaNameFactory which follows these steps: If video exists and has an ID property as identified by Video.Fields.ID, use it Otherwise if given a Source object, presumably the one chosen by the current SourceSelector implementation, use the URL from that Source Otherwise fall back to the DEFAULT_MEDIA_NAME constant valuestatic interface
Provides a simple interface to allow the generation of media names that are tracked in Omniture to be customized.protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
static enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Video player Id used in tracking when none is specified in the video properties map.static final String
Video player name used in tracking when none is specified in the constructor.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionOmnitureComponent
(EventEmitter emitter, android.content.Context context, String playerName, String playerId) For the Omniture component to be able to properly track video playback events in Omniture, the following parameters must be properly specified:OmnitureComponent
(EventEmitter emitter, android.content.Context context, String playerName, String playerId, BaseVideoView baseVideoView, boolean useHeartbeat) To support video heartbeat tracking with the omniture plugin, the following parameters must be specified: -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Closes the tracking session for the Video currently being tracked.com.adobe.mobile.Media
Retrieves the instance of Media interface used by this Component.Retrieves the unique identifier of the video player provided to the Omniture Component.Retrieves the name of the video player provided to the Omniture Component.protected OmnitureComponent.TrackingState
getState()
Return the current state of media playback.Retrieves the Video Metadata Map.protected void
protected void
Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN.protected void
Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN.protected void
Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN.protected void
play
(long position) Track that playback has begun.protected void
play
(long position, boolean shouldIgnoreState) Track that playback has begun.protected void
Deprecated.protected void
Deprecated.void
setMediaMeasurement
(com.adobe.mobile.Media measure) Allows the Component-level developer to override the built-in reference to Omniture's Media API.void
This method allows a user of the Omniture plugin to override the logic used to generate a media name used in Omniture video tracking.void
setVideoMetadata
(Map<String, String> videoMetadata) Sets the Video Metadata Map.protected void
stopPlayback
(long position) Track that playback has stopped.protected void
stopPlayback
(long position, boolean shouldIgnoreState) Track that playback has stopped.protected void
stopPlayback
(Integer position) Deprecated.protected void
stopPlayback
(Integer position, boolean shouldIgnoreState) Deprecated.Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
TAG
-
DEFAULT_PLAYER_NAME
Video player name used in tracking when none is specified in the constructor.- See Also:
-
DEFAULT_MEDIA_ID
Video player Id used in tracking when none is specified in the video properties map.- See Also:
-
VIDEO_ID
- See Also:
-
HEARTBEAT_TRACKING_SERVER
- See Also:
-
HEARTBEAT_CHANNEL
- See Also:
-
HEARTBEAT_OVP
- See Also:
-
HEARTBEAT_APP_VERSION
- See Also:
-
HEARTBEAT_SSL
- See Also:
-
HEARTBEAT_DEBUG_LOGGING
- See Also:
-
-
Constructor Details
-
OmnitureComponent
public OmnitureComponent(EventEmitter emitter, android.content.Context context, String playerName, String playerId) For the Omniture component to be able to properly track video playback events in Omniture, the following parameters must be properly specified:- Parameters:
emitter
- the EventEmitter used by the current player or applicationcontext
- the Context for the current application (could be the current Activity)playerName
- the name of the video player to be used in video tracking; if set to null then the DEFAULT_PLAYER_NAME will be usedplayerId
- the unique identifier of the video player to be used in video tracking- See Also:
-
Context
-
OmnitureComponent
public OmnitureComponent(EventEmitter emitter, android.content.Context context, String playerName, String playerId, BaseVideoView baseVideoView, boolean useHeartbeat) To support video heartbeat tracking with the omniture plugin, the following parameters must be specified:- Parameters:
emitter
- the EventEmitter used by the current player or applicationcontext
- the Context for the current application (could be the current Activity)playerName
- the name of the video player to be used in video tracking; if set to null then the DEFAULT_PLAYER_NAME will be usedplayerId
- the unique identifier of the video player to be used in video trackingbaseVideoView
- the BaseVideoView performing media playback in the applicationuseHeartbeat
- the boolean value to toggle the use of video heartbeat
-
-
Method Details
-
getPlayerName
Retrieves the name of the video player provided to the Omniture Component.- Returns:
- the currently configured video player name
-
getPlayerId
Retrieves the unique identifier of the video player provided to the Omniture Component.- Returns:
- the currently configured video player unique identifier
-
setMediaNameFactory
This method allows a user of the Omniture plugin to override the logic used to generate a media name used in Omniture video tracking. This must be called before the video gets loaded by the player.- Parameters:
factory
- an implementation of MediaNameFactory
-
getVideoMetadata
Retrieves the Video Metadata Map.- Returns:
- the video metadata map
-
setVideoMetadata
Sets the Video Metadata Map.- Parameters:
videoMetadata
- Adobe Analytics context data
-
getMediaMeasurement
public com.adobe.mobile.Media getMediaMeasurement()Retrieves the instance of Media interface used by this Component.- Returns:
- the Media instance
-
setMediaMeasurement
public void setMediaMeasurement(com.adobe.mobile.Media measure) Allows the Component-level developer to override the built-in reference to Omniture's Media API. Useful for testing.- Parameters:
measure
- a new instance of Media, which will override the built-in reference.
-
initializeListeners
protected void initializeListeners() -
openVideo
Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN. This method causes the currently configured MediaNameFactory to be invoked to generate a media name for the given Video.- Parameters:
video
- the Video that was set in the player, which is to be tracked
-
openVideo
Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN. This method causes the currently configured MediaNameFactory to be invoked to generate a media name for the given Video.- Parameters:
video
- the Video that was set in the player, which is to be tracked.properties
- the Video properties Map.- Throws:
IllegalArgumentException
- if properties is null.- See Also:
-
openVideo
protected void openVideo(Video video, Map<String, Object> properties, Map<String, String> videoMetadata) Handles tracking the opening of a new video, as well as updates the tracking state to TrackingState.OPEN. This method causes the currently configured MediaNameFactory to be invoked to generate a media name for the given Video.- Parameters:
video
- the Video that was set in the player, which is to be tracked.properties
- the Video properties Map. It should at least contain the ID and Duration.videoMetadata
- custom video metadata (Adobe Analytics context data). This property can be null.- Throws:
IllegalArgumentException
- if properties is null.- See Also:
-
play
Deprecated.Track that playback has begun. Shortcut for calling play(position, false).- Parameters:
position
- the position, in seconds, within the video that playback began- See Also:
-
play
protected void play(long position) Track that playback has begun. Shortcut for calling play(position, false).- Parameters:
position
- the position, in seconds, within the video that playback began- See Also:
-
play
Deprecated.Track that playback has begun.- Parameters:
position
- The position, in seconds, within the video that playback began.shouldIgnoreState
- if set to true, the component's tracking state not be checked prior to issuing tracking calls, nor will the state be updated
-
play
protected void play(long position, boolean shouldIgnoreState) Track that playback has begun.- Parameters:
position
- The position, in seconds, within the video that playback began.shouldIgnoreState
- if set to true, the component's tracking state not be checked prior to issuing tracking calls, nor will the state be updated
-
stopPlayback
Deprecated.Track that playback has stopped. Shortcut for calling stopPlayback(position, false).- Parameters:
position
- The position, in seconds, within the video that playback stopped.- See Also:
-
stopPlayback
protected void stopPlayback(long position) Track that playback has stopped. Shortcut for calling stopPlayback(position, false).- Parameters:
position
- The position, in seconds, within the video that playback stopped.- See Also:
-
stopPlayback
Deprecated.Track that playback has stopped.- Parameters:
position
- The position, in seconds, within the video that playback stopped.shouldIgnoreState
- if set to true, the component's tracking state not be checked prior to issuing tracking calls, nor will the state be updated
-
stopPlayback
protected void stopPlayback(long position, boolean shouldIgnoreState) Track that playback has stopped.- Parameters:
position
- The position, in seconds, within the video that playback stopped.shouldIgnoreState
- if set to true, the component's tracking state not be checked prior to issuing tracking calls, nor will the state be updated
-
closeCurrentVideo
protected void closeCurrentVideo()Closes the tracking session for the Video currently being tracked. Sets the tracking state to TrackingState.CLOSED. -
getState
Return the current state of media playback. Useful for testing.
-