This is a sample Android application demonstrating the implementation and usage of the Gumlet Video Player SDK for Android. This app serves as a reference implementation for clients who want to integrate the Gumlet Video Player into their Android applications.
The sample app showcases how to:
- Integrate the Gumlet Video Player SDK
- Play HLS (
.m3u8) videos - Play DASH (
.mpd) videos - Play DRM-protected videos with Widevine
- Handle player lifecycle events
- Implement error handling and player state monitoring
✅ Basic Video Playback - Simple integration with HLS and DASH streaming
✅ DRM Support - Widevine DRM protected content playback
✅ Lifecycle Management - Proper handling of Android lifecycle events
✅ Error Handling - Player error callbacks and status updates
✅ State Monitoring - Track play/pause state changes
- Android Studio (latest version recommended)
- Minimum SDK: API 24 (Android 7.0)
- Target SDK: API 36 (Android 14/15)
- Kotlin support enabled
- Internet connection (for streaming videos)
git clone <repository-url>
cd sample-android-app- Open Android Studio
- Select File → Open
- Navigate to the
sample-android-appdirectory - Click OK
Android Studio will automatically sync the Gradle files. If not:
- Click File → Sync Project with Gradle Files
- Wait for the sync to complete
- Connect an Android device or start an emulator (API 24+)
- Click the Run button (
▶️ ) or pressShift + F10 - The app will build and launch on your device/emulator
sample-android-app/
├── app/
│ ├── src/
│ │ └── main/
│ │ ├── java/com/gumlet/myapplication/
│ │ │ └── VideoPlayerActivity.kt # Main sample activity
│ │ ├── res/
│ │ │ └── layout/
│ │ │ └── activity_video_player.xml # UI layout
│ │ └── AndroidManifest.xml
│ └── build.gradle.kts # App dependencies
├── settings.gradle.kts # Repository configuration
└── README.md # This file
The app includes the Gumlet Video Player SDK and required Media3 dependencies:
// Gumlet Video Player SDK
implementation("com.gumlet.video:player:1.0.0")
// Required Media3 Dependencies
implementation("androidx.media3:media3-exoplayer:1.5.0")
implementation("androidx.media3:media3-exoplayer-dash:1.5.0")
implementation("androidx.media3:media3-exoplayer-hls:1.5.0")
implementation("androidx.media3:media3-ui:1.5.0")Required permissions and attribution tag:
<uses-permission android:name="android.permission.INTERNET" />
<attribution android:tag="gumlet_player" android:label="@string/gumlet_player_attribution_label" />val params = GumletInitParams.Builder()
.setVideoUrl("https://example.com/video.m3u8")
.setAutoPlay(true)
.build()
playerView.load(params)val params = GumletInitParams.Builder()
.setVideoUrl("https://example.com/protected.mpd")
.setDrmLicenseUrl("https://license-server.com/widevine")
.setAutoPlay(true)
.build()
playerView.load(params)override fun onPause() {
super.onPause()
playerView.onPause()
}
override fun onResume() {
super.onResume()
playerView.onResume()
}
override fun onDestroy() {
super.onDestroy()
playerView.onDestroy()
}playerView.setPlayerListener(object : GumletPlayerListener {
override fun onPlayerError(error: String) {
Log.e("GumletPlayer", "Playback Error: $error")
// Handle error
}
override fun onPlayerStateChanged(isPlaying: Boolean) {
// Handle play/pause state changes
}
})-
Launch the App: The
VideoPlayerActivityopens automatically when the app starts. -
Test Different Video Types:
- Play HLS Video: Click the "Play HLS Video (.m3u8)" button
- Play DASH Video: Click the "Play DASH Video (.mpd)" button
- Play DRM Video: Click the "Play DRM Protected Video" button
-
Monitor Status: Watch the status text view at the bottom for player state updates and errors.
-
Customize: Replace the sample video URLs in
VideoPlayerActivity.ktwith your own video URLs.
Edit VideoPlayerActivity.kt and update the URLs in these methods:
playHlsVideo()- Replace with your HLS video URLplayDashVideo()- Replace with your DASH video URLplayDrmVideo()- Replace with your DRM video URL and license server URL
private fun playHlsVideo() {
val params = GumletInitParams.Builder()
.setVideoUrl("YOUR_HLS_VIDEO_URL_HERE")
.setAutoPlay(true)
.build()
playerView.load(params)
}- Repository not found: Ensure the Gumlet Maven repository is added in
settings.gradle.kts - Dependency resolution failed: Check your internet connection and sync Gradle again
- SDK version mismatch: Ensure your Android SDK is up to date
- Video won't play:
- Check internet connection
- Verify video URL is accessible
- Check device logs for error messages
- DRM video fails:
- Verify DRM license server URL is correct
- Ensure device supports Widevine DRM
- Check license server accessibility
- Memory leaks: Ensure lifecycle methods (
onPause,onResume,onDestroy) are properly implemented - Playback stops: Check if the activity is being destroyed or paused unexpectedly
- Library Documentation: See the main library README at
/Users/prashantpandey/AndroidStudioProjects/GumletVideoPlayer/README.md - Media3 Documentation: AndroidX Media3
- ExoPlayer Guide: ExoPlayer Developer Guide
For issues or questions about:
- This sample app: Check the code comments in
VideoPlayerActivity.kt - Gumlet Video Player SDK: Refer to the main library documentation
- Integration help: Review the implementation examples in this sample app
Copyright © 2025 Gumlet. All rights reserved.
Note: This is a sample application for demonstration purposes. Replace sample URLs and customize the implementation according to your specific requirements.