How to connect Media Player to a SeekBar?

廉价感情. 提交于 2019-12-11 16:32:41

问题


I want to show the progress of a media on a seekbar. Also I want to allow user to "jump" within a medium.

I have a MediaPlayer, and a SeekBar. And as far as I see there is no an easy way to merge them.


回答1:


You can use VideoView instead of MediaPlayer and you can have MediaController which can be set to VideoView.

Otherwise you have to get the progress at instances and update the seek bar you can use timers.



来源:https://stackoverflow.com/questions/3829679/how-to-connect-media-player-to-a-seekbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!