[英]Running video file in jar using VLCJ
I am developing an application where i have a startup video 我正在开发一个有启动视频的应用程序
I want this video to be embedded in my executable jar or a separate zip which can be password protected 我希望将此视频嵌入到我的可执行jar或可以受密码保护的单独zip中
I have tried to use the following code but its not working 我尝试使用以下代码,但无法正常工作
audioPlayer.prepareMedia("zip:///C:/Users/User/Documents/NetBeansProjects/HanumanChalisa/res.zip!/res/startup.mp4");
Please help me for this. 请帮我。
EDIT : 编辑:
this is the error i am getting 这是我得到的错误
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000053e320] moov atom not found
[000000000d245358] avcodec demux error: Could not open C:\Users\User\Documents\NetBeansProjects\HanumanChalisa\res.zip!\res\startup.mp4: Specified event object handle is invalid
[000000000d245358] ps demux error: cannot peek
[000000000d2390c8] main input error: no suitable demux module for 'zip/:///C:/Users/User/Documents/NetBeansProjects/HanumanChalisa/res.zip!/res/startup.mp4'
[000000000d2390c8] main input error: VLC can't recognize the input's format
[000000000d2390c8] main input error: The format of 'zip:///C:/Users/User/Documents/NetBeansProjects/HanumanChalisa/res.zip!/res/startup.mp4' cannot be detected. Have a look at the log for details.`
This works for me (when I adjust the path obviously), so I don't think there's anything inherently wrong with the code that you've posted. 这对我有用(当我明显地调整路径时),所以我认为您发布的代码没有任何内在的错误。 A couple of things to note: 需要注意的几件事:
If the worst comes to the worst, you could always extract the file you need to a tempoary file and then pass that location to VLCJ. 如果情况变得最糟,则始终可以将所需文件提取为临时文件 ,然后将该位置传递给VLCJ。 Not an ideal workaround, but one that would at least still let you play the file. 这不是一个理想的解决方法,但是至少可以让您播放文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.