使用seekbar在android中搜索.ogg文件

时间:2022-05-08 19:00:26

I've been researching about this topic for a long time now. I saw different solution, but I couldnt get it. could someone please help me solve this problem? I could play the audio file with a button but i could never get the seekbar to work as if you're using a mp3 player app on android where you can seek through the music. there are several problems:

我很长一段时间一直在研究这个话题。我看到了不同的解决方案,但我无法得到它。有人可以帮我解决这个问题吗?我可以用按钮播放音频文件,但我永远不会让搜索栏工作,就像你在Android上使用MP3播放器应用程序,你可以通过音乐寻找。有几个问题:

  1. the seekbar wont update
  2. 搜索栏不会更新
  3. the music wont update as if there was no connection within the seekbar and the music itself.
  4. 音乐不会更新,好像在搜索栏和音乐本身之间没有连接。
  5. i could get it to connect, but the seekbar still wont update and whenever i try to move it, it will go back to the left (where it started). PS: i already deleted this from my pc because of frustration. hahahaha!
  6. 我可以让它连接,但搜索栏仍然不会更新,每当我尝试移动它,它将返回到左侧(它开始的地方)。 PS:因为沮丧,我已经从我的电脑上删除了这个。哈哈哈哈!

Thanks in advance to anyone who can help.

提前感谢任何可以提供帮助的人。

1 个解决方案

#1


0  

Are you sure your activity implements OnSeekBarChangeListener correctly ? Inside onProgressChanged you have to add the seek code. Also, you have to create a runnable to update the seekbar as the audio file is being played. In this link Sridhar Kulkarni shows how to implement a seekbar for android media player. (Tested and working)

您确定您的活动正确实现了OnSeekBarChangeListener吗?在onProgressChanged内你必须添加搜索代码。此外,您必须创建一个runnable来在播放音频文件时更新搜索条。在这个链接中,Sridhar Kulkarni展示了如何为Android媒体播放器实现搜索栏。 (经过测试和工作)

http://android-mantra.blogspot.com/2013/09/seekbar-for-music-player.html

http://android-mantra.blogspot.com/2013/09/seekbar-for-music-player.html

#1


0  

Are you sure your activity implements OnSeekBarChangeListener correctly ? Inside onProgressChanged you have to add the seek code. Also, you have to create a runnable to update the seekbar as the audio file is being played. In this link Sridhar Kulkarni shows how to implement a seekbar for android media player. (Tested and working)

您确定您的活动正确实现了OnSeekBarChangeListener吗?在onProgressChanged内你必须添加搜索代码。此外,您必须创建一个runnable来在播放音频文件时更新搜索条。在这个链接中,Sridhar Kulkarni展示了如何为Android媒体播放器实现搜索栏。 (经过测试和工作)

http://android-mantra.blogspot.com/2013/09/seekbar-for-music-player.html

http://android-mantra.blogspot.com/2013/09/seekbar-for-music-player.html