Track buffering on iOS
Last update: November 11, 2022
- Topics:
- Media Analytics
CREATED FOR:
- User
- Admin
- Developer
The following instructions provide guidance for implementation across all 2.x SDKs.
If you are implementing a 1.x version of the SDK, you can download the 1.x Developers Guides here: Download SDKs.
Buffer tracking constants
Constant name | Description |
---|---|
ADBMediaHeartbeatEventBufferStart | Constant for tracking Buffer Start event |
ADBMediaHeartbeatEventBufferComplete | Constant for tracking Buffer Complete event |
Implement buffering
-
Listen for the playback buffering events from media player, and on buffer start event notification, track buffering using the
BufferStart
event:- (void)onBufferStart:(NSNotification *)notification { [_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventBufferStart mediaObject:nil data:nil]; }
-
On buffer complete notification from the media player, track the end of buffering using the
BufferComplete
event:- (void)onBufferComplete:(NSNotification *)notification { [_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventBufferComplete mediaObject:nil data:nil]; }
See the tracking scenario VOD playback with buffering for more information.
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb