코드 비교: 1.x와 2.x

모든 구성 매개 변수와 추적 API는 이제 MediaHeartbeatsMediaHeartbeatConfig 클래스에 통합되어 있습니다.

구성 API 변경 사항:

  • AdobeHeartbeatPluginConfig.sdk - MediaConfig.appVersion으로 이름이 변경됨
  • MediaHeartbeatConfig.playerName - 이제 VideoPlayerPluginDelegate 대신 MediaHeartbeatConfig를 통해 설정됨
  • (JavaScript 전용): AppMeasurement 인스턴스 - 이제 MediaHeartbeat 생성자를 통해 전송됩니다.

구성 속성 변경 사항:

  • sdk - appVersion으로 이름이 변경됨
  • publisher - 제거됨. Experience Cloud 조직 ID가 publisher로 대신 사용됨
  • quiteMode - 제거됨

1.x 및 2.x 샘플 플레이어에 대한 링크:

다음 섹션은 1.x와 2.x의 코드 비교, 초기화 설명, 코어 재생, 광고 재생, 챕터 재생 및 일부 추가 이벤트를 제공합니다.

VHL 코드 비교: 초기화

개체 초기화

1.x API 2.x API
Heartbeat() MediaHeartbeat()
VideoPlayerPlugin() MediaHeartbeatConfig()
AdobeAnalyticsPlugin()
HeartbeatPlugin()

비디오 플레이어 플러그인 초기화(1.x)

this._playerPlugin = new VideoPlayerPlugin( new SampleVideoPlayerPluginDelegate(this._player));
var playerPluginConfig = new VideoPlayerPluginConfig();
playerPluginConfig.debugLogging = true;

// Set up the AppMeasurement plugin 
this._aaPlugin = new AdobeAnalyticsPlugin( appMeasurement, new SampleAdobeAnalyticsPluginDelegate());
var aaPluginConfig = new AdobeAnalyticsPluginConfig();
aaPluginConfig.channel = Configuration.HEARTBEAT.CHANNEL;
aaPluginConfig.debuglogging = true;
this._aaPlugin.configure(aaPluginConfig);

// Set up the AdobeHeartbeat plugin 
var ahPlugin = new AdobeHeartbeatPlugin( new SampleAdobeHeartbeatPluginDelegate());
var ahPluginConfig = new AdobeHeartbeatPluginConfig( configuration.HEARTBEAT.TRACKING_SERVER, configuration.HEARTBEAT.PUBLISHER);
ahPluginConfig.ovp = configuration.HEARTBEAT.OVP;
ahPluginConfig.sdk = configuration.HEARTBEAT.SDK;
ahPluginConfig.debugLogging = true;
ahPlugin.configure(ahPluginConfig);
var plugins = [this._playerPlugin, this._aaPlugin, ahPlugin];

// Set up and configure the heartbeat library this._heartbeat = new Heartbeat(new SampleHeartbeatDelegate(), plugins);
var configData = new HeartbeatConfig();
configData.debugLogging = true;
this._heartbeat.configure(configData);

미디어 하트비트 초기화(2.x)

var mediaConfig = new MediaHeartbeatConfig();
mediaConfig.trackingServer = Configuration.HEARTBEAT.TRACKING_SERVER;
mediaConfig.playerName = Configuration.PLAYER.NAME;
mediaConfig.debugLogging = true;
mediaConfig.channel = Configuration.HEARTBEAT.CHANNEL;
mediaConfig.ssl = false;
mediaConfig.ovp = Configuration.HEARTBEAT.OVP;
mediaConfig.appVersion = Configuration.HEARTBEAT.SDK;
this._mediaHeartbeat = new MediaHeartbeat( new SampleMediaHeartbeatDelegate(this._player), mediaConfig, appMeasurement);

위임

1.x API 2.x API
VideoPlayerPluginDelegate() MediaHeartbeatDelegate()
VideoPlayerPluginDelegate().getVideoInfo MediaHeartbeatDelegate().getCurrentPlaybackTime
VideoPlayerPluginDelegate().getAdBreakInfo MediaHeartbeatDelegate().getQoSObject
VideoPlayerPluginDelegate().getAdInfo
VideoPlayerPluginDelegate().getChapterInfo
VideoPlayerPluginDelegate().getQoSInfo
VideoPlayerPluginDelegate().get.onError
AdobeAnalyticsPluginDelegate()

VideoPlayerPluginDelegate(1.x)

$.extend(SampleVideoPlayerPluginDelegate.prototype, VideoPlayerPluginDelegate.prototype);

function SampleVideoPlayerPluginDelegate(player) { 
    this._player = player;
} 

SampleVideoPlayerPluginDelegate.prototype.getVideoInfo = function() { 
    return this._player.getVideoInfo();
};

SampleVideoPlayerPluginDelegate.prototype.getAdBreakInfo = function() { 
    return this._player.getAdBreakInfo();
};

SampleVideoPlayerPluginDelegate.prototype.getAdInfo = function() { 
    return this._player.getAdInfo();
};

SampleVideoPlayerPluginDelegate.prototype.getChapterInfo = function() { 
    return this._player.getChapterInfo();
};

SampleVideoPlayerPluginDelegate.prototype.getQoSInfo = function() { 
    return this._player.getQoSInfo();
};

AdobeAnalyticsPluginDelegate(1.x)

$.extend(SampleAdobeAnalyticsPluginDelegate.prototype, AdobeAnalyticsPluginDelegate.prototype);

function SampleAdobeAnalyticsPluginDelegate() {} 

SampleAdobeAnalyticsPluginDelegate.prototype.onError = function(errorInfo) { 
    console.log("AdobeAnalyticsPlugin error: " + errorInfo.getMessage() + " | " + errorInfo.getDetails());
};

HeartbeatDelegate(1.x)

$.extend(SampleHeartbeatDelegate.prototype, HeartbeatDelegate.prototype);

function SampleHeartbeatDelegate() {} 

SampleHeartbeatDelegate.prototype.onError = function(errorInfo) { 
    console.log("Heartbeat error: " + errorInfo.getMessage() + " | " + errorInfo.getDetails());
};

MediaHeartbeatDelegate(2.x)

ADB.core.extend(SampleMediaHeartbeatDelegate.prototype, MediaHeartbeatDelegate.prototype);

function SampleMediaHeartbeatDelegate(player) { 
    this._player = player;
} 

SampleMediaHeartbeatDelegate.prototype.getCurrentPlaybackTime = function() { 
    return this._player.getCurrentPlaybackTime();
};

SampleMediaHeartbeatDelegate.prototype.getQoSObject = function() { 
    return this._player.getQoSInfo();
};

this._mediaHeartbeat = new MediaHeartbeat(new SampleMediaHeartbeatDelegate(this._player), mediaConfig, appMeasurement);

VHL 코드 비교: 코어 재생

세션 시작

VHL 1.x VHL 2.x
VideoPlayerPluginDelegate.trackVideoLoad() MediaHeartbeat.createMediaObject()
VideoPlayerPluginDelegate.getVideoInfo() MediaHeartbeat.trackSessionStart()

세션 시작(1.x)

VideoAnalyticsProvider.prototype._onLoad = function() { 
    this._playerPlugin.trackVideoLoad();
};

SampleVideoPlayerPluginDelegate.prototype.getVideoInfo = function() { 
    return this._player.getVideoInfo();
};

VideoPlayer.prototype.getVideoInfo = function() { 
    this._videoInfo.playhead = vTime;
    return this._videoInfo;
};

세션 시작(2.x)

VideoAnalyticsProvider.prototype._onLoad = function() { 
    var contextData = {};
    var videoInfo = this._player.getVideoInfo();
    var mediaInfo = MediaHeartbeat.createMediaObject(videoInfo.name, videoInfo.id, videoInfo.length, videoInfo.streamType);
    this._mediaHeartbeat.trackSessionStart(mediaInfo, contextData);
};

표준 비디오 메타데이터

1.x API 2.x API
VideoMetadataKeys() MediaHeartbeat.createMediaObject()
AdobeAnalyticsPlugin.setVideoMetadata() MediaHeartbeat.trackSessionStart()

표준 메타데이터(1.x)

VideoAnalyticsProvider.prototype._onLoad = function() {
    console.log('Player event: MEDIA_LOAD');

    var contextData = {};

    // Setting Standard Video Metadata 
    contextData[VideoMetadataKeys.SEASON] = "sample season";
    contextData[VideoMetadataKeys.SHOW] = "sample show";
    contextData[VideoMetadataKeys.EPISODE] = "sample episode";
    contextData[VideoMetadataKeys.ASSET_ID] = "sample asset id";
    contextData[VideoMetadataKeys.GENRE] = "sample genre";
    contextData[VideoMetadataKeys.FIRST_AIR_DATE] = "sample air date";

    // Etc. 
    this._aaPlugin.setVideoMetadata(contextData);
    this._playerPlugin.trackVideoLoad();
};

표준 메타데이터(2.x)

VideoAnalyticsProvider.prototype._onLoad = function() {
    console.log('Player event: MEDIA_LOAD');
    var contextData = {};
    var mediaInfo = MediaHeartbeat.createMediaObject(videoInfo.name, videoInfo.id, videoInfo.length, videoInfo.streamType);

    // Set standard Video Metadata 
    var standardVideoMetadata = {};
    standardVideoMetadata[VideoMetadataKeys.SEASON] = "sample season";
    standardVideoMetadata[VideoMetadataKeys.SHOW] = "sample show";
    standardVideoMetadata[VideoMetadataKeys.EPISODE] = "sample episode";
    standardVideoMetadata[VideoMetadataKeys.ASSET_ID] = "sample asset id";
    standardVideoMetadata[VideoMetadataKeys.GENRE] = "sample genre";
    standardVideoMetadata[VideoMetadataKeys.FIRST_AIR_DATE] = "sample air date";
    
    // Etc. 
    mediaInfo.setValue(MediaHeartbeat.MediaObjectKey.StandardVideoMetadata, standardVideoMetadata);
    this._mediaHeartbeat.trackSessionStart(mediaInfo, contextData);
};
노트

VHL 2.0에서는 AdobeAnalyticsPlugin.setVideoMetadata() API를 통해 표준 비디오 메타데이터를 설정하는 대신, MediaObject 키 MediaObject.MediaObjectKey.StandardVideoMetadata()를 통해 표준 비디오 메타데이터를 설정합니다.

사용자 지정 비디오 메타데이터

1.x API 2.x API
VideoMetadataKeys() MediaHeartbeat.createMediaObject()
AdobeAnalyticsPlugin.setVideoMetadata() MediaHeartbeat.trackSessionStart()

사용자 지정 메타데이터(1.x)

VideoAnalyticsProvider.prototype._onLoad = function() { 
    var contextData = { 
        isUserLoggedIn: "false", 
        tvStation: "Sample TV station", 
        programmer: "Sample programmer" 
    };
    this._aaPlugin.setVideoMetadata(contextData);
    this._playerPlugin.trackVideoLoad();
};

사용자 지정 메타데이터(2.x)

VideoAnalyticsProvider.prototype._onLoad = function() { 
    var contextData = { 
        isUserLoggedIn: "false", 
        tvStation: "Sample TV station", 
        programmer: "Sample programmer" 
    };
    var videoInfo = this._player.getVideoInfo();
    var mediaInfo = MediaHeartbeat.createMediaObject(videoInfo.name, videoInfo.id, videoInfo.length, videoInfo.streamType);
    mediaInfo.setValue(MediaHeartbeat.MediaObjectKey.StandardVideoMetadata, standardVideoMetadata);
    this._mediaHeartbeat.trackSessionStart(mediaInfo, contextData);
};
노트

VHL 2.0에서는 AdobeAnalyticsPlugin.setVideoMetadata() API를 통해 사용자 지정 비디오 메타데이터를 설정하는 대신, MediaHeartbeat.trackSessionStart() API를 통해 표준 비디오 메타데이터를 설정합니다.

재생

1.x API 2.x API
VideoPlayerPlugin.trackPlay() MediaHeartbeat.trackPlay()

재생(1.x)

VideoAnalyticsProvider.prototype._onSeekStart = function() { 
    console.log('Player event: SEEK_START');
    this._playerPlugin.trackSeekStart();
};

재생(2.x)

VideoAnalyticsProvider.prototype._onSeekStart = function() { 
    console.log('Player event: SEEK_START');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekStart);
};

일시 정지

1.x API 2.x API
VideoPlayerPlugin.trackPause() MediaHeartbeat.trackPausel()

일시 중지(1.x)

VideoAnalyticsProvider.prototype._onPause = function() { 
    console.log('Player event:X PAUSE');
    this._playerPlugin.trackPause();
};

일시 중지(2.x)

VideoAnalyticsProvider.prototype._onBufferComplete = function() { 
    console.log('Player event: BUFFER_COMPLETE');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.BufferComplete);
};

찾기 완료

1.x API 2.x API
VideoPlayerPlugin.trackSeekComplete() MediaHeartbeat.
  trackEvent(MediaHeartbeat.Event.SeekComplete)

찾기(1.x)

VideoAnalyticsProvider.prototype._onSeekComplete = function() { 
    console.log('Player event: SEEK_COMPLETE');
    this._playerPlugin.trackSeekComplete();
};

찾기(2.x)

VideoAnalyticsProvider.prototype._onSeekComplete = function() { 
    console.log('Player event: SEEK_COMPLETE');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.SeekComplete);
};

버퍼 시작

1.x API 2.x API
VideoPlayerPlugin.trackBufferStart() MediaHeartbeat.trackEvent(
  MediaHeartbeat.Event.BufferStart)

버퍼 시작(1.x)

VideoAnalyticsProvider.prototype._onBufferStart = function() { 
    console.log('Player event: BUFFER_START');
    this._playerPlugin.trackBufferStart();
};

버퍼 시작(2.x)

VideoAnalyticsProvider.prototype._onBufferStart = function() { 
    console.log('Player event: BUFFER_START');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.BufferStart);
};

버퍼 완료

1.x API 2.x API
VideoPlayerPlugin.trackBufferComplete() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.BufferComplete)

버퍼 완료(1.x)

VideoAnalyticsProvider.prototype._onBufferComplete = function() { 
    console.log('Player event: BUFFER_COMPLETE');
    this._playerPlugin.trackBufferComplete();
};

버퍼 완료(2.x)

VideoAnalyticsProvider.prototype._onBufferComplete = function() { 
    console.log('Player event: BUFFER_COMPLETE');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.BufferComplete);
};

재생 완료

1.x API 2.x API
VideoPlayerPlugin.trackComplete() MediaHeartbeat.trackComplete()

재생 완료(1.x)

VideoAnalyticsProvider.prototype._onComplete = function() { 
    console.log('Player event: COMPLETE');
    this._playerPlugin.trackComplete(function() { 
        console.log( "The completion of the content has been tracked.");
    });
};

재생 완료(2.x)

VideoAnalyticsProvider.prototype._onComplete = function() { 
    console.log('Player event: COMPLETE');
    this._mediaHeartbeat.trackComplete();
};

VHL 코드 비교: 광고 재생

광고 시작

VHL 1.x VHL 2.x
VideoPlayerPlugin.trackAdStart() MediaHeartbeat.createAdBreakObject()
VideoPlayerPluginDelegate.getAdBreakInfo() MediaHeartbeat.createAdObject()
VideoPlayerPluginDelegate.getAdInfo() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.AdBreakStart)
MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.AdStart)

광고 시작(1.x)

VideoAnalyticsProvider.prototype._onAdStart = function() { 
    console.log('Player event: AD_START');
    this._playerPlugin.trackAdStart();
};
SampleVideoPlayerPluginDelegate.prototype.getAdInfo = function() { 
    return this._player.getAdInfo(); 
};

광고 시작(2.x)

VideoAnalyticsProvider.prototype._onAdStart = function() { 
    console.log('Player event: AD_START');
    var adContextData = {};

    // AdBreak Info - getting the adBreakInfo from player and creating AdBreakInfo Object from MediaHeartbeat 
    var _adBreakInfo = this._player.getAdBreakInfo();
    var adBreakInfo = MediaHeartbeat.createAdBreakObject(_adBreakInfo.name, _adBreakInfo.position, _adBreakInfo.startTime);

    // Ad Info - getting the adInfo from player and creating AdInfo Object from MediaHeartbeat 
    var _adInfo = this._player.getAdInfo();
    var adInfo = MediaHeartbeat.createAdObject(_adInfo.name, _adInfo.id, _adInfo.position, _adInfo.length);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdBreakStart, adBreakInfo);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdStart, adInfo, adContextData);
};

표준 광고 메타데이터

1.x API 2.x API
AdMetadataKeys() MediaHeartbeat.createAdObject()
AdobeAnalyticsPlugin.setAdMetadata() MediaHeartbeat.trackAdStart()

표준 광고 메타데이터(1.x)

VideoAnalyticsProvider.prototype._onAdStart = function() {
    console.log('Player event: AD_START');
    var contextData = {};

    // setting Standard Ad Metadata 
    contextData[AdMetadataKeys.ADVERTISER] = "sample advertiser";
    contextData[AdMetadataKeys.CAMPAIGN_ID] = "sample campaign";
    contextData[AdMetadataKeys.CREATIVE_ID] = "sample creative";
    contextData[AdMetadataKeys.CREATIVE_URL] = "sample url";
    contextData[AdMetadataKeys.SITE_ID] = "sample site";
    contextData[AdMetadataKeys.PLACEMENT_ID] = "sample placement";
    this._aaPlugin.setAdMetadata(contextData);
    this._playerPlugin.trackAdStart();
};

표준 광고 메타데이터(2.x)

VideoAnalyticsProvider.prototype._onAdStart = function() { 
    console.log('Player event: AD_START');
    var adContextData = { };

    // AdBreak Info - getting the adBreakInfo from player and creating AdBreakInfo Object from MediaHeartbeat 
    var _adBreakInfo = this._player.getAdBreakInfo();
    var adBreakInfo = MediaHeartbeat.createAdBreakObject(_adBreakInfo.name, _adBreakInfo.position, _adBreakInfo.startTime);

    // Ad Info - getting the adInfo from player and creating AdInfo Object from MediaHeartbeat 
    var _adInfo = this._player.getAdInfo();
    var adInfo = MediaHeartbeat.createAdObject(_adInfo.name, _adInfo.id, _adInfo.position, _adInfo.length);

    // Set standard Ad Metadata 
    var standardAdMetadata = {};
    standardAdMetadata[MediaHeartbeat.AdMetadataKeys.ADVERTISER] = "Sample Advertiser";
    standardAdMetadata[MediaHeartbeat.AdMetadataKeys.CAMPAIGN_ID] = "Sample Campaign";
    adInfo.setValue(MediaHeartbeat.MediaObjectKey.StandardAdMetadata, standardAdMetadata);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdBreakStart, adBreakInfo);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdStart, adInfo, adContextData);
};
노트

VHL 2.0에서는 AdobeAnalyticsPlugin.setVideoMetadata() API를 통해 표준 광고 메타데이터를 설정하는 대신, AdMetadataMediaObject.MediaObjectKey.StandardVideoMetadata를 통해 표준 광고 메타데이터를 설정합니다.

사용자 지정 광고 메타데이터

1.x API 2.x API
AdobeAnalyticsPlugin.setAdMetadata() MediaHeartbeat.createAdObject()
MediaHeartbeat.trackAdStart()

사용자 지정 광고 메타데이터(1.x)

VideoAnalyticsProvider.prototype._onAdStart = function() { 
    console.log('Player event: AD_START');
    var contextData = {};

    // Setting Standard Ad Metadata 
    contextData[AdMetadataKeys.ADVERTISER] = "sample advertiser";
    contextData[AdMetadataKeys.CAMPAIGN_ID] = "sample campaign";
    contextData[AdMetadataKeys.CREATIVE_ID] = "sample creative";
    contextData[AdMetadataKeys.CREATIVE_URL] = "sample url";
    contextData[AdMetadataKeys.SITE_ID] = "sample site";
    contextData[AdMetadataKeys.PLACEMENT_ID] = "sample placement";
    this._aaPlugin.setAdMetadata(contextData);
    this._playerPlugin.trackAdStart();
};

사용자 지정 광고 메타데이터(2.x)

VideoAnalyticsProvider.prototype._onAdStart = function() { 
    console.log('Player event: AD_START');
    var adContextData = { 
        affiliate: "Sample affiliate", 
        campaign: "Sample ad campaign" 
    };

    // AdBreak Info - getting the adBreakInfo from player and creating AdBreakInfo Object from MediaHeartbeat 
    var _adBreakInfo = this._player.getAdBreakInfo();
    var adBreakInfo = MediaHeartbeat.createAdBreakObject(_adBreakInfo.name, _adBreakInfo.position, _adBreakInfo.startTime);

    // Ad Info - getting the adInfo from player and creating AdInfo Object from MediaHeartbeat 
    var _adInfo = this._player.getAdInfo();
    var adInfo = MediaHeartbeat.createAdObject(_adInfo.name, _adInfo.id, _adInfo.position, _adInfo.length);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdBreakStart, adBreakInfo);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdStart, adInfo, adContextData);
};
노트

VHL 2.0에서는 AdobeAnalyticsPlugin.setVideoMetadata API를 통해 사용자 지정 광고 메타데이터를 설정하는 대신, MediaHeartbeat.trackAdStart() API를 통해 표준 광고 메타데이터를 설정합니다.

광고 건너뛰기

1.x API 2.x API
AdobeAnalyticsPlugin.setAdMetadata() MediaHeartbeat.createAdObject()
MediaHeartbeat.trackAdStart()

광고 건너뛰기(1.x)

SampleVideoPlayerPluginDelegate.prototype.getAdInfo = function() { 
    return this._player.getAdInfo();
};

광고 건너뛰기(2.x)

VideoAnalyticsProvider.prototype._onAdSkip = function() { 
    console.log('Player event: AD_SKIP');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdSkip);
};
노트

VHL 1.5.X API에서 getAdinfo()getAdBreakInfo()는 플레이어가 광고 브레이크 경계를 벗어나는 경우 null을 반환해야 합니다.

광고 완료

1.x API 2.x API
VideoPlayerPlugin.trackAdComplete() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.AdComplete)
MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.AdBreakComplete)

광고 완료(1.x)

VideoAnalyticsProvider.prototype._onAdComplete = function() { 
    console.log('Player event: AD_COMPLETE');
    this._playerPlugin.trackAdComplete();
};

광고 완료(2.x)

VideoAnalyticsProvider.prototype._onAdComplete = function() { 
    console.log('Player event: AD_COMPLETE');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdComplete);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.AdBreakComplete);
};

VHL 코드 비교: 챕터 재생

챕터 시작

VHL 1.x VHL 2.x
VideoPlayerPluginDelegate.getChapterInfo() MediaHeartbeat.createChapterObject
VideoPlayerPlugin.trackChapterStart() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.ChapterStart)

챕터 시작(1.x)

VideoAnalyticsProvider.prototype._onChapterStart = function() { 
    console.log('Player event: CHAPTER_START');
    this._playerPlugin.trackChapterStart();
};
SampleVideoPlayerPluginDelegate.prototype.getChapterInfo = function() { 
    return this._player.getChapterInfo();
};

챕터 시작(2.x)

VideoAnalyticsProvider.prototype._onChapterStart = function() { 
    console.log('Player event: CHAPTER_START');
    var chapterContextData = { };

    // Chapter Info - getting the chapterInfo from player and creating ChapterInfo Object from MediaHeartbeat 
    var _chapterInfo = this._player.getChapterInfo();
    var chapterInfo = MediaHeartbeat.createChapterObject(_chapterInfo.name, _chapterInfo.position, _chapterInfo.length, _chapterInfo.startTime);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.ChapterStart, chapterInfo, chapterContextData);
};

챕터 건너뛰기

1.x API 2.x API
VideoPlayerPluginDelegate.getChapterInfo() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.ChapterSkip)

챕터 건너뛰기(1.x)

SampleVideoPlayerPluginDelegate.prototype.getChapterInfo = function() { 
    return this._player.getChapterInfo();
};
노트

VHL 1.5.X API에서 getChapterinfo()는 플레이어가 챕터 경계를 벗어나는 경우 null을 반환해야 합니다.

챕터 건너뛰기(2.x)

VideoAnalyticsProvider.prototype._onChapterSkip = function() { 
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.ChapterSkip);
};

챕터 사용자 지정 메타데이터

1.x API 2.x API
VideoPlayerPlugin.trackChapterStart() MediaHeartbeat.createChapterObject()
AdobeAnalyticsPlugin.setChapterMetadata() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.ChapterStart)

챕터 사용자 지정 메타데이터(1.x)

VideoAnalyticsProvider.prototype._onChapterStart = function() { 
    console.log('Player event: CHAPTER_START');
    this._aaPlugin.setChapterMetadata({ 
        segmentType: "Sample segment type" 
    });
    this._playerPlugin.trackChapterStart();
};

챕터 사용자 지정 메타데이터(2.x)

VideoAnalyticsProvider.prototype._onChapterStart = function() { 
    console.log('Player event: CHAPTER_START');
    var chapterContextData = { 
        segmentType: "Sample segment type" 
    };

    // Chapter Info - getting the chapterInfo from player and creating ChapterInfo Object from MediaHeartbeat 
    var _chapterInfo = this._player.getChapterInfo();
    var chapterInfo = MediaHeartbeat.createChapterObject(_chapterInfo.name, _chapterInfo.position, _chapterInfo.length, _chapterInfo.startTime);
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.ChapterStart, chapterInfo, chapterContextData);
};

챕터 완료

1.x API 2.x API
trackChapterComplete() trackEvent(MediaHeartbeat.Event.ChapterComplete)

챕터 전체(1.x)

VideoAnalyticsProvider.prototype._onChapterComplete = function() { 
    console.log('Player event: CHAPTER_COMPLETE');
    this._playerPlugin.trackChapterComplete();
};

챕터 전체(2.x)

VideoAnalyticsProvider.prototype._onChapterComplete = function() { 
    console.log('Player event: CHAPTER_COMPLETE');
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.ChapterComplete);
};

VHL 코드 비교: 기타 이벤트

비트율 변경

VHL 1.x VHL 2.x
VideoPlayerPlugin.trackBitrateChange() MediaHeartbeat.trackEvent(

  MediaHeartbeat.Event.BitrateChange)

비트율 변경(1.x)

VideoAnalyticsProvider.prototype._onBitrateChange = function() { 
    console.log('Player event: BITRATE_CHANGE');

    // Update getQosInfo to return the updated bitrate 
    this._playerPlugin.trackBitrateChange();
};

비트율 변경(2.x)

VideoAnalyticsProvider.prototype._onBitrateChange = function() { 
    console.log('Player event: BITRATE_CHANGE');

    // Update getQosObject to return the updated bitrate 
    this._mediaHeartbeat.trackEvent(MediaHeartbeat.Event.BitrateChange);
};

비디오 재개

1.x API 2.x API
VideoInfo.resumed() MediaObject()
VideoPlayerPluginDelegate.getVideoInfo() MediaHeartbeat.trackSessionStart()
VideoPlayerPlugin.trackVideoLoad()

비디오 재개(1.x)

this._videoInfo.resumed=true;
VideoPlayer.prototype.getVideoInfo = function() { 
    this._videoInfo.playhead = vTime;
    return this._videoInfo;
};

비디오 재개(2.x)

VideoAnalyticsProvider.prototype._onLoad = function() { 
    console.log('Player event: MEDIA_LOAD');
    var contextData = {};
    var videoInfo = this._player.getVideoInfo();
    var mediaInfo = MediaHeartbeat.createMediaObject(videoInfo.playerName, videoInfo.id, videoInfo.length, videoInfo.streamType);
    mediaInfo.setValue(MediaHeartbeat.MediaObjectKey.VideoResumed, true);
    this._mediaHeartbeat.trackSessionStart(mediaInfo, contextData);
};

2.x를 사용하여 비디오를 추적하는 방법에 대한 자세한 내용은 코어 비디오 재생 추적을 참조하십시오.

이 페이지에서는

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now