我想在我的 JPanel 中实现 xuggle 播放的视频窗口?
我可以通过 xuggle 播放视频,但是当我启动程序时,视频会在单独的 JFrame 中打开! ,我想在我自己的 Jframe 或 JPanel 中以全屏显示模式实现此播放器,那么我该怎么做?
我正在使用此代码来播放视频:
private IMediaReader reader;
private IMediaViewer viewer;
viewer = ToolFactory.makeViewer();
reader = ToolFactory.makeReader("assets/Video/intro_video.flv");
reader.addListener(viewer);
while(reader.readPacket() == null);
我还需要知道如何通过资源方法(this.getClass().getResource())加载网址以使此视频播放并可以在运行程序时加载视频文件.jar 文件
谢谢
i can play a video by xuggle , but when i start my program , the video open in it's seperate JFrame !! , i want implement this player inside my own Jframe or JPanel in FullScreen Display Mode , so how can i do this ??
iam using thise code to play the video :
private IMediaReader reader;
private IMediaViewer viewer;
viewer = ToolFactory.makeViewer();
reader = ToolFactory.makeReader("assets/Video/intro_video.flv");
reader.addListener(viewer);
while(reader.readPacket() == null);
an also i need know how to load the url by resource method (this.getClass().getResource()) to make this video play and can load the video file when i run the programm from .jar file
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加监听器后添加此代码,
reader.addListener(ToolFactory.makeViewer(true, JFrame.EXIT_ON_CLOSE));
如果您不想静态屏幕,请设为 true
Add this code after add listener,
reader.addListener(ToolFactory.makeViewer(true, JFrame.EXIT_ON_CLOSE));
If you don't wanna statics screen so make true