(以下內容均翻譯自英文版文件,最新資訊及內容敬請切換至英文語系參考原文)
要接收播放事件,可通過附加 onPlayLogFired
處理程序來整合 SDK 中的 PlaybackEvent 回調函式:
const player = createPlayer('player-container', { license, // license is not required when testing in local development environment source: [ { type: 'application/dash+xml', src: dashUrl, }, { type: 'application/x-mpegurl', src: hlsUrl, } ], onPlayLogFired: (eventName, data) = { // Your own log service integration here console.debug(eventName, data) } })
播放事件
事件名稱 |
事件定義 |
屬性名稱 | 值類型 |
play | 如果調用了播放 api,將發送以下事件 在 Seekbar 上的位置。以秒為單位。 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
pause | 如果調用了播放 api,將發送以下事件 在 Seekbar 上的位置。以秒為單位。 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
seek | 如果調用了播放 api,將發送以下事件 在 Seekbar 上的位置。以秒為單位。 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
rewind | 如果調用了播放 api,將發送以下事件 在 Seekbar 上的位置。以秒為單位。 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
forward | 如果調用了播放 api,將發送以下事件 在 Seekbar 上的位置。以秒為單位。 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_began_player_loading | 播放器開始加載影片的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_began_player_ startup_time |
播放器開始加載清單的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_began_video_ startup_time |
顯示第一幀畫面的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_video_began | 影片緩衝結束時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_video_paused | 暫停播放的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_video_buffering_ began |
播放過程中緩衝狀態開始的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_video_buffering_ ended |
播放過程中緩衝狀態結束的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_video_ended | 播放結束的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_seeking_began | 播放過程中開始跳轉的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_seeking_ended | 播放過程中跳轉結束的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_error_occurred | 播放器的錯誤代碼。每個平台應該有不同的錯誤代碼。 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
errorcode | string | ||
playback_ad_began | AD 開始的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_ad_ended | AD 結束的時間 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
current_position | float | ||
playback_streaming_quality_ change_download |
播放器切換 profile (ABR) | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
bitrate (kbps) | int | ||
framerate | float | ||
width | int | ||
height | int | ||
playback_streaming_quality_ change_render |
之前 profile 的緩衝片段已全部播放完畢,開始播放切換後的 profile | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
bitrate (kbps) | int | ||
width | int | ||
height | int | ||
quality_setting_change | 使用者切換 profile | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
quality_name | string | ||
min_height | int | ||
max_height | int | ||
min_width | int | ||
max_width | int | ||
max_bitrate | int | ||
min_bitrate | int | ||
max_framerate | float | ||
min_framerate | float | ||
speed_setting_change | 使用者更改速度 0.5x, 1x, 2x, 4x... |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_speed | float | ||
current_position | float | ||
playback_speed_change | 播放過程中速度發生變化: 0.5x, 1x, 2x, 4x... |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
playback_speed | float | ||
current_position | float | ||
audio_track_setting_change |
使用者觸發音軌切換操作。 音軌語言由 ISO 639-1、ISO 3166(可選)定義 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
lang | string | ||
playback_audio_track_change |
播放過程中音軌更改的時間。 音軌語言由 ISO 639-1、ISO 3166(可選)定義 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
lang | string | ||
subtitle_setting_change | 使用者觸發字幕更改操作。
字幕語言由 ISO 639-1、ISO 3166(可選)定義 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
lang | string | ||
playback_subtitle_change |
播放過程中字幕更改的時間。 字幕語言由 ISO 639-1、ISO 3166(可選)定義 |
player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
lang | string | ||
audio_volume_setting_change | 用戶觸發音量調節 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
volume | float | ||
playback_audio_volume_ change |
在播放過程中調節音量 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
volume | float | ||
audio_mute_setting_change | 用戶觸發音訊靜音/解除靜音開關 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
muted | bool | ||
playback_audio_mute_change | 在播放過程中切換靜音/解除靜音狀態。 | player_name | string |
playback_module_version | string | ||
system_time | date time | ||
user_id | string | ||
muted | bool |