映像進行イベントのトラッキング

    映像進行イベントのトラッキング


    記事の要約

    このページでは、messageCallbackおよびEVENT_LOGを使用してビデオの進行に関連するイベントを受信する方法について説明します。

    1. ビデオプレーヤーは「ON_PLAYER_STARTED」で開始します。

    2. 表示された秒数は、「EVENT_LOG」を介して追跡できます。名前は「player_active_seconds」です。

    messageCallback

    var messageCallback = {
      ON_PLAYER_STARTED: (payload)=> {
            //immediately fired once user getting into the player
            console.log('ON_PLAYER_STARTED',payload)
          },
      EVENT_LOG: (payload) => {
            // console.log("event log fired", payload.name);
            // console.log("payload", payload);
            
            switch (payload.name) {
              case "player_on_foreground":
                //player came to foreground and active
                console.log("player_on_foreground",payload);
                break;
              case "player_on_background":
                //player went to background
                console.log("player_on_background",payload);
                break;
              case "player_active_seconds":
                //this event fired every payload.parameter.interval milliseconds. typically per 3seconds. 
                //you can track video progress by either activatedDuration or videoCurrentTime upon your needs
                console.log("player_active_seconds",payload);
                break;
            }
            
          },
    }

    ON_PLAYER_STARTED payload

    Property

    Type

    Description

    ak

    string

    Accesskey

    ck

    string

    campaignKey

    isPreview

    boolean

    プレビューであるかどうかを示します

    EVENT_LOG payload

    Property

    Type

    Description

    name

    string

    イベントの名前

    feature

    "click" | "action" | “show”

    イベントのタイプ

    parameter

    JSON

    イベントの参照オブジェクト

    campaignKey

    string

    キャンペーンの一意のキー


    Video progress related Events: full list of event

    name

    feature

    parameter

    Description

    player_on_foreground

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがforegroundに表示されました

    • activatedAt

      • プレーヤーのアクティベーションのタイムスタンプ

    • activatedDuration

      • プレーヤーのアクティブな状態の期間

    • mode

      • 'LIVE' | 'REPLAY'

    • videoCurrentTime 

      • 現在の再生時間のタイムスタンプ

    player_on_background

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがバックグラウンドに移りました

    • activatedAt

      • プレーヤーのアクティベーションのタイムスタンプ

    • activatedDuration

      • プレーヤーのアクティブな状態の期間

    • mode

      • 'LIVE' | 'REPLAY'

    • videoCurrentTime

      • 現在の再生時間のタイムスタンプ"

    player_active_seconds

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "interval": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがアクティブな場合のコール

    • activatedAt

      • プレーヤーのアクティベーションのタイムスタンプ

    • activatedDuration

      • プレーヤーのアクティブな状態の期間

    • mode

      • 'LIVE' | 'REPLAY'

    • videoCurrentTime

      • 現在の再生時間のタイムスタンプ

    • Interval

      • コールの時間間隔

    このページでは、messageCallbackおよびEVENT_LOGを使用してビデオの進行に関連するイベントを受信する方法について説明します。

    messageCallback - Definition

    var messageCallback = {
      EVENT_LOG: (payload) => {
            // console.log("event log fired", payload.name);
            // console.log("payload", payload);
            
            switch (payload.name) {
              case "player_on_foreground":
                //player came to foreground and active
                console.log("player_on_foreground",payload);
                break;
              case "player_on_background":
                //player went to background
                console.log("player_on_background",payload);
                break;
              case "player_active_seconds":
                //this event fired every payload.parameter.interval microSeconds. typically per 5seconds. 
                //you can track video progress by either activatedDuration or videoCurrentTime upon your needs
                console.log("player_active_seconds",payload);
                break;
            }
            
            
          },
    }

    payload

    Property

    Type

    Description

    name

    string

    Name of event

    feature

    "click" | "action" | “show”

    Type of event

    parameter

    JSON

    Reference object of the event

    campaignKey

    string

    Unique Key of campaign


    Video progress related Events:   full list of event

    name

    feature

    parameter

    Description

    player_on_foreground

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがforegroundに表示されました

    activatedAt : プレーヤーのアクティベーションのタイムスタンプ

    activatedDuration: プレーヤーのアクティブな状態の期間

    mode: 'LIVE' | 'REPLAY'

    videoCurrentTime: 現在の再生時間のタイムスタンプ" "プレーヤーがバックグラウンドに移りました

    player_on_background

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがバックグラウンドに移りました

    activatedAt: プレーヤーのアクティベーションのタイムスタンプ

    activatedDuration: プレーヤーのアクティブな状態の期間

    mode: 'LIVE' | 'REPLAY'

    videoCurrentTime: 現在の再生時間のタイムスタンプ"

    player_active_seconds

    show

    { "activatedAt": Number,

    "activatedDuration": Number,

    "interval": Number,

    "mode": String,

    "videoCurrentTime": Number }

    プレーヤーがアクティブな場合のコール

    activatedAt: プレーヤーのアクティベーションのタイムスタンプ

    activatedDuration: プレーヤーのアクティブな状態の期間

    mode: 'LIVE' | 'REPLAY'

    videoCurrentTime: 現在の再生時間のタイムスタンプ

    Interval: このコールの時間間隔