Reproducción de VOD con llamada a otro punto del contenido principal vod-playback-with-seeking-in-the-main-content

Escenario scenario

Este escenario incluye la búsqueda en el contenido principal durante la reproducción.

Este es el mismo escenario que el de reproducción de VOD sin anuncios, pero una parte del contenido se analiza y se hace una búsqueda desde un punto del contenido principal hasta otro punto.

Activador
Método de Heartbeat
Llamadas de red
Notas
El usuario hace clic en Reproducir.
trackSessionStart
Inicio del contenido de Analytics, inicio del contenido de Heartbeat
La biblioteca de medición no sabe que hay un anuncio previo a la emisión, por lo que las llamadas de red son idénticas a las del escenario de Reproducción de VOD sin anuncios.
Se reproduce el primer fotograma de contenido.
trackPlay
Reproducción del contenido de Heartbeat
Cuando el contenido del capítulo se reproduce antes del contenido principal, Heartbeats se iniciará cuando el capítulo comience a reproducirse.
Se reproduce el contenido
Latidos de contenido
Esta llamada de red es exactamente la misma que la del escenario de Reproducción de VOD sin anuncios.
El usuario inicia la operación de búsqueda en el contenido
trackSeekStart
No se emiten latidos hasta que finaliza la búsqueda, por ejemplo, trackSeekComplete
La llamada a otro punto del contenido finaliza.
trackSeekComplete
Los latidos comienzan a emitirse cuando termina la llamada a otro punto del contenido. Recuerde: El valor del cabezal de reproducción debe representar la nueva posición del cabezal de reproducción tras la llamada a otro punto del contenido principal.
El contenido termina de reproducirse.
trackComplete
Finalización de contenido de Heartbeat
Esta llamada de red es exactamente la misma que la del escenario de Reproducción de VOD sin anuncios.
Fin de la sesión
trackSessionEnd
SessionEnd

Código de muestra sample-code

En esta situación, el usuario hace una llamada a otro punto del contenido principal cuando se está reproduciendo.

Android

Para ver este caso en Android, configure el siguiente código:

// Set up mediaObject
MediaObject mediaInfo = MediaHeartbeat.createMediaObject(
  Configuration.MEDIA_NAME,
  Configuration.MEDIA_ID,
  Configuration.MEDIA_LENGTH,
  MediaHeartbeat.StreamType.VOD
);

HashMap<String, String> mediaMetadata = new HashMap<String, String>();
mediaMetadata.put(CUSTOM_KEY_1, CUSTOM_VAL_1);
mediaMetadata.put(CUSTOM_KEY_2, CUSTOM_VAL_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(mediaInfo, mediaMetadata);

......
......

// 2. Call trackPlay() when the playback actually starts, i.e., whn the first frame
//    of the main content is rendered on the screen.
_mediaHeartbeat.trackPlay();

.......
.......

// 3. Track the MediaHeartbeat.Event.SeekStart event when the user begins to seek.
_mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekStart, null, null);

.......
.......

// 4. Track the MediaHeartbeat.Event.SeekComplete event when the user completes seeking
_mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekComplete, null, null);

.......
.......

// 5. Call trackComplete() when the playback reaches the end, i.e., when the media
//    completes and finishes playing.
_mediaHeartbeat.trackComplete();

........
........

// 6. Call trackSessionEnd() when the playback session is over. This method must be
//    called even if the user does not watch the media to completion.
_mediaHeartbeat.trackSessionEnd();

........
........

iOS

Para ver este caso en iOS, configure el siguiente código:

// Set up mediaObject
ADBMediaObject *mediaObject =
[ADBMediaHeartbeat createMediaObjectWithName:MEDIA_NAME o
                   length:MEDIA_LENGTH
                   streamType:ADBMediaHeartbeatStreamTypeVOD];

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 the main content is rendered on the screen.
[_mediaHeartbeat trackPlay];
.......
.......

// 3. Track the trackEvent:ADBMediaHeartbeatEventSeekStart event when the user
//    begins to seek out of the chapter with the intent to skip it.
[_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventSeekStart
               mediaObject:nil
               data:nil];
.......
.......

// 4. Track the trackEvent:ADBMediaHeartbeatEventSeekComplete event when the
//    user seeks out of the chapter with the intent to skip it.
[_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventSeekComplete
               mediaObject:nil
               data:nil];
.......
.......

// 5. Call trackComplete when the playback reaches the end, i.e., completes
//    and finishes playing.
[_mediaHeartbeat trackComplete];
.......
.......

// 6. Call trackSessionEnd when the playback session is over. This method must
//    be called even if the user does not watch the media to completion.
[_mediaHeartbeat trackSessionEnd];
.......
.......

JavaScript

Para ver este caso, escriba el siguiente texto:

// 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 the ad media is rendered on the screen.
this._mediaHeartbeat.trackPlay();

.......
.......

// 3. Track the MediaHeartbeat.Event.SeekStart event when the user
//    begins to seek.
this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekStart);

.......
.......

// 4. Track the MediaHeartbeat.Event.SeekComplete event when the user
//    completes seeking.
this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekComplete);

.......
.......

// 5. Call trackComplete() when the playback reaches the end, i.e., when
//    playback completes and finishes playing.
this._mediaHeartbeat.trackComplete();

........
........

// 6. Call trackSessionEnd() when the playback session is over. This method must be called
//    even if the user does not watch the media to completion.
this._mediaHeartbeat.trackSessionEnd();

........
........
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb