FullscreenVideoView — VideoView gone fullscreen


I was once given the task to create a VideoView with fullscreen functionality. It was a great challenge because the default VideoView doesn’t have this included by default. I searched all over the Internet and didn’t find an appropriate solution for this.
So I’ve decided to make a library called FullscreenVideoView. It does the same as the first part of its name loudly presents — goes fullscreen on orientation change (if enabled by the user) or by clicking on the fullscreen button. It’s a combination of several classes, that handle the orientation change, a video controller, a media player and the actual FullscreenVideoView class.
How to setup the library?
- Add FullscreenVideoView to your layout’s XML file:
2. Set the video file or its URL:
3. The Activity should handle configuration changes and you need to add the configChanges attribute to the AndroidManifest:
You’re probably thinking “Is that all?”

Yes, that is all you have to do to get the library to work.
Advanced usage
You can enable video auto-start which is disabled by default:
Customize drawables, by passing drawable resource ids:
or drawable objects:
Change the fast rewind/fast forward intervals:
Change the progressbar color by passing a color resource id:
How orientation change can be handled?
To avoid passing wrong orientation for portrait or landscape, I created PortraitOrientation and LandscapeOrientation enums. They wrap the portrait and landscape orientation constants from ActivityInfo which are described here.
Enable/disable the pause, fast-forward or rewind:
Change the playback speed (only for API 23 and above)
The speed of the video can be changed with the library methods below. There are 7 playback speed values which are added by default, but they can be changed with custom ones when playbackSpeedOptions is used.
What about XML properties?
The VideoView can also be styled from XML:
Download
You can use Gradle:
or Maven:
This is what the library covers so far. Any and all pull requests are welcome. Check it out on GitHub.