java - 如何用mediaplayer做一个带进度条,跟有时间显示的播放控件?
怪我咯
怪我咯 2017-04-18 10:56:15
0
2
536

问题:进度条已经可以根据音频移动,但是时间无法时时更新,随着音频播放更新时间如何做?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
大家讲道理

Use the handler to update the UI. You can add a sleep to the thread, and then get the latest playback time and send a message to the handler every 1 second to update your time progress

巴扎黑

Well, it has been solved. This problem, thank you, brother, is to use the handler to continuously send empty messages with an interval of one second, and then update. However, my colleague said that it can also be used in the timer. I have not tried it. Just use it in the timer. It collapsed, I don’t know why

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!