搜寻栏中显示的音乐缓冲水平 [英] Buffered level of music showing in seekbar

查看:82
本文介绍了搜寻栏中显示的音乐缓冲水平的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.如您所见,我想显示在Android音乐播放器中流式传输到用户的媒体的缓冲级别.
我想针对此问题的解决方案是:
我应该创建一个透明背景的搜索栏和一个进度栏,还是要与搜索栏重叠的进度栏,而progreesbar应该显示音乐的缓冲级别.

Hi there. As you can see i want to show buffered level of media that stream to user in android music player.
The solution i imagine for this issue is that:
Should i create a seekbar and a progressbar with transparent background and overlap progressbar to seek bar, whereas progreesbar showing buffered level of music.

但我不确定该策略.有谁可以帮助我以最佳方式实现这一目标.

but im not sure about this strategy. is anyone to help me for best way to reaching the goal at this issue.

推荐答案

首先应将OnBufferingUpdateListener实施为活动,然后将onBufferingUpdate设置为此:

First of all should implements OnBufferingUpdateListener to activity then set onBufferingUpdate ike this:

public void onBufferingUpdate(MediaPlayer arg0, int percent) {
    /** Method which updates the SeekBar secondary progress by current song loading from URL position*/
    seekBarProgress.setSecondaryProgress(percent);
}

这篇关于搜寻栏中显示的音乐缓冲水平的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆