JiaoZiVideoPlayer
MediaPlayer exoplayer ijkplayer ffmpeg
An Android video player library in Java you can drop into any app, swap the playback engine with one line of code, and fully customize the UI, handles full-screen, gestures, and list-scroll scenarios out of the box.
JiaoZiVideoPlayer (also called jzvd) is an Android video player library written in Java. It gives app developers a ready-made video player component they can drop into an Android app and customize heavily. The README is written in Chinese, with code examples in Java and XML.
The main selling point is that you can swap out the underlying playback engine with a single line of code. It supports Android's built-in MediaPlayer as well as ijkplayer, a third-party engine. This means you can choose which video formats and streaming protocols your app handles by picking the right engine. The UI can also be replaced entirely: developers inherit from the library's base class and write their own player appearance and controls on top of it.
The library handles several scenarios that video players in Android lists typically struggle with. It correctly detects when a list is scrolling and manages playback accordingly. It supports full-screen mode that can be entered and exited while a video is loading, paused, or playing. It also works inside nested layouts like ListView, ViewPager, and Fragment combinations, which normally create conflicts with full-screen video. After entering full-screen, swipe gestures let the user adjust progress and volume without tapping buttons.
Additional features include a gravity sensor that automatically rotates into full-screen when you tilt the device, variable playback speed, a video cache example in the demo project, and the ability to embed the player inside a WebView. When the user presses the Home button, playback pauses and resumes when they return.
Installation involves adding one dependency line to the build file, placing the player view in a layout XML file, and setting a video URL and thumbnail image in Java code. The library is released under the MIT license.
Where it fits
- Add a customizable video player to an Android app that handles full-screen mode, swipe gestures, and list scrolling correctly.
- Swap the default MediaPlayer for ijkplayer with one line to support more video formats and streaming protocols.
- Build a completely custom player UI by subclassing the library's base class and overriding the controls.
- Embed a video player inside a WebView or complex nested layouts like ViewPager without full-screen conflicts.