Roku metadata keys

Standard video, audio, and ad metadata can be set on media and ad info objects respectively. Using the constants keys for video/ad metadata set the dictionary containing standard metadata on info object before calling the track APIs. Refer the tables below for the entire list of standard metadata constants, followed by sample.

Video metadata constants

Metadata Name Context Data Key Constant Name
Show MEDIA_VideoMetadataKeySHOW
Season MEDIA_VideoMetadataKeySEASON
Episode MEDIA_VideoMetadataKeyEPISODE
Asset MEDIA_VideoMetadataKeyASSET_ID
Genre MEDIA_VideoMetadataKeyGENRE
First Air Date MEDIA_VideoMetadataKeyFIRST_AIR_DATE
First Digital Air Date MEDIA_VideoMetadataKeyFIRST_DIGITAL_DATE
Rating MEDIA_VideoMetadataKeyRATING
Originator MEDIA_VideoMetadataKeyORIGINATOR
Network MEDIA_VideoMetadataKeyNETWORK
Show Type MEDIA_VideoMetadataKeySHOW_TYPE
Ad Load MEDIA_VideoMetadataKeyAD_LOAD
Authorized MEDIA_VideoMetadataKeyAUTHORIZED
Day Part MEDIA_VideoMetadataKeyDAY_PART
Feed MEDIA_VideoMetadataKeyFEED
Stream Format MEDIA_VideoMetadataKeySTREAM_FORMAT

Audio metadata constants

Metadata Name Context Data Key Constant Name
Artist MEDIA_AudioMetadataKeyARTIST
Album MEDIA_AudioMetadataKeyALBUM
Label MEDIA_AudioMetadataKeyLABEL
Author MEDIA_AudioMetadataKeyAUTHOR
Station MEDIA_AudioMetadataKeySTATION
Publisher MEDIA_AudioMetadataKeyPUBLISHER

Ad metadata constants

Metadata Name Context Data Key Constant Name
Advertiser MEDIA_AdMetadataKeyADVERTISER
Campaign ID MEDIA_AdMetadataKeyCAMPAIGN_ID
Creative ID MEDIA_AdMetadataKeyCREATIVE_ID
Placement ID MEDIA_AdMetadataKeyPLACEMENT_ID


You can use the following constants to track media events:

Other constants

Constant Description  
ERROR_SOURCE_PLAYER Constant for Error source being Player

MediaObjectkey constants (Used as keys within MediaObject instances)

Constant Description  
MEDIA_STANDARD_MEDIA_METADATA Constant to set metadata on the MediaInfo trackLoad
MEDIA_STANDARD_AD_METADATA Constant to set the ad metadata on the EventData trackEvent
MEDIA_RESUMED Constant for sending a video-resumed heartbeat. To resume video tracking of previously stopped content, you need to set the MEDIA_RESUMED property on the mediaInfo object when you call mediaTrackLoad. (MEDIA_RESUMED is not an event that you can track using the mediaTrackEvent API.) MEDIA_RESUMED should be set to true when an application wants to continue to track content that a user stopped watching but now intends to resume watching.

For example, say a user watches 30% of the content, then closes the app. This will lead to the session being ended. Later, if the same user returns to the same content, and the application allows that user to resume from the same point where they left off, then the application should set MEDIA_RESUMED to “true” while calling the mediaTrackLoad API. The result is that these two different media sessions for the same video content can be linked together. Following is the implementation example:

mediaInfo =
mediaInfo[ADBMobile().MEDIA_RESUMED] = true
mediaContextData = {}
ADBMobile().mediaTrackLoad(mediaInfo, mediaContextData)

This will create a new session for the video, but it also causes the SDK to send a heartbeat request with the event type “resume”, which can be used in reporting to tie two different media sessions together.

Content type constants

Constant Description  
MEDIA_STREAM_TYPE_LIVE Constant for Stream Type LIVE
MEDIA_STREAM_TYPE_VOD Constant for Stream Type VOD

Event Type Constants (Used for the trackEvent call)

Constant Description  
MEDIA_BUFFER_START Event Type for Buffer Start
MEDIA_BUFFER_COMPLETE Event Type for Buffer Complete
MEDIA_SEEK_START Event Type for Seek Start
MEDIA_SEEK_COMPLETE Event Type for Seek Complete
MEDIA_BITRATE_CHANGE Event Type for Bitrate change
MEDIA_CHAPTER_START Event Type for Chapter Start
MEDIA_CHAPTER_COMPLETE Event Type for Chapter Complete
MEDIA_CHAPTER_SKIP Event Type for Ad Start
MEDIA_AD_BREAK_START Event Type for Ad Start
MEDIA_AD_BREAK_COMPLETE Event Type for AdBreak Complete
MEDIA_AD_BREAK_SKIP Event Type for AdBreak Skip
MEDIA_AD_START Event Type for Ad Start
MEDIA_AD_COMPLETE Event Type for Ad Complete
MEDIA_AD_SKIP Event Type for Ad Skip

On this page