Map media
Use ReelItem or map your own item model into ReelsMediaSource.Video.
What it handles
Keep your product UI in the overlay slot while the library owns the player lifecycle, gestures, preloading, errors, and progress affordances.
Install
Requires Android min SDK 24+, Kotlin, Jetpack Compose, and Media3. Compose, Lifecycle, Coil, and Media3 dependencies are included transitively.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
dependencies {
implementation("com.github.mathewGlenn:ComposeReelsPlayer:0.1.2")
}
Usage
Use the controller for playback and navigation, then listen for current reel changes and analytics events from your host screen.
@Composable
fun ReelsScreen() {
val controller = rememberReelsPlayerController()
ReelsPlayer(
items = reels,
controller = controller,
onCurrentReelChanged = { index, item ->
println("Current reel: $index ${item.id}")
},
onAnalyticsEvent = { event ->
println("Reels analytics: $event")
},
onLoadMore = {
println("Load more reels")
}
)
}
Use ReelItem or map your own item model into ReelsMediaSource.Video.
Add app-specific product actions while default playback controls stay library-owned.
Configure autoplay, mute state, preloading, cache keys, load-more thresholds, and gestures.
Read the full setup, overlay, cache, controller, and analytics examples in the project README.