Track buffering on Android

Last update: 2022-11-11
  • Created for:
  • User
    Admin
    Developer

The following instructions provide guidance for implementation across all 2.x SDKs.

IMPORTANT

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    
MediaHeartbeat.Event.BufferStart Constant for tracking Buffer Start event
MediaHeartbeat.Event.BufferComplete Constant for tracking Buffer Complete event

Implement buffering

  1. Listen for the playback buffering events from media player, and on buffer start event notification, track buffering using the BufferStart event:

    public void onBufferStart(Observable observable, Object data) {
        _heartbeat.trackEvent(MediaHeartbeat.Event.BufferStart, null, null);
    }
    
  2. On buffer complete notification from the media player, track the end of buffering using the BufferComplete event:

    public void onBufferComplete(Observable observable, Object data) {
        _heartbeat.trackEvent(MediaHeartbeat.Event.BufferComplete,null, null);
    }
    

See the tracking scenario VOD playback with buffering for more information.

On this page