Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: 实装音乐播放器 #197

Open
andannn opened this issue Nov 26, 2024 · 1 comment
Open

Desktop: 实装音乐播放器 #197

andannn opened this issue Nov 26, 2024 · 1 comment
Labels
desktop feature New feature or request

Comments

@andannn
Copy link
Owner

andannn commented Nov 26, 2024

使用JAVA平台的Vlc播放器实装。
https://github.com/caprica/vlcj

具体的思路就是实现desktopMain里的PlayerStateMonitoryRepository, 和MediaControllerRepository接口。
调用vlc的逻辑和实装放在:core:player里比较好。

https://github.com/andannn/Melodify/blob/master/core/data/src/commonMain/kotlin/com/andannn/melodify/core/data/repository/PlayerStateMonitoryRepository.kt
https://github.com/andannn/Melodify/blob/master/core/data/src/commonMain/kotlin/com/andannn/melodify/core/data/repository/MediaControllerRepository.kt

@andannn andannn added feature New feature or request desktop labels Nov 26, 2024
@andannn
Copy link
Owner Author

andannn commented Nov 29, 2024

https://www.capricasoftware.co.uk/tutorials/vlcj/4/thread-model
Do not call LibVLC api concurrently

If you are attempting to use multiple media players in your application, or using media players from multiple threads, you may need to take some extra care so that you do not have multiple threads calling into LibVLC concurrently. You may encounter subtle bugs and races that are very difficult to diagnose.

Do not update ui from VLC native thread

In addition, you must take care not to update Swing UI components from the native thread - all Swing UI updates are supposed to go via the Swing Event Dispatch Thread (EDT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant