开发者

Android MediaController Next Previous Buttons

So, For Android's MediaController I found this "The "previous" and "next" buttons are hidden unt开发者_如何学编程il setPrevNextListeners() has been called." I'd like to show the next and previous. Can someone help me understand how to set this up?

Thanks


Assuming you are using a VideoView control withing an activity, (let's call it videoView), you will want to attach a MediaController to it. Try the following:

MediaController mc = new MediaController(this);
mc.setPrevNextListeners(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
    //Handle next click here
  }
}, new View.OnClickListener() {
  @Override
  public void onClick(View v) {
    //Handle previous click here
  }
});
videoView.setMediaController(mc);

This should do the trick.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜