Top Description Fields Constructors Methods
com.sun.media.jfxmedia

public abstract Class Media

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.media.jfxmediaimpl.NativeMedia
Imports
java.util.Map, .ArrayList, .List, com.sun.media.jfxmedia.locator.Locator, com.sun.media.jfxmedia.track.Track

A class representing a particular media.
See Also
MediaManager, MediaPlayer

Field Summary

Modifier and TypeField and Description
private Locator
private final List<Track>

Constructor Summary

AccessConstructor and Description
protected
Media(Locator
Locator of the Media
locator
)

Create a Media object.

Method Summary

Modifier and TypeMethod and Description
public abstract void
addMarker(String
Arbitrary name of the marker
markerName
,
double
Presentation time for the marker
presentationTime
)

Adds a marker to the media playback.

protected void
addTrack(Track track)

Adds a Track.

public Locator

Returns:

the source Locator.
getLocator
()

Gets the Locator which was the source of the media.

public abstract Map<String, Double>

Returns:

the markers or null if no markers found.
getMarkers
()

Get the markers of the media.

public List<Track>

Returns:

the tracks in the media or null if no tracks found.
getTracks
()

Gets the tracks found in the media.

public abstract void
removeAllMarkers()

Removes all markers, added programmatically, from the media playback.

public abstract double

Returns:

The presentation time of the deleted marker.
removeMarker
(String
Name of the marker
markerName
)

Removes a marker by name.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

locatorback to summary
private Locator locator
tracksback to summary
private final List<Track> tracks

Constructor Detail

Mediaback to summary
protected Media(Locator locator)

Create a Media object.

Parameters
locator:Locator

Locator of the Media

Exceptions
IllegalArgumentException:
if locator is null.

Method Detail

addMarkerback to summary
public abstract void addMarker(String markerName, double presentationTime)

Adds a marker to the media playback. This marker will not be as precise as embedded markers in the media file.

Parameters
markerName:String

Arbitrary name of the marker

presentationTime:double

Presentation time for the marker

Exceptions
IllegalArgumentException:
if markerName is null or presentationTime is negative.
addTrackback to summary
protected void addTrack(Track track)

Adds a Track.

Exceptions
IllegalArgumentException:
if track is null.
getLocatorback to summary
public Locator getLocator()

Gets the Locator which was the source of the media.

Returns:Locator

the source Locator.

getMarkersback to summary
public abstract Map<String, Double> getMarkers()

Get the markers of the media. The returned Map is unmodifiable.

Returns:Map<String, Double>

the markers or null if no markers found.

getTracksback to summary
public List<Track> getTracks()

Gets the tracks found in the media. The returned value will be null if no tracks have yet been encountered while scanning the media. The returned List is unmodifiable.

Returns:List<Track>

the tracks in the media or null if no tracks found.

removeAllMarkersback to summary
public abstract void removeAllMarkers()

Removes all markers, added programmatically, from the media playback. Embedded markers will still cause notifications to fire.

removeMarkerback to summary
public abstract double removeMarker(String markerName)

Removes a marker by name.

Parameters
markerName:String

Name of the marker

Returns:double

The presentation time of the deleted marker.

Exceptions
IllegalArgumentException:
if markerName is null.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override