@Emits(events="registerPlugin") @ListensFor(events={"didSelectSource","didSetVideo","didPlay","didPause","didSeekTo","progress","completed","activityStopped","setHeartbeatConfigData","collectLifecycleData","pauseCollectLifecycleData"}) public class OmnitureComponent extends AbstractComponent implements Component
Modifier and Type | Class and Description |
---|---|
static class |
OmnitureComponent.DefaultMediaNameFactory
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 value
|
static interface |
OmnitureComponent.MediaNameFactory
Provides a simple interface to allow the generation of media names that are tracked in
Omniture to be customized.
|
protected class |
OmnitureComponent.OnActivityStoppedListener |
protected class |
OmnitureComponent.OnCollectLifeCycleDataListener |
protected class |
OmnitureComponent.OnDidSeekToListener |
protected class |
OmnitureComponent.OnDidSetVideoListener |
protected class |
OmnitureComponent.OnPauseCollectLifeCycleDataListener |
protected class |
OmnitureComponent.OnPauseListener |
protected class |
OmnitureComponent.OnPlayListener |
protected class |
OmnitureComponent.OnProgressListener |
protected class |
OmnitureComponent.OnSelectedSourceListener |
protected class |
OmnitureComponent.OnSetHeartbeatConfigDataListener |
protected class |
OmnitureComponent.OnVideoCompletedListener |
static class |
OmnitureComponent.TrackingState |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MEDIA_ID
Video player Id used in tracking when none is specified in the video properties map.
|
static java.lang.String |
DEFAULT_PLAYER_NAME
Video player name used in tracking when none is specified in the constructor.
|
static java.lang.String |
HEARTBEAT_APP_VERSION |
static java.lang.String |
HEARTBEAT_CHANNEL |
static java.lang.String |
HEARTBEAT_DEBUG_LOGGING |
static java.lang.String |
HEARTBEAT_OVP |
static java.lang.String |
HEARTBEAT_SSL |
static java.lang.String |
HEARTBEAT_TRACKING_SERVER |
static java.lang.String |
TAG |
static java.lang.String |
VIDEO_ID |
eventEmitter, listenerTokens
Constructor and Description |
---|
OmnitureComponent(EventEmitter emitter,
android.content.Context context,
java.lang.String playerName,
java.lang.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,
java.lang.String playerName,
java.lang.String playerId,
BaseVideoView baseVideoView,
boolean useHeartbeat)
To support video heartbeat tracking with the omniture plugin, the following parameters must
be specified:
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeCurrentVideo()
Closes the tracking session for the Video currently being tracked.
|
com.adobe.mobile.Media |
getMediaMeasurement()
Retrieves the instance of Media interface used by this Component.
|
java.lang.String |
getPlayerId()
Retrieves the unique identifier of the video player provided to the Omniture Component.
|
java.lang.String |
getPlayerName()
Retrieves the name of the video player provided to the Omniture Component.
|
protected OmnitureComponent.TrackingState |
getState()
Return the current state of media playback.
|
java.util.Map<java.lang.String,java.lang.String> |
getVideoMetadata()
Retrieves the Video Metadata Map.
|
protected void |
initializeListeners() |
protected void |
openVideo(Video video)
Handles tracking the opening of a new video, as well as updates the tracking state to
TrackingState.OPEN.
|
protected void |
openVideo(Video video,
java.util.Map<java.lang.String,java.lang.Object> properties)
Handles tracking the opening of a new video, as well as updates the tracking state to
TrackingState.OPEN.
|
protected void |
openVideo(Video video,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.util.Map<java.lang.String,java.lang.String> videoMetadata)
Handles tracking the opening of a new video, as well as updates the tracking state to
TrackingState.OPEN.
|
protected void |
play(java.lang.Integer position)
Track that playback has begun.
|
protected void |
play(java.lang.Integer position,
boolean shouldIgnoreState)
Track that playback has begun.
|
void |
setMediaMeasurement(com.adobe.mobile.Media measure)
Allows the Component-level developer to override the built-in reference to Omniture's
Media API.
|
void |
setMediaNameFactory(OmnitureComponent.MediaNameFactory factory)
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(java.util.Map<java.lang.String,java.lang.String> videoMetadata)
Sets the Video Metadata Map.
|
protected void |
stopPlayback(java.lang.Integer position)
Track that playback has stopped.
|
protected void |
stopPlayback(java.lang.Integer position,
boolean shouldIgnoreState)
Track that playback has stopped.
|
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public static final java.lang.String TAG
public static final java.lang.String DEFAULT_PLAYER_NAME
public static final java.lang.String DEFAULT_MEDIA_ID
public static final java.lang.String VIDEO_ID
public static final java.lang.String HEARTBEAT_TRACKING_SERVER
public static final java.lang.String HEARTBEAT_CHANNEL
public static final java.lang.String HEARTBEAT_OVP
public static final java.lang.String HEARTBEAT_APP_VERSION
public static final java.lang.String HEARTBEAT_SSL
public static final java.lang.String HEARTBEAT_DEBUG_LOGGING
public OmnitureComponent(EventEmitter emitter, android.content.Context context, java.lang.String playerName, java.lang.String playerId)
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 trackingContext
public OmnitureComponent(EventEmitter emitter, android.content.Context context, java.lang.String playerName, java.lang.String playerId, BaseVideoView baseVideoView, boolean useHeartbeat)
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 heartbeatpublic java.lang.String getPlayerName()
public java.lang.String getPlayerId()
public void setMediaNameFactory(OmnitureComponent.MediaNameFactory factory)
factory
- an implementation of MediaNameFactorypublic java.util.Map<java.lang.String,java.lang.String> getVideoMetadata()
public void setVideoMetadata(java.util.Map<java.lang.String,java.lang.String> videoMetadata)
videoMetadata
- Adobe Analytics context datapublic com.adobe.mobile.Media getMediaMeasurement()
public void setMediaMeasurement(com.adobe.mobile.Media measure)
measure
- a new instance of Media, which will override the built-in
reference.protected void initializeListeners()
protected void openVideo(Video video)
video
- the Video that was set in the player, which is to be trackedprotected void openVideo(Video video, java.util.Map<java.lang.String,java.lang.Object> properties)
video
- the Video that was set in the player, which is to be tracked.properties
- the Video properties Map.java.lang.IllegalArgumentException
- if properties is null.for Video properties
protected void openVideo(Video video, java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Map<java.lang.String,java.lang.String> videoMetadata)
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.java.lang.IllegalArgumentException
- if properties is null.for Video properties
protected void play(java.lang.Integer position)
position
- the position, in seconds, within the video that playback beganplay(Integer, boolean)
protected void play(java.lang.Integer position, boolean shouldIgnoreState)
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 updatedprotected void stopPlayback(java.lang.Integer position)
position
- The position, in seconds, within the video that playback stopped.stopPlayback(Integer, boolean)
protected void stopPlayback(java.lang.Integer position, boolean shouldIgnoreState)
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 updatedprotected void closeCurrentVideo()
protected OmnitureComponent.TrackingState getState()