Skip to content

TheReprator/KVideo-Player

Repository files navigation

Cross-Platform Media Player

This can play HLS, DASH and SmoothStreaming files across all platforms.

For iOS, there are limitations:

  • The URL should end with .mpd
  • MPD files can not be live
  • Its format should match as described in MPD format

🙌 Inspiration & Credits

Inspired by:

  • Video.js
    A powerful and extensible web video player — this project builds upon its robust playback capabilities by wrapping it for use in Kotlin Multiplatform WASM/JS.

Credits:

  • Hamamas/Kotlin-Wasm-Html-Interop
    Special thanks for providing seamless HTML and DOM interop in Kotlin/WASM. This library made it possible to build this project without relying on dynamic, js(), or unsafe interop hacks.

  • ShreyashKore/wonderous_compose
    Helped me figure out the trick to make it run on Kotlin/JS.

  • open-ani/mediamp (mediamp-vlc)
    Thanks to this, Desktop support is now possible without requiring VLC to be installed on the system — VLC binaries are shipped with the application itself.

  • MPEGDASHAVPlayerDemo
    Thanks to this, I got some idea to parse DASH files for IOS.

  • A big thanks to @tinku466 and @Vikesh for helping me with the SPM setup and the sample tvOS app — couldn’t have done it this smoothly without your support!


🎬 Demo

Web Demo:
Web Demo

Desktop Demo:
Desktop Demo

iOS Demo:
iOS Demo

Android Demo:
Android Demo

Android Wear Demo:
Android Demo

Android TV Demo:
Android Demo

Android Automative Demo:
Android Demo

Android XR Demo:
Android Demo

Apple tv Demo:
AppleTV Demo


✅ Completed Platform Targets

  • Kotlin/WASM
  • Kotlin/JS
  • Kotlin/Desktop (bundled VLC binaries — no external installation needed)
  • Android Phone/Tablet/XR
  • iOS
  • Android Wear(standalone)
  • Apple TV

✅ Features Completed

  • Initialization
  • Play
  • Pause
  • Dispose
  • Change media

🔜 Pending Features

  • Event tracking
  • Custom UI
  • Testing

⏭️ Next Upcoming Target

  • Will try for apple watch via companion app

📦 Native Binary Packaging (Desktop)

Desktop support ships with pre-bundled VLC binaries, meaning it works even if VLC is not installed on the user’s machine.

Example folder structure:

desktopApp/
 |- appResources/
 |  |- macos-arm64/
 |  |  |- lib/
 |  |  |  |- libvlc.dylib
 |  |  |- plugins/
 |  |  |  |- xxx.dylib
 |  |- macos-x64/
 |  |  |- lib/
 |  |  |  |- libvlc.dylib
 |  |  |- plugins/
 |  |  |  |- xxx.dylib
 |  |- windows-x64/
 |  |  |- lib/
 |  |  |  |- libvlc.dll
 |  |  |  |- plugins/
 |  |- linux-x64/
 |  |  |- lib/
 |  |  |  |- libvlc.so
 |- src/
 |- build.gradle.kts

Notes:

  • It is in very early stage, so mostly for development purposes. Once all platforms are integrated, we’ll deep dive into proper functionality.
  • Currently, macOS binaries are included. You can extend this to other platforms by adding respective VLC builds.
  • On the first run, VLC may take ~2 minutes to cache/generate plugins.dat.
    From the second run onward, startup time reduces to ~7–10 seconds.