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


Java MediaPlayerFactory类代码示例

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


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

示例1: main

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
/**
 * Inicia el programa.
 *
 * @param args Ninguno.
 */
public static void main(String[] args) {
    // Inicia DDS
    iniciaDds();

    // Crea la ventana del reproductor
    Canvas canvas = new Canvas();
    canvas.setBackground(Color.black);

    JPanel contentPane = new JPanel();
    contentPane.setBackground(Color.black);
    contentPane.setLayout(new BorderLayout());
    contentPane.add(canvas, BorderLayout.CENTER);

    JFrame frame = new JFrame("Capture");
    frame.setContentPane(contentPane);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setLocation(50, 50);
    frame.setSize(800, 600);

    MediaPlayerFactory factory = new MediaPlayerFactory();
    EmbeddedMediaPlayer mediaPlayer = factory.newEmbeddedMediaPlayer();

    CanvasVideoSurface videoSurface = factory.newVideoSurface(canvas);
    mediaPlayer.setVideoSurface(videoSurface);

    // Reproduce el vídeo.
    frame.setVisible(true);
    mediaPlayer.playMedia("http://localhost:" + PORT);
}
 
开发者ID:Prometheus-ETSIIT,项目名称:locaviewer,代码行数:35,代码来源:Cliente.java

示例2: initialize

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
/**
 * Initialize the instance and create a new player.
 * 
 * @param factory
 *            the factory for creating a new player
 * @param volume
 *            the initial volume
 */
void initialize(final MediaPlayerFactory factory, final float volume) {
    final MediaRenderer instance = this;

    // Release the VLC player instance in the dedicated thread
    mediaManager.executeThreadSafe(new Runnable() {
        @Override
        public void run() {
            // Create the VLC media player instance
            DirectMediaPlayer player = factory.newDirectMediaPlayer("RGBA", width, height, width * 4, instance);
            player.setPlaySubItems(true);
            player.setRepeat(true);
            player.addMediaPlayerEventListener(listener = new PlayerEventListener(instance));
            player.setVolume((int) (volume * 100));

            instance.player = player;
        }
    });
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:27,代码来源:MediaRenderer.java

示例3: VLCPlayer

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
VLCPlayer(ElphelVision parent) {
this.Parent = parent;
List<String> vlcArgs = new ArrayList<String>();

vlcArgs.add("--no-video-title-show");
vlcArgs.add("--rtsp-caching=50");
vlcArgs.add("--clock-jitter=0");

// This burns so many people on Windows that I decided to leave it in...
if (RuntimeUtil.isWindows()) {
    vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
}

// fullScreenStrategy = new
// DefaultFullScreenStrategy(Parent.GetMainframe());

mediaPlayerFactory = new MediaPlayerFactory(vlcArgs.toArray(new String[vlcArgs.size()]));
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(fullScreenStrategy);
// mediaPlayer = mediaPlayerFactory.newMediaPlayer(null);
   }
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_eclipse,代码行数:21,代码来源:VLCPlayer.java

示例4: VLCPlayer

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
VLCPlayer(ElphelVision parent) {
    this.Parent = parent;
    List<String> vlcArgs = new ArrayList<String>();
    
    vlcArgs.add("--no-video-title-show");
    vlcArgs.add("--rtsp-caching=50");
    vlcArgs.add("--clock-jitter=0");

    // This burns so many people on Windows that I decided to leave it in...
    if (RuntimeUtil.isWindows()) {
        vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
    }

    //fullScreenStrategy = new DefaultFullScreenStrategy(Parent.GetMainframe());

    mediaPlayerFactory = new MediaPlayerFactory(vlcArgs.toArray(new String[vlcArgs.size()]));
    mediaPlayer = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
    //mediaPlayer = mediaPlayerFactory.newMediaPlayer(null);
}
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_netbeans,代码行数:20,代码来源:VLCPlayer.java

示例5: create

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public void create(String filepath) throws Error {

		camera = new OrthographicCamera();
		camera.setToOrtho(false, w, h);
		camera.update();

		LibXUtil.initialise();
		NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcpath);

		Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);

		image = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration()
				.createCompatibleImage((int) w, (int) h);
		image.setAccelerationPriority(1.0f);

		String[] args = null;
		if ((System.getProperty("os.name").toLowerCase().indexOf("mac") >= 0)) {
			String pluginpath = vlcpath.substring(0, vlcpath.lastIndexOf('/')) + "/plugins";
			System.out.println(pluginpath);
			uk.co.caprica.vlcj.binding.LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", pluginpath, 1);
			args = new String[] { "--no-video-title-show", "--verbose=3", "--vout=macosx" };
		} else {
			args = new String[] { "--no-video-title-show", "--verbose=3" };
		}

		factory = new MediaPlayerFactory(args);
		mediaPlayer = factory.newDirectMediaPlayer(new TestBufferFormatCallback(), new TestRenderCallback());
		mediaPlayer.prepareMedia(filepath);
		mediaPlayer.start();
		mediaPlayer.pause();

		System.out.println(LibVlc.INSTANCE.libvlc_get_version());
	}
 
开发者ID:exch-bms2,项目名称:beatoraja,代码行数:34,代码来源:VLCMovieProcessor.java

示例6: MediaManager

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
/**
 * Construct a new media manager.
 */
public MediaManager() {
    // In order to prevent freezing when changing media, the player will be
    // called from this dedicated thread
    executor = Executors.newFixedThreadPool(1);

    try {
        factory = new MediaPlayerFactory(getFactoryOptions());
    } catch (Throwable t) {
        PlayBlock.log(Level.WARN, "Failed to find VLC!", t);
    }

    volume = PlayBlock.getClientRuntime().getClientOptions().getFloat("volume", 1);
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:17,代码来源:MediaManager.java

示例7: setVideoRelease

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public void setVideoRelease(EmbeddedMediaPlayer mediaPlayer, MediaPlayerFactory mediaPlayerFactory) {
	try {
	mediaPlayerFactoryThread = mediaPlayerFactory;
	mediaPlayerThread = mediaPlayer;
	}
	catch (Exception ex) {
		logger.error("Video release " + ex.getLocalizedMessage(), ex);
	}
}
 
开发者ID:guide-me,项目名称:GuideMe,代码行数:10,代码来源:MainShell.java

示例8: getMediaPlayerFactory

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
private MediaPlayerFactory getMediaPlayerFactory(){
	if(vlcfactory == null){
		vlcfactory = createFactory();
		releasePlayer();
	}
	return vlcfactory;
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:8,代码来源:MediaPlayerVLC.java

示例9: ScreenRecorder

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public ScreenRecorder() {
	NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), System.getProperty("user.dir")+"/lib");
	System.setProperty("VLC_PLUGIN_PATH",  System.getProperty("user.dir")+"/lib/plugins");
	mediaPlayerFactory = new MediaPlayerFactory(OPTIONS);
	mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
}
 
开发者ID:experimentalqa,项目名称:MP4ScreenRecorder,代码行数:7,代码来源:ScreenRecorder.java

示例10: EpisodePanel

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public EpisodePanel(Frame owner){
	
	this.owner = owner;
	
	this.setLayout(new BorderLayout());
	
	Canvas canvas = new Canvas();
       canvas.setBackground(Color.black);
	
	this.add(canvas, BorderLayout.CENTER);
	
	player.setVideoSurface(new MediaPlayerFactory().newVideoSurface(canvas));
	player.mute(true);
	player.addMediaPlayerEventListener(new MediaPauserEventListener());
	
	this.add(Box.createRigidArea(new Dimension(120, 140)), BorderLayout.SOUTH);
	
}
 
开发者ID:redSpoutnik,项目名称:AutoRename,代码行数:19,代码来源:EpisodePanel.java

示例11: VlcPlayerImplementation

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
protected VlcPlayerImplementation(String[] options) {
    this.mediaPlayerFactory = new MediaPlayerFactory(options);
    mediaPlayer = this.mediaPlayerFactory.newEmbeddedMediaPlayer(null);
}
 
开发者ID:MarkXLII,项目名称:subtitle-studio,代码行数:5,代码来源:VlcPlayerImplementation.java

示例12: StreamServer

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public StreamServer(String libPath) {
    LOGGER.info("add libvlc path" + libPath);
    NativeLibrary.addSearchPath("libvlc", libPath);
    mediaPlayerFactory = new MediaPlayerFactory();
}
 
开发者ID:at15,项目名称:cs433,代码行数:6,代码来源:StreamServer.java

示例13: StreamClient

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
public StreamClient(String libPath){
    LOGGER.info("add libvlc path" + libPath);
    NativeLibrary.addSearchPath("libvlc", libPath);
    mediaPlayerFactory = new MediaPlayerFactory();
}
 
开发者ID:at15,项目名称:cs433,代码行数:6,代码来源:StreamClient.java

示例14: createMediaPlayer

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
private MediaPlayer createMediaPlayer(){
	MediaPlayer mediaPlayer = null;
	MediaPlayerFactory playerFactory = getMediaPlayerFactory();
	mediaPlayer = playerFactory.newDirectMediaPlayer(formatCallback, renderCallback);
	return mediaPlayer;
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:7,代码来源:MediaPlayerVLC.java

示例15: createFactory

import uk.co.caprica.vlcj.player.MediaPlayerFactory; //导入依赖的package包/类
private MediaPlayerFactory createFactory(){
       logger.info("creating new MediaPlayerFactory...");

	String[] myargs = args;

	if(!applicationSettings.isEnableDirectPlaySound())
		myargs = Lists.concat(args, directPlaySund);

	return new MediaPlayerFactory(myargs);
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:11,代码来源:MediaPlayerVLC.java


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