Track buffering on Roku track-buffering-on-roku

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
Constant for tracking Buffer Start event
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.

    code language-none
    bufferInfo = {}
    bufferContextData = {}
    ADBMobile().mediaTrackEvent(MEDIA_BUFFER_START, bufferInfo, bufferContextData)
  2. On buffer complete notification from the media player, track the end of buffering using the BufferComplete event.

    code language-none
    bufferInfo = {}
    bufferContextData = {}
    ADBMobile().mediaTrackEvent(MEDIA_BUFFER_COMPLETE, bufferInfo, bufferContextData)

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