Show Menu
主题×

Chromecast 元数据键

可以分别在媒体和广告信息对象上设置标准视频和广告元数据。调用跟踪 API 之前,使用视频/广告元数据的常量键设置包含信息对象中标准元数据的字典。有关标准元数据常量的完整列表,请参阅下表,随后是对应的示例。

元数据常量

元数据名称
上下文数据键
常量名称
节目
a.media.show
ADBMobile.media.VideoMetadataKeys.SHOW
a.media.season
ADBMobile.media.VideoMetadataKeys.SEASON
剧集
a.media.episode
ADBMobile.media.VideoMetadataKeys.EPISODE
资产
a.media.asset
ADBMobile.media.VideoMetadataKeys.TMS_ID
流派
a.media.genre
ADBMobile.media.VideoMetadataKeys.GENRE
首次播放日期
a.media.airDate
ADBMobile.media.VideoMetadataKeys.FIRST_AIR_DATE
首次数字化播放日期
a.media.digitalDate
ADBMobile.media.VideoMetadataKeys.FIRST_DIGITAL_DATE
评级
a.media.rating
ADBMobile.media.VideoMetadataKeys.RATING
创作者
a.media.originator
ADBMobile.media.VideoMetadataKeys.ORIGINATOR
网络
a.media.network
ADBMobile.media.VideoMetadataKeys.NETWORK
节目类型
a.media.type
ADBMobile.media.VideoMetadataKeys.SHOW_TYPE
广告载入
a.media.adLoad
ADBMobile.media.VideoMetadataKeys.AD_LOAD
MVPD
a.media.pass.mvpd
ADBMobile.media.VideoMetadataKeys.MVPD
已授权
a.media.pass.auth
ADBMobile.media.VideoMetadataKeys.AUTHORIZED
播出时段
a.media.dayPart
ADBMobile.media.VideoMetadataKeys.DAY_PART
信息源
a.media.feed
ADBMobile.media.VideoMetadataKeys.FEED
流格式
a.media.format
ADBMobile.media.VideoMetadataKeys.STREAM_FORMAT

广告元数据常量

元数据名称
上下文数据键
常量名称
广告商
a.media.ad.advertiser
ADBMobile.media.AdMetadataKeys.ADVERTISER
促销活动 ID
a.media.ad.campaign
ADBMobile.media.AdMetadataKeys.CAMPAIGN_ID
创作 ID
a.media.ad.creative
ADBMobile.media.AdMetadataKeys.CREATIVE_ID
版面 ID
a.media.ad.placement
ADBMobile.media.AdMetadataKeys.PLACEMENT_ID
网站 ID
a.media.ad.site
ADBMobile.media.AdMetadataKeys.SITE_ID
创作 URL
a.media.ad.creativeURL
ADBMobile.media.AdMetadataKeys.CREATIVE_URL

Chromecast 实施示例

视频

// setting Standard Video Metadata as context data on trackLoad API mediaContextData = { } mediaMetadata["videotype"] = "episode"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.SHOW] = "sample show"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.SEASON] = "sample season"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.EPISODE] = "sample episode"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.TMS_ID] = "sample tms_id"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.GENRE] = "sample genre"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.FIRST_AIR_DATE] = "sample first_air_date"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.FIRST_DIGITAL_DATE] = "sample first_digital_date"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.RATING] = "sample rating"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.ORIGINATOR] = "sample originator"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.NETWORK] = "sample network"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.SHOW_TYPE] = "sample show type"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.AD_LOAD] = "sample ad load"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.MVPD] = "sample mvpd"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.AUTHORIZED] = "sample authorized"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.DAY_PART] = "sample day_part"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.FEED] = "sample feed"; standardVideoMetadata[ADBMobile.media.VideoMetadataKeys.STREAM_FORMAT] = "sample format"; var mediaObject = ADBMobile.media.createMediaObject(content.name, content.id, content.length, content.streamType); mediaObject[ADBMobile.media.MediaObjectKey.StandardVideoMetadata] = standardVideoMetadata; ADBMobile.media.trackSessionStart(mediaObject, mediaMetadata);

音频

// setting Standard Audio Metadata as context data on trackLoad API mediaContextData = { } mediaMetadata["audiotype"] = "podcast"; var standardAudioMetadata = {}; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.ARTIST] = “sample artist”; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.ALBUM] = "sample album" ; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.LABEL] = "sample label"; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.AUTHOR] = "sample author" ; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.STATION] = "sample station " ; standardAudioMetadata[ADBMobile.media.AudioMetadataKeys.PUBLISHER] = "sample publisher"; var mediaObject = ADBMobile.media.createMediaObject(content.name, content.id, content.length, content.streamType, content.mediaType); mediaObject[ADBMobile.media.MediaObjectKey.StandardAudiooMetadata] = standardAudiooMetadata; ADBMobile.media.trackSessionStart(mediaObject, mediaMetadata);

广告

// setting Standard Ad Metadata as context data on ad start event var standardAdMetadata = {}; standardAdMetadata[ADBMobile.media.AdMetadataKeys.CAMPAIGN_ID] = “sample campaign”; standardAdMetadata[ADBMobile.media.AdMetadataKeys.ADVERTISER] = "sample advertiser" ; standardAdMetadata[ADBMobile.media.AdMetadataKeys.CREATIVE_ID] = "sample creativeid"; standardAdMetadata[ADBMobile.media.AdMetadataKeys.PLACEMENT_ID] = "sample placement id" ; standardAdMetadata[ADBMobile.media.AdMetadataKeys.SITE_ID] = "sample site id" ; standardAdMetadata[ADBMobile.media.AdMetadataKeys.CREATIVE_URL] = "sample creative url"; var adObject = ADBMobile.media.createAdObject(ad.name, ad.id, ad.position, ad.length); adObject[ADBMobile.media.MediaObjectKey.StandardAdMetadata] = standardVideoMetadata; ADBMobile.media.trackEvent(ADBMobile.media.Event.AdStart, this._player.getAdInfo(), adContextData);