java 媒体播放器_Java多媒体播放器(三)

No.3 vlcj

一、简介

The vlcj project first gives you Java bindings to just about all of the native functionality provided through libvlc, but you also get much more than that...

The vlcj project also gives you a framework that provides a simpler higher-level programming model for libvlc - encapsulating as much as possible of the access to the native library, and encapsulating any platform-specific behaviours.

二、示例

import javax.swing.JFrame; //官网的程序,写得非常清楚简洁,很容易上手

import javax.swing.SwingUtilities;

import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;

public class Tutorial2B {

private final EmbeddedMediaPlayerComponent mediaPlayerComponent;

public static void main(final String[] args) {

SwingUtilities.invokeLater(new Runnable() {

@Override

public void run() {

new Tutorial2B(args);

}

});

}

private Tutorial2B(String[] args) {

JFrame frame = new JFrame("vlcj Tutorial");

mediaPlayerComponent = new EmbeddedMediaPlayerComponent();

frame.setContentPane(mediaPlayerComponent);

frame.setLocation(100, 100);

frame.setSize(1050, 600);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

mediaPlayerComponent.getMediaPlayer().playMedia(args[0]);

}

}

三、评价

同样是很不错的开源项目,与强大的开源媒体播放器 VLC 结合之后更是所向披靡,使用起来更是简单实用,强烈推荐使用!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值