Page 1 of 1

android MediaPlayerBuffering how to?

Posted: 30 Nov 2015 03:27
by adrianc1982
hello, i would like to open an http stream and get the buffering percentage.

Im really lost on how to accomplish this, can anyone point me in the right direction or paste a snippet of code?

Currently i only have something like this:

Code: Select all

public void onEvent(MediaPlayer.Event event) { VideoActivity player = mOwner.get(); switch(event.type) { case MediaPlayer.Event.EndReached: Log.d(TAG, "MediaPlayerEndReached"); player.releasePlayer(); break; case MediaPlayer.Event.Playing: case MediaPlayer.Event.Paused: case MediaPlayer.Event.Stopped: case MediaPlayer.Event.Buffering: default: break; } }

Re: android MediaPlayerBuffering how to?

Posted: 15 Dec 2015 06:46
by adrianc1982
are there any other forums that discuss libvlc for android?

Re: android MediaPlayerBuffering how to?

Posted: 28 Jun 2016 09:36
by tguillem
Here is a sample:

Code: Select all

case MediaPlayer.Event.Buffering: float percent = event.getBuffering(); /* from 0.0f to 100f */ .... break;
Note that getBuffering() method was added recently (maybe 1 or 2 months ago), so you have to up date vlc-android git