Rich Media

 

Foreword

AT Internet’s SDK allows you to tag videos and audio media played by the user during app usage.

 

Get off to a good start

Once your tag has been initialised, you can begin tagging your videos and audio media.

If you want to use variables, be sure to import ATInternet, Tracker, MediaPlayer, Video, Audio, LiveVideo, LiveAudio, Medium and LiveMedium classes in your Activity.

 

Tagging

Rich Media tagging is not accounted for in the dispatch mechanism!

The tracker makes available a MediaPlayers object. This object exposes the following methods:

  • add: Enables the addition of a new player and returns a MediaPlayer object
  • remove: Delete a player
  • removeAll: Delete all players

When a player is deleted, if media is currently being played, a hit will be automatically sent in order to stop measurement.

Once a player is instantiated, it is possible to tag videos and audio media.

All objects listed below expose the following methods:

  • sendPlay:
    • < v2.9.0 : Sends a media play hit with a refresh hit sent automatically every 5 seconds
    • >= v.2.9.0 :  Sends a media play hit with a refresh hit sent automatically with intervals defined like this:
      • Every 5 seconds during the first minute
      • Every 15 seconds between the second and the fifth minute
      • Every 30 seconds between the sixth and the tenth minute
      • Every minute for play duration > 10 minutes
  • sendPlay with int refresh period: Same as above, except it is possible to specify the refresh period (the specified parameter cannot be less than 5, which is the minimum period EXCEPT if the parameter is set to 0, in which case refreshing is not enabled!) (Deprecated in v2.9.0)
  • sendPause: Sends a hit when media has been paused
  • sendStop: Sends a hit when media playback has been stopped completely
  • sendMove : Sends a hit when the player’s play cursor has been moved
  • >= v.2.9.0 :
    • sendPlay(SparseIntArray refreshDurations) : custom refresh interval can be defined
    • sendPlayWithoutRefresh() :Sends a media play hit without refresh
    • sendResume() : Resume media tracking preserved updated intervals
 

Video

The MediaPlayer object makes a Videos object available. This object exposes the following methods:

  • add: Enables the addition of a video to the player and returns a Video object
  • remove: Deletes a video
  • removeAll: Deletes all videos
 

Tagging examples

  1. Tagging a video play with refresh period by default
  2. Tagging a video play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging a video with full information
  4. Tagging a video ‘pause’
  5. Tagging a video ‘stop’
  6. Tagging video information
  7. Tagging others action on the video

     
 

LiveVideo

The MediaPlayer object makes a LiveVideos object available. This object exposes the following methods:

  • add: Enables the addition of a live video to the player and returns a LiveVideo object
  • remove: Deletes a live video
  • removeAll: Deletes all live videos
 

Tagging examples

  1. Tagging a live video play without refresh
  2. Tagging a live video play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging a live video ‘pause’
  4. Tagging a live video ‘stop’
  5. Tagging video live information
  6. Tagging others actions on the video live

 

 

Audio

The MediaPlayer object makes an Audios object available. This object exposes the following methods:

  • add: Enables the addition of audio media to the player and returns an Audio object.
  • remove: Deletes an audio media
  • removeAll: Deletes all audio media
 

Tagging examples

  1. Tagging audio media play without refresh
  2. Tagging audio media play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging an audio media ‘pause’
  4. Tagging an audio media ‘stop’
  5. Tagging information audio
  6. Tagging others action on the audio
 

LiveAudio

The MediaPlayer object makes a LiveAudios object available. This object exposes the following methods:

  • add: Enables the addition of live audio media to the player and returns a LiveAudio object.
  • remove: Deletes a live audio media
  • removeAll: Deletes all live audio media
 

Tagging examples

  1. Tagging a live audio media play without refresh
  2. Tagging a live audio media play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging a live audio media ‘pause’
  4. Tagging a live audio media ‘stop’
  5. Tagging information live audio
  6. Tagging others actions on the live audio
  •  

    Medium

The MediaPlayer object makes a Media object available. This object exposes the following methods:

  • add : Enables the addition of medium to the player and returns a Medium object
  • remove : Deletes a medium
  • removeAll : Deletes all media
 

Tagging examples

  1. Tagging play medium without refresh
  2. Tagging a medium play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging medium pause
  4. Tagging medium stop
  5. Tagging information medium
  6. Tagging others actions on the medium
  •  

    LiveMedium

The MediaPlayer object makes a LiveMedia object available. This object exposes the following methods:

  • add :Enables the addition of live medium to the player and returns a LiveMedium object
  • remove : Deletes a live medium
  • removeAll : Deletes all live media
 

Tagging examples

  1. Tagging medium play without refresh
  2. Tagging a live medium play with refresh (refresh period cannot be less than 5 seconds)
  3. Tagging live medium pause
  4. Tagging live medium stop
  5. Tagging live medium information
  6. Tagging others action on the live medium
  •  

    Buffering management (>= 2.10.0)

Since 2.10.0 release, it’s possible to measure buffering delay for every media type

 

Tagging examples

  1. Starting a playback without buffering
  2. Starting a playback with buffering
  3. Resume the playback after buffering
  4. Buffering for an ongoing playback
 

Shared properties

Name Type Default value Description
mediaLabel String Empty string Gets or sets the label of the viewed media
mediaTheme1 String? null Gets or sets the first theme
mediaTheme2 String? null Gets or sets the second theme
mediaTheme3 String? null Gets or sets the third theme
mediaLevel2 Int? -1 Gets or sets the level 2 ID
isEmbedded Bool? false Indicates if the media is external to the application
webdomain String? null Gets or sets the media referrer
 

MediaPlayer class

 

Properties

Name Type Default value Description
playerId Int 1 Gets or sets the player ID
Videos Videos null Gets the instance allowing video management
Audios Audios null Gets the instance allowing audio media management
Media (>= 2.10.0) Media null Gets the instance allowing media management
LiveVideos LiveVideos null Gets the instance allowing live video management
LiveAudios LiveAudios null Gets the instance allowing live audio media management
LiveMedia (>= 2.10.0) LiveMedia null Gets the instance allowing live media management

Management of player ID is automatic but you can nonetheless specify one.

 

Video class

 

Properties

Name Type Default value Description
duration Int 0 Gets or sets total video length, in seconds
 

Audio class

 

Properties

Name Type Default value Description
duration Int 0 Gets or sets total audio media length, in seconds
 

Medium class

 

Properties

Name Type Default value Description
duration Int 0 Gets or sets total media length, in seconds

 

 

Methods

Name Return type Description
sendPlay() (< 2.9.0) void Sends a play hit with an automatic refresh of 5 seconds
sendPlay() (>=2.9.0) void Sends a play hit with an automatic refresh defined by interval
sendPlay(boolean isBuffering) (>=2.10.0) void Sends a play hit with an automatic refresh defined by interval with buffering specification
sendPlay(int refreshDuration) (deprecated in 2.9.0) void Sends the play hit with an automatic refresh, given in parameters (0 = refresh disabled)
sendPlay(SparseIntArray refreshDurations) (>= 2.9.0) void Sends the play hit with an automatic custom interval in parameters
sendPlay(SparseIntArray refreshDurations, boolean isBuffering) (>= 2.10.0) void Sends the play hit with an automatic custom interval in parameters with buffering specification
sendPlayWithoutRefresh() (>= 2.9.0) void Sends the play hit without refresh
sendPlayWithoutRefresh(boolean isBuffering) (>= 2.10.0) void Sends the play hit without refresh with buffering specification
sendResume() (>= 2.9.0) void Resume media tracking preserved state
sendResume(boolean isBuffering) (>= 2.10.0) void Resume media tracking preserved state with buffering specification
sendPause void Sends ‘pause’ hit
sendStop void Sends ‘stop’ hit
sendInfo() (>= 2.10.0) void Sends an information hit
sendInfo(boolean isBuffering) (>= 2.10.0) void Sends an information hit with buffering specification
sendMove void Sends ‘play cursor’ movement hit
sendShare (>= 2.10.0) void Sends share hit
sendEmail (>= 2.10.0) void Sends email hit
sendFavor (>= 2.10.0) void Sends favor hit
sendDownload (>= 2.10.0) void Sends download hit
Was this post helpful?
Yes
No
Last update: 28/09/2018