how to create custom UI for android MediaController

I had the same problem on a recent project and ended up creating a custom implementation based on the stock MediaController. It adds a fullscreen button at the far right, but even if that’s not what you want this class should be a good starting point.


  • –
  • media_controller.xml –

Image resources:

  • enter image description here


  • The class assumes the anchor view is a FrameLayout to position itself at the bottom.
  • The class does not use a Window to ensure control floats on top of the anchor. However, this hasn’t been a problem for me as the show() method does mAnchor.addView() every time.
  • The class uses its own MediaPlayerControl protocol. This allows customizations such as toggleFullScreen()

UPDATE (2013): See this tutorial for more details:

UPDATE (2018): You can now use the wonderful ExoPlayer and fully customize your player UI simply by overriding a layout file.

Leave a Comment