Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我有一个视频播放器。有一个自定义控制面板。我已经使用MediaController类实现了播放、暂停、停止功能。现在我想在该控制面板中添加一个进度条。我该如何实施?谁能给我任何相同的示例代码或想法?
使用 SeekBar。然后找到媒体的总长度,并将其设置为最大值。在媒体播放时定期更新此 SeekBar - 例如每 5 秒 - 取决于媒体长度。(如果媒体文件很短,则间隔必须更短)。