开发者

Android video player custom control panel

开发者 https://www.devze.com 2023-03-09 00:14 出处:网络
In my app, I have a video player. There is a custom control panel for that. I have implemented play, pause, stop functionality using the MediaController class. Now I want to add a progress bar in that

In my app, I have a video player. There is a custom control panel for that. I have implemented play, pause, stop functionality using the MediaController class. Now I want to add a progress bar in that control panel. How can I implement that? Can anyone give me any sample 开发者_如何学Gocode or idea for the same?


Use a SeekBar. Then find the total length of your media, and set that as the max value. Update this SeekBar on a regular interval as the media plays along - for example every 5th second - depending on the media length. (Interval would have to be shorter if the media file is short).

0

精彩评论

暂无评论...
验证码 换一张
取 消