Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numq/compose-desktop-media-player
Compose Desktop media player implementation techniques for desktop development
https://github.com/numq/compose-desktop-media-player
audio-player compose-desktop javafx kotlin media-player video-player vlcj
Last synced: 2 months ago
JSON representation
Compose Desktop media player implementation techniques for desktop development
- Host: GitHub
- URL: https://github.com/numq/compose-desktop-media-player
- Owner: numq
- License: mit
- Created: 2023-02-25T17:16:46.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T22:09:45.000Z (5 months ago)
- Last Synced: 2024-09-13T11:37:08.703Z (5 months ago)
- Topics: audio-player, compose-desktop, javafx, kotlin, media-player, video-player, vlcj
- Language: Kotlin
- Homepage:
- Size: 240 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
___
## 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!
> ```kotlin
> 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.### [JavaFX](https://openjfx.io)
```kotlin
plugins {
id("org.openjfx.javafxplugin") version "19"
}javafx {
version = "19"
modules("javafx.media", "javafx.swing")
}
```- [AWT component](https://github.com/numq/jetpack-compose-desktop-media-player/blob/master/src/main/kotlin/javafx/JfxComponentController.kt)
- [Frame grabbing](https://github.com/numq/jetpack-compose-desktop-media-player/blob/master/src/main/kotlin/javafx/JfxFrameController.kt)### [VLCJ](https://github.com/caprica/vlcj)
```kotlin
implementation("uk.co.caprica:vlcj:4.8.2")
```- [AWT component](https://github.com/numq/jetpack-compose-desktop-media-player/blob/master/src/main/kotlin/vlcj/VlcjComponentController.kt)
- [Frame grabbing](https://github.com/numq/jetpack-compose-desktop-media-player/blob/master/src/main/kotlin/vlcj/VlcjFrameController.kt)