# I want to retrieve buffer length data from player api

**URL:** <https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559>\
**Category:** Support\
**Tags:** bitmovin-player, bitmovin\
**Created:** [January 5, 2024, 9:38am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559 "2024-01-05T09:38:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumedhmeher.pophali](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sumedhmeher.pophali](https://community.bitmovin.com/u/sumedhmeher.pophali)\
**Post date:** [January 5, 2024, 9:38am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/1 "2024-01-05T09:38:48Z")

</div>

Could you please provide a way to fetch the buffer length from bitmovin player?

---

<div class="post-metadata">

**Author:** ![JamesVarndell](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/jamesvarndell/32/186_2.png) [@JamesVarndell](https://community.bitmovin.com/u/JamesVarndell)\
**Post date:** [January 5, 2024, 9:56am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/2 "2024-01-05T09:56:15Z")

</div>

Hey Sumedhmeher, thanks for the question.

You can use our APIs to get the player’s current buffer level. Here’s are API calls you need:

- Web: [PlayerBufferAPI | Bitmovin Player API 8.146.0](https://cdn.bitmovin.com/player/web/8/docs/interfaces/Core.PlayerBufferAPI.html)
- iOS/tvOS: [BMPBufferApi Protocol Reference](https://cdn.bitmovin.com/player/ios/3/docs/Protocols/BMPBufferApi.html)
- Android/Android TV: [BufferApi](https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.buffer/-buffer-api/index.html)

These allow you to get the current buffer level. It’s also possible to set a target buffer level if you find your viewers need more buffer to get smooth playback.

---

<div class="post-metadata">

**Author:** ![sumedhmeher.pophali](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sumedhmeher.pophali](https://community.bitmovin.com/u/sumedhmeher.pophali)\
**Post date:** [January 5, 2024, 10:06am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/3 "2024-01-05T10:06:33Z")

</div>

Hey James,

Thank you!!!

---

<div class="post-metadata">

**Author:** ![sumedhmeher.pophali](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sumedhmeher.pophali](https://community.bitmovin.com/u/sumedhmeher.pophali)\
**Post date:** [January 16, 2024, 7:12am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/4 "2024-01-16T07:12:25Z")

</div>

Hey James,

We have tried logging the buffer level in milliseconds. The value seems to be on the higher side even though we don’t have the buffer available.

Could you please elaborate on the value which we receive from the buffer level api?

Please find the below log for your reference,  
Buffer Length (ms)= 1705388, time in min:ss = 28:25

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)\
**Post date:** [January 16, 2024, 11:02am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/5 "2024-01-16T11:02:22Z")

</div>

Hey @sumedhmeher.pophali,

The Bitmovin Player generally uses seconds in its APIs, events, and configs, not milliseconds.

However, the value you posted still looks pretty high. Can you please share more details, specifically:

1. Which Bitmovin Player SDK (Web/Web-based platforms, Android/AndroidTV, iOS/tvOS, Roku) are you using?
2. Which Bitmovin Player version are you seeing this with?
3. Can you share a sample site/app where this can be observed? Alternatively, I’d need the Player Configuration and Source Configuration so that I can test it and try to replicate it.

---

<div class="post-metadata">

**Author:** ![sumedhmeher.pophali](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sumedhmeher.pophali](https://community.bitmovin.com/u/sumedhmeher.pophali)\
**Post date:** [January 17, 2024, 4:02am UTC](https://community.bitmovin.com/t/i-want-to-retrieve-buffer-length-data-from-player-api/2559/6 "2024-01-17T04:02:27Z")

</div>

Hey Daniel,

We are converting the seconds value to millisecond internally in our code.

Please find the below responses to the queries,

1. Which Bitmovin Player SDK (Web/Web-based platforms, Android/AndroidTV, iOS/tvOS, Roku) are you using? → Android/Android TV

2. Which Bitmovin Player version are you seeing this with? → 3.43.0

3. Can you share a sample site/app where this can be observed? Alternatively, I’d need the Player Configuration and Source Configuration so that I can test it and try to replicate it.  
 →   
PlayerConfig(key = playbackInfo.playerLicense).apply {  
bufferConfig = BufferConfig(BufferMediaTypeConfig(6.0))  
playbackConfig.isTunneledPlaybackEnabled = true  
playbackConfig.isTimeShiftEnabled = playbackInfo.isTSBEnabled  
adaptationConfig.initialBandwidthEstimateOverride = 12000000  
liveConfig.minTimeShiftBufferDepth = -15.0  
}

DASH URL which we are using in source config works only on specific network. I am not sure if you would be to reproduce on local setup.
