本文整理汇总了Java中uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent类的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedMediaPlayerComponent类的具体用法?Java EmbeddedMediaPlayerComponent怎么用?Java EmbeddedMediaPlayerComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EmbeddedMediaPlayerComponent类属于uk.co.caprica.vlcj.component包,在下文中一共展示了EmbeddedMediaPlayerComponent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
@Override
public void run() {
if (!Basemod.vlcLoaded)
return;
JFrame frame = new JFrame("vlcj Tutorial");
mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
frame.setContentPane(mediaPlayerComponent);
frame.setLocation(10000, 10000);
frame.setSize(0, 0);
frame.setVisible(true);
mediaPlayerComponent.getMediaPlayer().setPlaySubItems(true);//needed for some streams (youtube)
if (GuiRadio.radio == null || GuiRadio.radio.isLooping()) {
mediaPlayerComponent.getMediaPlayer().setRepeat(true);//enable loop ;D
} else {
mediaPlayerComponent.getMediaPlayer().setRepeat(false);
}
mediaPlayerComponent.getMediaPlayer().playMedia(this.streamURL);
frame.setVisible(false);
}
示例2: internalCreateNewVisualComponent
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
private void internalCreateNewVisualComponent(String [] prepareOptions) {
playerComponent = new EmbeddedMediaPlayerComponent();
player = playerComponent.getMediaPlayer();
player.addMediaPlayerEventListener(infoListener);
playerComponent.addHierarchyListener(new HierarchyListener() {
// This makes sure that when the player window becomes displayable
// (which is a subset of visible) the player shows some frame in it.
// This can't be done before that time.
public void hierarchyChanged(HierarchyEvent e) {
long flags = e.getChangeFlags() & (HierarchyEvent.PARENT_CHANGED);
if ((flags != 0) && e.getComponent().isDisplayable()) {
player.start();
player.pause();
}
}
});
// configure the player with the given media file
player.prepareMedia(mediaURL, prepareOptions);
player.parseMedia();
player.setEnableMouseInputHandling(false);
player.setEnableKeyInputHandling(false);
}
示例3: VideoPanel
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
public VideoPanel(User user, GridFrame parent) {
super(user, parent,
user.getEntertainmentModule().getVideoModule().getFolderPath(),
FileExtensions.getVideoExtensions());
mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
filesPanel = new FilesPanel(user, files, this);
initComponents();
initCustomComponents();
}
示例4: MyVideoPanel
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
public MyVideoPanel() {
NativeLibrary.addSearchPath("libvlc", vlcWhere.getAbsolutePath());
EmbeddedMediaPlayerComponent videoCanvas =
new EmbeddedMediaPlayerComponent();
setLayout(new BorderLayout());
add(videoCanvas, BorderLayout.CENTER);
player = videoCanvas.getMediaPlayer();
}
示例5: VideoPlayer
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
/**
* Constructor that creates the JFrame
*/
public VideoPlayer()
{
// Sets fullscreen
Toolkit tk = Toolkit.getDefaultToolkit();
int xsize = ((int) tk.getScreenSize().getWidth());
int ysize = ((int) tk.getScreenSize().getHeight());
this.setSize(xsize, ysize);
this.setExtendedState(MAXIMIZED_BOTH);
setUndecorated(false);
// Grabs mediaComponent to call functions on
this.mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
this.setContentPane(this.mediaPlayerComponent);
this.mediaPlayerComponent.getMediaPlayer().setSpu(-1);
// This is so we can implement our own windowAdapter
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
setVisible(false);
pause();
}
});
this.isPaused = true;
this.isPlaying = false;
this.setVisible(false);
}
示例6: getMediaPlayer
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
public EmbeddedMediaPlayerComponent getMediaPlayer(){
return mediaPlayer;
}
示例7: convertVideoToImages
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
/**
* Converts the specified video file to a series of images and adds them to
* the given shared queue.
*
* @param f the video file
* @param singleImage whether just a single preview image is required
* @param sharedQueue the shared processing queue
* @throws IOException if there is a problem loading the media file
* @throws InterruptedException if loading is interupted
*/
public void convertVideoToImages(File f, boolean singleImage, final BlockingQueue<Image> sharedQueue, VideoLoadedLock videoLoadedLock) throws IOException, InterruptedException {
EmbeddedMediaPlayerComponent mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
JWindow frame = new JWindow();
frame.setBounds(0,0,1,1);
frame.add(mediaPlayerComponent);
frame.setVisible(true);
final MediaPlayer player = mediaPlayerComponent.getMediaPlayer();
player.mute();
player.playMedia(f.getAbsolutePath());
long len = player.getLength();
if (len == 0) {
Thread.sleep(MEDIA_PRELOAD_WAIT);
len = player.getLength();
}
int singleImageSelectionTime = -1;
if (singleImage) {
singleImageSelectionTime = new Random().nextInt(RANDOM_INTRO_WAIT) + MINIMUM_INTRO_WAIT;
if (singleImageSelectionTime > len) {
singleImageSelectionTime = (int) len-1;
}
}
frame.setVisible(false);
log.debug("Player time: {}, Len: {}", player.getTime(), len);
videoLoadedLock.preloadFinished();
try {
while (player.getTime() < len) {
if (cancel) {
break;
}
// Always add images if we don't want a single preview
// image or when the time exceeds the point we want a
// single image from
if (singleImageSelectionTime == -1 || player.getTime() >= singleImageSelectionTime) {
sharedQueue.add(player.getSnapshot());
// We only want one image if single image selection
// is turned on
if (singleImageSelectionTime != -1 && player.getTime() >= singleImageSelectionTime) {
break;
}
}
}
} finally {
player.stop();
player.release();
mediaPlayerComponent.release();
cancel = false;
}
}
示例8: getMediaPlayerComponent
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
public EmbeddedMediaPlayerComponent getMediaPlayerComponent() {
return this.mediaPlayerComponent;
}
示例9: inicializarVLCJ
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
private void inicializarVLCJ() {
cargaLibreria();
mediaPlayer = new EmbeddedMediaPlayerComponent();
}
示例10: getMpc
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; //导入依赖的package包/类
private EmbeddedMediaPlayerComponent getMpc() {
synchronized (fsSyncObject) {
return mpC;
}
}