accessLog
#HLS
概要
accessLog は、AVPlayerItem による動画の視聴セッションの履歴情報を提供するログ。元々は nil だが、再生が始まると AVPlayerItemNewAccessLogEntry 通知が送信され、この通知が送信された時点で accessLog が生成される。
https://developer.apple.com/documentation/avfoundation/avplayeritem/1388499-accesslog
accessLog に含まれる情報
accessLog は、AVPlayerItemAccessLog オブジェクトを返す。さらにこれは複数の AVPlayerItemAccessLogEvent を events として保持している。
各 event が保持している情報としては、以下がある。全ての値の初期値は、慣例により負の値か nil に設定されている。
table:accessLog
パラメータ 内容
uri Playback Item の URI
serverAddress Media Segment を最後に送信したサーバの IP アドレス
numberOfServerAddressChanges
meaidRequestsWWAN WWAN 経由で読み込んだネットワークリクエストの数
transferDuration
numberOfBytesTransferred
numberOfMediaRequests
playbackStartDate
playbackSessionID
playbackStartOffset
playbackType
startupTime
durationWatched
numberOfDroppedVideoFrames
numberOfStalls
segmentsDownloadedDuration
downloadOverdue
https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslog
accessLog にイベントが追加されるタイミング
追加されるタイミングは、以下の2種類になる。
Variant Stream の更新時
再生をシークした時
新しいイベントが追加されるタイミングで、古いイベントが immutable になる。最新のイベントは mutable で、常に更新され続ける。
参考
https://developer.apple.com/videos/play/wwdc2018/502/