Conteúdo principal ao vivo com rastreamento sequencial live-main-content-with-sequential-tracking
Cenário scenario
Neste cenário, há um ativo ao vivo sem anúncios reproduzidos por 40 segundos após entrar no stream ao vivo.
Este cenário é igual ao cenário Reprodução de VOD sem anúncios, só que parte do conteúdo é depurado e uma busca é realizada de um ponto a outro do conteúdo principal.
Parâmetros parameters
Heartbeat Content Start
s:sc:rsid
s:sc:tracking_serve
s:user:mid
s:user:mid
s:event:type
"start"
s:asset:type
"main"
s:asset:media_id
s:stream:type
live
s:meta:*
Reprodução de conteúdo do Heartbeat heartbeat-content-play
Isso deve ser quase idêntico à chamada de Início do conteúdo do Heartbeat, mas com uma diferença no parâmetro “stype”. Todos os parâmetros devem estar em vigor aqui.
s:event:type
"play"
s:asset:type
"main"
Conteúdo do Heartbeats content-heartbeats
Durante a reprodução da mídia, há um temporizador que enviará um ou mais heartbeats a cada 10 segundos para o conteúdo principal e a cada segundo para os anúncios. Esses heartbeats contêm informações sobre reprodução, anúncios, buffering e várias outras coisas. O conteúdo exato de cada heartbeat está além do escopo desse documento, o mais importante para validar é que os heartbeats são acionados de forma consistente enquanto a reprodução continuar.
Nos heartbeats de conteúdo, procure alguns itens específicos:
s:event:type
"play"
l:event:playhead
Heartbeat Content Complete heartbeat-content-complete
Quando a reprodução de um determinado episódio for concluída (o indicador de reprodução ultrapassa o limite do episódio), uma chamada Heartbeat Content Complete é enviada. Parece com outras chamadas do Heartbeat, mas contém algumas coisas específicas:
s:event:type
"complete"
s:asset:type
"main"
Código de exemplo sample-code
Android
Veja a ordem de chamada da API esperada:
// Set up mediaObject
MediaObject mediaInfo = MediaHeartbeat.createMediaObject(
Configuration.MEDIA_NAME,
Configuration.MEDIA_ID,
Configuration.MEDIA_LENGTH,
MediaHeartbeat.StreamType.LIVE
);
HashMap<String, String> mediaMetadata = new HashMap<String, String>();
mediaMetadata.put(CUSTOM_VAL_1, CUSTOM_KEY_1);
mediaMetadata.put(CUSTOM_VAL_2, CUSTOM_KEY_2);
// 1. Call trackSessionStart() when the user clicks Play or if autoplay is used,
// i.e., when there is an intent to start playback.
_mediaHeartbeat.trackSessionStart(mediaInfo, mediaMetadata);
......
......
// 2. Call trackPlay() when the playback actually starts, i.e., when the first
// frame of main content is rendered on the screen.
_mediaHeartbeat.trackPlay();
.......
.......
// 3. Call trackComplete() when the playback reaches the end of session,
// i.e., when the media completes and finishes playing 1st episode/session.
_mediaHeartbeat.trackComplete();
........
........
// 4. Call trackSessionEnd() to end session 1
_mediaHeartbeat.trackSessionEnd();
........
........
// Start tracking session 2 /episode 2 of the same live stream.
// There is no need to reinstantiate a mediaHeartbeat instance for tracking sesison 2.
// Set up mediaObject
MediaObject mediaInfo = MediaHeartbeat.createMediaObject(
Configuration.MEDIA_NAME,
Configuration.MEDIA_ID,
Configuration.MEDIA_LENGTH,
MediaHeartbeat.StreamType.LIVE
);
HashMap<String, String> mediaMetadata = new HashMap<String, String>();
mediaMetadata.put(CUSTOM_VAL_1, CUSTOM_KEY_1);
mediaMetadata.put(CUSTOM_VAL_2, CUSTOM_KEY_2);
// 5. Call trackSessionStart() when the playhead reaches a point that denotes the
// start of session 2
_mediaHeartbeat.trackSessionStart(mediaInfo, mediaMetadata);
......
......
// 6. Call trackPlay() to start tracking session 2 playback
_mediaHeartbeat.trackPlay();
.......
.......
// 7. Call trackComplete() when the playback reaches the end of session 2,
// i.e., the media completes and finishes playing.
_mediaHeartbeat.trackComplete();
........
........
// 8. Call trackSessionEnd() to end session 2
_mediaHeartbeat.trackSessionEnd();
........
........
// Continue similarly tracking further sessions in the live stream if required
iOS
Veja a ordem de chamada da API esperada:
// Set up mediaObject
ADBMediaObject *mediaObject =
[ADBMediaHeartbeat createMediaObjectWithName:MEDIA_NAME
length:MEDIA_LENGTH
streamType:ADBMediaHeartbeatStreamTypeLIVE];
NSMutableDictionary *mediaContextData = [[NSMutableDictionary alloc] init];
[mediaContextData setObject:CUSTOM_VAL_1 forKey:CUSTOM_KEY_1];
[mediaContextData setObject:CUSTOM_VAL_2 forKey:CUSTOM_KEY_2];
// 1. Call trackSessionStart when the user clicks Play or if autoplay is used,
// i.e., there is an intent to start playback.
[_mediaHeartbeat trackSessionStart:mediaObject data:mediaContextData];
......
......
// 2. Call trackPlay when the playback actually starts, i.e., when the first
// frame of main content is rendered on the screen.
[_mediaHeartbeat trackPlay];
.......
.......
// 3. Call trackComplete when the playback reaches the end of session,
// i.e., when the media completes and finishes playing the first
// episode/session.
[_mediaHeartbeat trackComplete];
.......
.......
// 4. Call trackSessionEnd to end session 1
[_mediaHeartbeat trackSessionEnd];
........
........
// Start tracking session 2 / episode 2 of the same live stream, No need to
// reinstantiate mediaHeartbeat instance for tracking sesison 2.
// Set up mediaObject
ADBMediaObject *mediaObject =
[ADBMediaHeartbeat createMediaObjectWithName:MEDIA_NAME
length:MEDIA_LENGTH
streamType:ADBMediaHeartbeatStreamTypeLIVE];
NSMutableDictionary *mediaContextData = [[NSMutableDictionary alloc] init];
[mediaContextData setObject:CUSTOM_VAL_1 forKey:CUSTOM_KEY_1];
[mediaContextData setObject:CUSTOM_VAL_2 forKey:CUSTOM_KEY_2];
// 5. Call trackSessionStart when the playhead reaches a point that denotes
// start of session 2
[_mediaHeartbeat trackSessionStart:mediaObject data:mediaContextData];
......
......
// 6. Call trackPlay to start tracking session 2 playback
[_mediaHeartbeat trackPlay];
.......
.......
// 7. Call trackComplete when the playback reaches the end of session 2,
// i.e., when the media completes and finishes playing.
[_mediaHeartbeat trackComplete];
........
........
// 8. Call trackSessionEnd to end the session 2
[_mediaHeartbeat trackSessionEnd];
........
........
// Continue tracking further sessions in live stream similarly if required
JavaScript
Veja a ordem de chamada da API esperada:
// Set up mediaObject
var mediaInfo = MediaHeartbeat.createMediaObject(
Configuration.MEDIA_NAME,
Configuration.MEDIA_ID,
Configuration.MEDIA_LENGTH,
MediaHeartbeat.StreamType.VOD
);
var mediaMetadata = {
CUSTOM_KEY_1 : CUSTOM_VAL_1,
CUSTOM_KEY_2 : CUSTOM_VAL_2,
CUSTOM_KEY_3 : CUSTOM_VAL_3
};
// 1. Call trackSessionStart() when Play is clicked or if autoplay is used,
// i.e., there's an intent to start playback.
this._mediaHeartbeat.trackSessionStart(mediaInfo, mediaMetadata);
......
......
// 2. Call trackPlay() when the playback actually starts, i.e., when the
// first frame of media is rendered on the screen.
this._mediaHeartbeat.trackPlay();
.......
.......
// 3. Call trackComplete() when the playback reaches the end of a session,
// i.e., whn playback completes and finishes playing the 1st episode/session.
this._mediaHeartbeat.trackComplete();
........
........
// 4. Call trackSessionEnd() to end session 1
this._mediaHeartbeat.trackSessionEnd();
........
........
// Start tracking session 2/episode 2 of the same live stream. There is no need
// to reinstantiate a mediaHeartbeat instance for tracking sesison 2.
// Set up mediaObject
var mediaInfo2 = MediaHeartbeat.createMediaObject(
Configuration.MEDIA_NAME,
Configuration.MEDIA_ID,
Configuration.MEDIA_LENGTH,
MediaHeartbeat.StreamType.LIVE
);
var mediaMetadata2 = {
CUSTOM_KEY_1 : CUSTOM_VAL_1,
CUSTOM_KEY_2 : CUSTOM_VAL_2,
CUSTOM_KEY_3 : CUSTOM_VAL_3
};
// 5. Call trackSessionStart() when the playhead reaches a point that denotes
// the start of session 2
this._mediaHeartbeat.trackSessionStart(mediaInfo2, mediaMetadata2);
......
......
// 6. Call trackPlay() to start tracking session 2 playback
this._mediaHeartbeat.trackPlay();
.......
.......
// 7. Call trackComplete() when the playback reaches the end of session 2,
// i.e., playback completes and finishes playing.
this._mediaHeartbeat.trackComplete();
........
........
// 8. Call trackSessionEnd() to end session 2
this._mediaHeartbeat.trackSessionEnd();
........
........
// Continue tracking further sessions in live stream similarly if required