当前位置: 首页>>代码示例>>Java>>正文


Java MediaPlayerEventAdapter类代码示例

本文整理汇总了Java中uk.co.caprica.vlcj.player.MediaPlayerEventAdapter的典型用法代码示例。如果您正苦于以下问题:Java MediaPlayerEventAdapter类的具体用法?Java MediaPlayerEventAdapter怎么用?Java MediaPlayerEventAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MediaPlayerEventAdapter类属于uk.co.caprica.vlcj.player包,在下文中一共展示了MediaPlayerEventAdapter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addMediaPlayerEventListener

import uk.co.caprica.vlcj.player.MediaPlayerEventAdapter; //导入依赖的package包/类
/**
 * Adds the media player event listener.
 *
 * @param mediaPlayerEventAdapter
 *            the media player event adapter
 */
public void addMediaPlayerEventListener(MediaPlayerEventAdapter mediaPlayerEventAdapter)
{
	if (initiated)
	{
		mediaPlayer.addMediaPlayerEventListener(mediaPlayerEventAdapter);
	}
	else
	{
		eventHandlersToAdd.add(mediaPlayerEventAdapter);
	}
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:18,代码来源:SimpleMediaPlayer.java

示例2: run

import uk.co.caprica.vlcj.player.MediaPlayerEventAdapter; //导入依赖的package包/类
public void run(String file) throws Exception {
        MediaPlayer player = mediaPlayerFactory.newHeadlessMediaPlayer();
        // TODO: change the listener
        player.addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
            @Override
            public void finished(uk.co.caprica.vlcj.player.MediaPlayer mediaPlayer) {
                LOGGER.info("stream finished");
            }
        });

        String mrl = "rtsp://:8554/vlc";
        // TODO: allow display and save file at same time
//        String options = ":sout=#transcode{vcodec=h264,venc=x264{cfr=16},scale=1,acodec=mp4a,ab=160,channels=2,samplerate=44100}:file{dst=D:/pt/t.mp4}";
        player.playMedia(mrl, getOptions(file));

        boolean shouldStop = false;
        while (!shouldStop) {
            Thread.sleep(1000);
            LOGGER.debug("waiting for vlc to finish receiving stream");
            if (player.getTime() == -1) {
                player.stop();
                player.release();
                shouldStop = true;
            }
        }

        mediaPlayerFactory.release();
        writeFinishFlag(file);
    }
 
开发者ID:at15,项目名称:cs433,代码行数:30,代码来源:StreamClient.java

示例3: addMediaPlayerEventListener

import uk.co.caprica.vlcj.player.MediaPlayerEventAdapter; //导入依赖的package包/类
/**
 * Adds the media player event listener.
 *
 * @param mediaPlayerEventAdapter
 *            the media player event adapter
 */
public void addMediaPlayerEventListener(MediaPlayerEventAdapter mediaPlayerEventAdapter);
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:8,代码来源:ISimpleMediaPlayer.java


注:本文中的uk.co.caprica.vlcj.player.MediaPlayerEventAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。