This repository contains the sample Android application demonstrating integration and usage of the Gumlet Video Player SDK (v1.1.0) for Android, built on top of AndroidX Media3 (ExoPlayer).
- Adaptive Streaming: Native support for HLS (
.m3u8), DASH (.mpd), and progressive MP4 streaming. - DRM Support: Seamless integration with Widevine DRM for both online and offline protected content.
- Offline Playback: Download videos (with or without DRM) using
GumletDownloadManagerfor playback without internet. - Background Downloads: Foreground service with progress notifications — downloads survive app restarts.
- Simple Integration: Setup and start playback with just a few lines of code.
- Customizable Controls: Toggle built-in playback controls or build your own UI on top.
- Lifecycle Aware: Forwarding methods to prevent memory leaks and handle system events cleanly.
- Minimum SDK: API 24 (Android 7.0)
- Target / Compile SDK: API 36 (Android 15/16)
- Kotlin: 2.0+
Add the Gumlet Maven Repository:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://github.com/gumlet/maven-releases/raw/main") }
}
}dependencies {
// Gumlet Video Player SDK v1.1.0
implementation("com.gumlet.video:player:1.1.0")
}<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<!-- Android 13+ for download progress notifications -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application ...>
<!-- Required for Android 12+ data auditing -->
<attribution android:tag="gumlet_player" android:label="@string/gumlet_player_attribution_label" />
</application>
</manifest>Add to res/values/strings.xml:
<string name="gumlet_player_attribution_label">Video Playback</string>Add GumletPlayerView to your layout:
<com.gumlet.video.player.GumletPlayerView
android:id="@+id/gumlet_player_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />Initialize player and load stream:
val playerView = findViewById<GumletPlayerView>(R.id.gumlet_player_view)
val params = GumletInitParams.Builder()
.setVideoUrl("https://video.gumlet.io/example/main.m3u8")
.setAutoPlay(true)
.setControlsEnabled(true)
.setDrmLicenseUrl("https://widevine.gumlet.com/licence/...") // Optional Widevine DRM
.build()
playerView.load(params)Call once during app startup:
GumletDownloadManager.initialize(context)GumletDownloadManager.downloadVideo(
context = this,
videoId = "my_unique_video_id",
videoUrl = "https://video.gumlet.io/example/main.m3u8",
drmLicenseUrl = "https://widevine.gumlet.com/licence/..." // Optional DRM
)val state = GumletDownloadManager.getDownloadState(context, "my_unique_video_id")
val isOfflineReady = state is GumletDownloadState.Completed
val params = GumletInitParams.Builder()
.setVideoId("my_unique_video_id")
.setVideoUrl("https://video.gumlet.io/example/main.m3u8")
.setEnableOfflinePlayback(isOfflineReady)
.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() }| Builder Method | Type | Default | Description |
|---|---|---|---|
setVideoUrl(url) |
String |
required | Stream URL (HLS, DASH, MP4) |
setVideoId(id) |
String? |
null |
Unique ID for offline download lookup |
setDrmLicenseUrl(url) |
String? |
null |
Widevine license server URL |
setAutoPlay(enabled) |
Boolean |
true |
Start playing immediately |
setControlsEnabled(enabled) |
Boolean |
true |
Show built-in playback controls |
setEnableOfflinePlayback(enabled) |
Boolean |
false |
Use local cache for playback |
| State | Description |
|---|---|
NotDownloaded |
No download exists for this video |
Queued |
Waiting to start |
Downloading(percentDownloaded) |
In progress — percentage 0–100 |
Completed |
Fully downloaded, ready for offline play |
Failed(reason) |
Download failed — reason contains error message |
Stopped |
Paused by user |
Removing |
Being deleted |
sample-android-app/
├── app/
│ ├── src/
│ │ └── main/
│ │ ├── java/com/gumlet/myapplication/
│ │ │ ├── MainActivity.kt # Input UI & feature triggers
│ │ │ ├── PlayerActivity.kt # Video playback container
│ │ │ ├── DownloadsActivity.kt # Offline downloads manager
│ │ │ └── VideoPlayerActivity.kt # Legacy reference activity
│ │ ├── res/ # Layouts, shapes, themes, strings
│ │ └── AndroidManifest.xml
│ └── build.gradle.kts
├── settings.gradle.kts
└── README.md
Copyright © 2026 Gumlet. All rights reserved.