how to control VLC by java

前端 未结 3 2052
有刺的猬
有刺的猬 2020-12-06 03:35

I want to run a program called VLC in java and control it while running, for example if user clicked on ❚❚ or ►► button, I do a s

3条回答
  •  生来不讨喜
    2020-12-06 03:47

    VLCj is what you're after yes - it's essentially a straight Java wrapper around libvlc. If you use it in process (especially if you use multiple players in process) you will sometimes see VM crashes - this isn't VLCJ's fault, rather libvlc and the native libraries it uses underneath have some subtle threading bugs that exposes these problems.

    You can get it working reliably with multiple instances, but to do so you need to use it out of process. See here for my initial attempts at doing so. It's a bit of work to set up but once going, things seem to work very nicely.

提交回复
热议问题