Skip to content

Commit 41173f1

Browse files
committed
Add project info in the README
1 parent 33e703e commit 41173f1

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[![Gradle plugin badge]][Plugin page on Gradle Plugin Portal]
2+
3+
# VLC Setup
4+
A Gradle plugin for [Compose Multiplatform][cmp] desktop applications to automatically
5+
embed [VLC][vlc] which is needed to play media files (video, audio, image) via [vlcj][vlcj].
6+
7+
The plugin prepares and includes proper VLC plugin files (*.dll* for Windows, *.so* for Linux, *.dylib* for macOS)
8+
so your application becomes self-contained and there will be no need for VLC media player to have been installed on end-user systems.
9+
10+
The plugin features:
11+
- Support for Windows, Linux, macOS (experimental)
12+
- Option to compress VLC plugin files to reduce their size
13+
- Option to include only some base VLC files for common media types
14+
- Option to select version of VLC to use (not supported for Linux yet)
15+
16+
> [!WARNING]
17+
> The plugin was tested only on my system. Further feedback is needed to detect problems.
18+
19+
> [!Note]
20+
> See the table in [supported-formats-codecs.html][Supported Formats and Codecs Preview] for supported formats/codecs by the base (default) VLC plugins.
21+
22+
> [!Note]
23+
> If all VLC plugins are included, then virtually any format and codec should be supported and be playable.
24+
25+
> [!Note]
26+
> The project (media playback) worked OK on the OSes defined in [tested-operating-systems.html][Tested Operating Systems Preview].
27+
28+
## Getting started
29+
Follow the steps below to implement a media player in your desktop CMP app.
30+
To see a fully-working real application, visit the [Cutcon][Cutcon] project.
31+
32+
1. First, add the plugin to your build.gradle\[.kts] file:
33+
```kotlin
34+
plugins {
35+
// ...
36+
id("ir.mahozad.vlc-setup") version "0.0.1"
37+
}
38+
```
39+
2. Next, you should [add files to the packaged CMP application][Add files to packaged app].
40+
So, specify a custom directory (folder) where you would like to place VLC plugin files:
41+
```kotlin
42+
compose.desktop {
43+
application {
44+
// ...
45+
nativeDistributions {
46+
appResourcesRootDir = rootDir.resolve("myAssets/") // <projectRoot>/myAssets/
47+
```
48+
3. Then specify the plugin options in the `vlcSetup{}` block in the build.gradle\[.kts] file
49+
(specifically, the path for each OS (same path above suffixed with `/<OS name>` where the plugin should put the VLC plugin files):
50+
```kotlin
51+
vlcSetup {
52+
vlcVersion = "3.0.21"
53+
shouldCompressVlcFiles = true
54+
shouldIncludeAllVlcFiles = false
55+
pathToCopyVlcLinuxFilesTo = rootDir.resolve("myAssets/linux/")
56+
pathToCopyVlcMacosFilesTo = rootDir.resolve("myAssets/macos/")
57+
pathToCopyVlcWindowsFilesTo = rootDir.resolve("myAssets/windows/")
58+
}
59+
```
60+
4. Implement custom vlcj `NativeDiscoveryStrategy` classes (See the [Cutcon][Cutcon] project)
61+
5. Implement your media player (See the [Cutcon][Cutcon] project)
62+
63+
I plan to release a library for Compose Multiplatform to make steps 4 and 5 easier.
64+
65+
[cmp]: https://github.com/jetbrains/compose-multiplatform
66+
[vlc]: https://github.com/videolan/vlc
67+
[vlcj]: https://github.com/caprica/vlcj
68+
[Add files to packaged app]: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-native-distribution.html#adding-files-to-packaged-application
69+
[Cutcon]: https://github.com/mahozad/cutcon
70+
[Gradle plugin badge]: https://img.shields.io/gradle-plugin-portal/v/ir.mahozad.vlc-setup?label=Gradle%20Plugin%20Portal&labelColor=303030&logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogICAgPGxpbmVhckdyYWRpZW50IGlkPSJhIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjEuNDU3NjU3IiB4Mj0iMjYuNjMwOTMiIHkxPSIzLjIwOTcxMSIgeTI9IjI3LjU2MzgxIj4NCiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMjA5YmM0Ii8+DQogICAgICAg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MzU2IDAgMy4yNzQgMy4yNzQgMCAwIDEgMS4wOTggMi4wMzcuNDc2LjQ3NiAwIDAgMCAuNDc3LjQyaDIuMTg0YS40ODYuNDg2IDAgMCAwIC40NzYtLjQyIDMuMjcgMy4yNyAwIDAgMSAxLjA5OC0yLjAzNyAzLjMxOSAzLjMxOSAwIDAgMSA0LjM1NyAwIDMuMjc0IDMuMjc0IDAgMCAxIDEuMDk4IDIuMDM3LjQ3OS40NzkgMCAwIDAgLjQ3Ni40MmgyLjE3YS40ODUuNDg1IDAgMCAwIC40ODQtLjQ3M2MuMDUtMy4wMzcuODc1LTYuNTI1IDMuMjI2LTguMjczIDguMTQ1LTYuMDQ4IDYuMDA0LTExLjIzIDQuMTE5LTEzLjF6bS04LjMwNSA5LjEzNC0xLjU1NC0uNzczYS45NjEuOTYxIDAgMCAxIC40NjMtLjgyNS45OC45OCAwIDAgMSAxLjMxOS4yODIuOTY0Ljk2NCAwIDAgMSAtLjIyOCAxLjMyeiIvPg0KPC9zdmc+DQo=
71+
[Plugin page on Gradle Plugin Portal]: https://plugins.gradle.org/plugin/ir.mahozad.vlc-setup
72+
[Supported Formats and Codecs Preview]: https://html-preview.github.io/?url=https://github.com/mahozad/vlc-setup/blob/main/supported-formats-codecs.html
73+
[Tested Operating Systems Preview]: https://html-preview.github.io/?url=https://github.com/mahozad/vlc-setup/blob/main/tested-operating-systems.html

0 commit comments

Comments
 (0)