Reputation: 9228
An HLS (m3u8) file references mpeg-ts files. During its playback in iOS' AVPlayer, how can i determine the currently playing mpeg-ts URI?
Upvotes: 14
Views: 4186
Reputation: 201
If your looking for a reference to the URI of the currently downloading TS, it's not available. You can get the URI of the stream for the current bit-rate by looking at the current AVPlayerItem
's -accessLog
.
E.g.:
[[[player currentItem] accessLog] events]
It's an NSArray
of AVPlayerItemAccessLogEvent
's.
But it's not going to give you the URI of the TS per se. You may just have to calculate the current TS by where the playhead is currently at in relation to the duration as well as the segment size.
Upvotes: 3