Top Description Constructors Methods
com.sun.media.jfxmedia

public Class MediaManager

extends Object
Class Inheritance
Imports
com.sun.media.jfxmedia.events.MediaErrorListener, com.sun.media.jfxmedia.locator.Locator, com.sun.media.jfxmediaimpl.NativeMediaManager, java.util.List

Factory class used to create media objects, players, and recorders, and to manage other global functionality.
See Also
MediaPlayer, MediaRecorder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
addMediaErrorListener(MediaErrorListener
The listener to add.
listener
)

Add a global listener for warnings.

public static boolean
canPlayContentType(String contentType)

Whether a media source having the indicated content type may be played.

public static boolean
canPlayProtocol(String protocol)

Whether a media source having the indicated protocol may be played.

public static List<MediaPlayer>

Returns:

a List of all un-disposed players or null.
getAllMediaPlayers
()

Retrieve all un-disposed MediaPlayers.

public static Media

Returns:

Media object
getMedia
(Locator locator)

Gets a Media object for the clip.

public static MetadataParser
public static MediaPlayer

Returns:

MediaPlayer object
getPlayer
(Locator locator)

Get a player for the media locator

public static String[]

Returns:

String array of supported content types.
getSupportedContentTypes
()

public static void
registerMediaPlayerForDispose(Object
- Object to watch for strong references
obj
,
MediaPlayer
- MediaPlayer to dispose
player
)

This function will register MediaPlayer for disposing when obj parameter does not have any strong reference.

public static void
removeMediaErrorListener(MediaErrorListener
The listener to remove.
listener
)

Remove a global listener for warnings.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MediaManagerback to summary
private MediaManager()

Method Detail

addMediaErrorListenerback to summary
public static void addMediaErrorListener(MediaErrorListener listener)

Add a global listener for warnings. This listener will receive warnings which occur fall outside the context of a particular player or recorder.

Parameters
listener:MediaErrorListener

The listener to add.

Exceptions
IllegalArgumentException:
if listener is null.
canPlayContentTypeback to summary
public static boolean canPlayContentType(String contentType)

Whether a media source having the indicated content type may be played.

Exceptions
IllegalArgumentException:
if contentType is null.
canPlayProtocolback to summary
public static boolean canPlayProtocol(String protocol)

Whether a media source having the indicated protocol may be played.

Exceptions
IllegalArgumentException:
if contentType is null.
getAllMediaPlayersback to summary
public static List<MediaPlayer> getAllMediaPlayers()

Retrieve all un-disposed MediaPlayers.

Returns:List<MediaPlayer>

a List of all un-disposed players or null.

getMediaback to summary
public static Media getMedia(Locator locator)

Gets a Media object for the clip. It cannot be played without attaching to a MediaPlayer.

Returns:Media

Media object

Exceptions
IllegalArgumentException:
if locator is null.
getMetadataParserback to summary
public static MetadataParser getMetadataParser(Locator locator)
getPlayerback to summary
public static MediaPlayer getPlayer(Locator locator)

Get a player for the media locator

Returns:MediaPlayer

MediaPlayer object

Exceptions
IllegalArgumentException:
if locator is null.
getSupportedContentTypesback to summary
public static String[] getSupportedContentTypes()
Returns:String[]

String array of supported content types.

registerMediaPlayerForDisposeback to summary
public static void registerMediaPlayerForDispose(Object obj, MediaPlayer player)

This function will register MediaPlayer for disposing when obj parameter does not have any strong reference.

Parameters
obj:Object

- Object to watch for strong references

player:MediaPlayer

- MediaPlayer to dispose

removeMediaErrorListenerback to summary
public static void removeMediaErrorListener(MediaErrorListener listener)

Remove a global listener for warnings.

Parameters
listener:MediaErrorListener

The listener to remove.

Exceptions
IllegalArgumentException:
if listener is null.