Skip to content

Compose Desktop media player implementation techniques for desktop development

License

Notifications You must be signed in to change notification settings

numq/compose-desktop-media-player

Repository files navigation


About

This repository includes various media player implementation methods that can be useful if you want to add multimedia components to your Jetpack Compose project.

AWT component

The standard way to create a media player using the media player library component and container for the AWT component provided by Jetpack Compose SwingPanel.

Frame grabbing

Using a byte array of pixels as the key of the remember function will result in an exponential memory leak due to comparing by reference and creating a new key, which will result in an accumulation of unused values!

   remember(pixels) // don't do this!
   remember(pixels.contentHashCode()) // do this instead

A more flexible method that captures video frames as an array of bytes, converts to the required format, and then displays.

plugins {
    id("org.openjfx.javafxplugin") version "19"
}

javafx {
    version = "19"
    modules("javafx.media", "javafx.swing")
}
implementation("uk.co.caprica:vlcj:4.8.2")

About

Compose Desktop media player implementation techniques for desktop development

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages