(以下內容均翻譯自英文版文件,最新資訊及內容敬請切換至英文語系參考原文)
要接收播放事件,可通過附加 didReceiveOnEvent
處理程序來整合 SDK 中的 PlaybackEvent 回調函式:
// Add listener self.player.add(listener: self) // Player event delegate func player(_ player: UniPlayer, didReceiveOnEvent event: UniEvent) { debugPrint("Received event=\(event.name)") }
事件名稱 |
事件定義 | 屬性名稱 | 值類型 |
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_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 | ||
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 | ||
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 |