MediaPlayer.getDuration() 在 Android 2.1 中给出错误值或 0
我正在 android 中开发一个流音频应用程序。我得到了 Android 媒体播放器中存在以下问题。
1 MediaPlayer.getDuration() 方法有时返回 0 但仍然在播放歌曲。 2 有时 MediaPlayer.getDuration() 方法返回错误的持续时间。 **更多信息** 1 我将文件从服务器缓存到SD卡并且 通过本地 http 将其流式传输到媒体播放器。 2 所有流式传输的歌曲都只是 mp3 文件。 3 网络良好时给出正确的持续时间。 如果你们发现任何修复,请指导我找到可能的解决方案。 提前致谢。
I am working on a streaming audio application in android.I am getting
the following issues in the android media player.1 MediaPlayer.getDuration() method returning 0 at sometime but still its playing the song. 2 some times MediaPlayer.getDuration() method returning wrong duration. **Some more info** 1 I am caching the files from the server to the sdcard and streaming it to the media player through local http. 2 All songs which is streamed is only mp3 files. 3 Gives Correct duration when the network is good. If you guys find any fixes please direct me to the possible solution. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论