android MediaPlayerBuffering how to?

This forum is about all development around libVLC.
adrianc1982
New Cone
New Cone
Posts: 5
Joined: 20 Oct 2015 00:30

android MediaPlayerBuffering how to?

Postby adrianc1982 » 30 Nov 2015 03:27

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; } }

adrianc1982
New Cone
New Cone
Posts: 5
Joined: 20 Oct 2015 00:30

Re: android MediaPlayerBuffering how to?

Postby adrianc1982 » 15 Dec 2015 06:46

are there any other forums that discuss libvlc for android?

tguillem
Developer
Developer
Posts: 87
Joined: 04 May 2015 16:38
VLC version: ALL
Operating System: Linux/WIndows/Mac OS

Re: android MediaPlayerBuffering how to?

Postby tguillem » 28 Jun 2016 09:36

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 25 guests