
Automates library release workflow: converts README into a Docsify homepage, publishes API docs, deploys a live browser demo, builds downloadable sample executables, and wires complete CI/CD.
cmp-videoplayer is an OSS Compose Multiplatform video player component that focuses on one responsibility: playing video files across targets.
Supported targets:
<video>)Non-goals:
placeholder slot)Add the dependency to your commonMain:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.aryapreetam:cmp-videoplayer:0.0.3")
}
}
}@Composable
fun MyScreen() {
VideoPlayer(
source = VideoSource.Url("https://example.com/video.mp4"),
config = VideoPlayerConfig(
autoplay = false,
showControls = true,
)
)
}VideoSource.Url(url) supports http(s)://, file://, and on Android also content:// and android.resource://.VideoSource.Path(path) is a raw filesystem path (Android/iOS/JVM). On wasm, use Url.On wasmJs, the HTML <video> element needs a URL. If your video is only available via Compose resources (Res.raw.*), use rememberBlobVideoUrl:
@Composable
fun ResourceVideo(bytes: ByteArray) {
// `mimeType` is explicit by design.
val url = rememberBlobVideoUrl(bytes, mimeType = "video/mp4")
VideoPlayer(VideoSource.Url(url))
}Notes:
blob: URLs are revoked on disposal.The library uses platform interop for real playback. For UI tests, you can force a pure-Compose render path:
CompositionLocalProvider(
LocalVideoPlayerConfig provides VideoPlayerConfig(renderMode = RenderMode.PlaceholderOnly)
) {
VideoPlayer(
source = VideoSource.Url("https://example.com/video.mp4"),
placeholder = { /* render your test-friendly placeholder UI */ }
)
}The root node uses the test tag cmp-videoplayer:VideoPlayer.
If using snapshots from Maven Local, ensure:
repositories {
mavenLocal()
mavenCentral()
}Download and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🐧 Linux | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
For instructions on how to install and run the pre-built executables or build and run the sample application from source code, please refer to the How to Run the Sample App guide.
MIT License © 2025 aryapreetam and contributors. See LICENSE for details.
See CONTRIBUTING.md for detailed contribution guidelines.
cmp-videoplayer is an OSS Compose Multiplatform video player component that focuses on one responsibility: playing video files across targets.
Supported targets:
<video>)Non-goals:
placeholder slot)Add the dependency to your commonMain:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.aryapreetam:cmp-videoplayer:0.0.3")
}
}
}@Composable
fun MyScreen() {
VideoPlayer(
source = VideoSource.Url("https://example.com/video.mp4"),
config = VideoPlayerConfig(
autoplay = false,
showControls = true,
)
)
}VideoSource.Url(url) supports http(s)://, file://, and on Android also content:// and android.resource://.VideoSource.Path(path) is a raw filesystem path (Android/iOS/JVM). On wasm, use Url.On wasmJs, the HTML <video> element needs a URL. If your video is only available via Compose resources (Res.raw.*), use rememberBlobVideoUrl:
@Composable
fun ResourceVideo(bytes: ByteArray) {
// `mimeType` is explicit by design.
val url = rememberBlobVideoUrl(bytes, mimeType = "video/mp4")
VideoPlayer(VideoSource.Url(url))
}Notes:
blob: URLs are revoked on disposal.The library uses platform interop for real playback. For UI tests, you can force a pure-Compose render path:
CompositionLocalProvider(
LocalVideoPlayerConfig provides VideoPlayerConfig(renderMode = RenderMode.PlaceholderOnly)
) {
VideoPlayer(
source = VideoSource.Url("https://example.com/video.mp4"),
placeholder = { /* render your test-friendly placeholder UI */ }
)
}The root node uses the test tag cmp-videoplayer:VideoPlayer.
If using snapshots from Maven Local, ensure:
repositories {
mavenLocal()
mavenCentral()
}Download and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🐧 Linux | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
For instructions on how to install and run the pre-built executables or build and run the sample application from source code, please refer to the How to Run the Sample App guide.
MIT License © 2025 aryapreetam and contributors. See LICENSE for details.
See CONTRIBUTING.md for detailed contribution guidelines.