使用 MediaPlayer 的流式音频进度条
有没有办法用进度条显示歌曲播放的进度以及可能的分钟和秒长度?我希望它出现在状态栏中,但我知道如何使用自定义通知布局来做到这一点,因此如果有人引导我朝正确的方向前进,那就太好了。要么有一些代码或代码示例,谢谢。
Is there a way to show the progress of a song playing with a progress bar and possibly length in terms of minutes and seconds? I would like it in the status bar, but I know how to do that using a custom notification layout so if someone steers me in the right direction that would be nice. Either with some code or code examples, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,您必须将播放器/mp3 的进度与NotificationManager 类结合起来。有一个问题可能有你需要的..另请查看基本的进度 酒吧。当然,请阅读 ProgressBar 和 状态栏
要获取播放歌曲的剩余时间,我知道 VLC 播放器我的 SlimDevices 服务器没有这样做。如果你想通过流媒体来做到这一点,你将必须获得歌曲的长度,然后实现你自己的计时器,因为我很确定流媒体音乐不会给你当前播放歌曲的剩余时间。
You obviously have to tie in with the NotificationManager classes the progress of the player/mp3. There was a question on SO that may have what you need... Also take a look at this for just basic Progress bar. And of course read the documentation on ProgressBar and Status Bar
To get the minutes left to play song, I know VLC player doesn't do that for my SlimDevices server. If you want to do this from via streaming you will have to get the length of the song, then implement your own timer as I am pretty sure that streaming music does not give you the current time left to play song.