|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.caprica.vlcj.player.MediaPlayerFactory
public class MediaPlayerFactory
Factory for media player instances.
The factory initialises a single libvlc instance and uses that to create media player instances.
If required, you can create multiple factory instances each with their own libvlc options.
This factory attempts to determine the run-time operating system and create an appropriate media player instance.
You should release the factory when your application terminates to properly clean up native resources.
The factory also provides access to the native libvlc Logger.
Usage:
// Set some options for libvlc String[] libvlcArgs = {...add options here...}; // Create a factory instance (once), you can keep a reference to this MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs); // Create a full-screen strategy FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(mainFrame); // Create a media player instance for the run-time operating system EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy); // Do some interesting things with the media player ... // Release the media player mediaPlayer.release(); // Release the factory factory.release();
Constructor Summary | |
---|---|
MediaPlayerFactory()
Create a new media player factory. |
|
MediaPlayerFactory(LibVlc libvlc)
Create a new media player factory. |
|
MediaPlayerFactory(java.lang.String[] libvlcArgs)
Create a new media player factory. |
|
MediaPlayerFactory(java.lang.String[] libvlcArgs,
LibVlc libvlc)
Create a new media player factory. |
Method Summary | |
---|---|
java.util.List<AudioOutput> |
getAudioOutputs()
Get the available audio outputs. |
int |
getLogVerbosity()
Get the current log verbosity level. |
Log |
newLog()
Get a new message Logger. |
MediaList |
newMediaList()
|
MediaListPlayer |
newMediaListPlayer()
|
HeadlessMediaPlayer |
newMediaPlayer()
Create a new head-less media player. |
EmbeddedMediaPlayer |
newMediaPlayer(FullScreenStrategy fullScreenStrategy)
Create a new embedded media player. |
DirectMediaPlayer |
newMediaPlayer(int width,
int height,
RenderCallback renderCallback)
Create a new direct video rendering media player. |
void |
release()
Release the native resources associated with this factory. |
void |
setLogLevel(LogLevel level)
Set the log verbosity level. |
void |
setUserAgent(java.lang.String userAgent)
Set the application name. |
void |
setUserAgent(java.lang.String userAgent,
java.lang.String httpUserAgent)
Set the application name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MediaPlayerFactory()
This factory uses an implementation of the interface to the native libvlc library that is synchronised and logs each method invocation - if you do not want this behaviour you must use one of the other constructors.
public MediaPlayerFactory(java.lang.String[] libvlcArgs)
This factory uses an implementation of the interface to the native libvlc library that is synchronised and logs each method invocation - if you do not want this behaviour you must use one of the other constructors.
libvlcArgs
- initialisation arguments to pass to libvlcpublic MediaPlayerFactory(LibVlc libvlc)
libvlc
- interface to the native librarypublic MediaPlayerFactory(java.lang.String[] libvlcArgs, LibVlc libvlc)
libvlcArgs
- initialisation arguments to pass to libvlclibvlc
- interface to the native libraryMethod Detail |
---|
public void setUserAgent(java.lang.String userAgent)
userAgent
- application namepublic void setUserAgent(java.lang.String userAgent, java.lang.String httpUserAgent)
userAgent
- application namehttpUserAgent
- application name for HTTPpublic int getLogVerbosity()
public void setLogLevel(LogLevel level)
level
- log levelpublic java.util.List<AudioOutput> getAudioOutputs()
public void release()
public EmbeddedMediaPlayer newMediaPlayer(FullScreenStrategy fullScreenStrategy)
fullScreenStrategy
- full screen implementation, may be null
public DirectMediaPlayer newMediaPlayer(int width, int height, RenderCallback renderCallback)
width
- height
- renderCallback
-
public HeadlessMediaPlayer newMediaPlayer()
public MediaListPlayer newMediaListPlayer()
public MediaList newMediaList()
public Log newLog()
The log will be opened.
|
(C)2010 Caprica Software Limited | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |