<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_191) on Wed Oct 31 14:01:54 UTC 2018 --> <title>Media (JavaFX 8)</title> <meta name="date" content="2018-10-31"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Media (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Media.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/media/EqualizerBand.html" title="class in javafx.scene.media"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/media/MediaErrorEvent.html" title="class in javafx.scene.media"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/media/Media.html" target="_top">Frames</a></li> <li><a href="Media.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.scene.media</div> <h2 title="Class Media" class="title">Class Media</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>javafx.scene.media.Media</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public final class <span class="typeNameLabel">Media</span> extends java.lang.Object</pre> <div class="block">The <code>Media</code> class represents a media resource. It is instantiated from the string form of a source URI. Information about the media such as duration, metadata, tracks, and video resolution may be obtained from a <code>Media</code> instance. The media information is obtained asynchronously and so not necessarily available immediately after instantiation of the class. All information should however be available if the instance has been associated with a <a href="../../../javafx/scene/media/MediaPlayer.html" title="class in javafx.scene.media"><code>MediaPlayer</code></a> and that player has transitioned to <a href="../../../javafx/scene/media/MediaPlayer.Status.html#READY"><code>MediaPlayer.Status.READY</code></a> status. To be notified when metadata or <a href="../../../javafx/scene/media/Track.html" title="class in javafx.scene.media"><code>Track</code></a>s are added, observers may be registered with the collections returned by <a href="../../../javafx/scene/media/Media.html#getMetadata--"><code>getMetadata()</code></a>and <a href="../../../javafx/scene/media/Media.html#getTracks--"><code>getTracks()</code></a>, respectively. <p>The same <code>Media</code> object may be shared among multiple <code>MediaPlayer</code> objects. Such a shared instance might manage a single copy of the source media data to be used by all players, or it might require a separate copy of the data for each player. The choice of implementation will not however have any effect on player behavior at the interface level.</p></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.0</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/MediaPlayer.html" title="class in javafx.scene.media"><code>MediaPlayer</code></a>, <a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media"><code>MediaException</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== PROPERTY SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="property.summary"> <!-- --> </a> <h3>Property Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Property Summary table, listing properties, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Type</th> <th class="colLast" scope="col">Property and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#durationProperty">duration</a></span></code> <div class="block">The duration in seconds of the source media.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#errorProperty">error</a></span></code> <div class="block">A property set to a MediaException value when an error occurs.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#heightProperty">height</a></span></code> <div class="block">The height in pixels of the source media.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><java.lang.Runnable></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#onErrorProperty">onError</a></span></code> <div class="block">Event handler called when an error occurs.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#widthProperty">width</a></span></code> <div class="block">The width in pixels of the source media.</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#Media-java.lang.String-">Media</a></span>(java.lang.String source)</code> <div class="block">Constructs a <code>Media</code> instance.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#durationProperty--">durationProperty</a></span>()</code> <div class="block">The duration in seconds of the source media.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#errorProperty--">errorProperty</a></span>()</code> <div class="block">A property set to a MediaException value when an error occurs.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getDuration--">getDuration</a></span>()</code> <div class="block">Retrieve the duration in seconds of the media.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getError--">getError</a></span>()</code> <div class="block">Return any error encountered in the media.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getHeight--">getHeight</a></span>()</code> <div class="block">Retrieve the height in pixels of the media.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections">ObservableMap</a><java.lang.String,<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getMarkers--">getMarkers</a></span>()</code> <div class="block">Retrieve the markers defined on this <code>Media</code> instance.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections">ObservableMap</a><java.lang.String,java.lang.Object></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getMetadata--">getMetadata</a></span>()</code> <div class="block">Retrieve the metadata contained in this media source.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>java.lang.Runnable</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getOnError--">getOnError</a></span>()</code> <div class="block">Retrieve the error handler to be called if an error occurs.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getSource--">getSource</a></span>()</code> <div class="block">Retrieve the source URI of the media.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/collections/ObservableList.html" title="interface in javafx.collections">ObservableList</a><<a href="../../../javafx/scene/media/Track.html" title="class in javafx.scene.media">Track</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getTracks--">getTracks</a></span>()</code> <div class="block">Retrieve the tracks contained in this media source.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#getWidth--">getWidth</a></span>()</code> <div class="block">Retrieve the width in pixels of the media.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#heightProperty--">heightProperty</a></span>()</code> <div class="block">The height in pixels of the source media.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><java.lang.Runnable></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#onErrorProperty--">onErrorProperty</a></span>()</code> <div class="block">Event handler called when an error occurs.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#setOnError-java.lang.Runnable-">setOnError</a></span>(java.lang.Runnable value)</code> <div class="block">Set the event handler to be called when an error occurs.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/Media.html#widthProperty--">widthProperty</a></span>()</code> <div class="block">The width in pixels of the source media.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ PROPERTY DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="property.detail"> <!-- --> </a> <h3>Property Detail</h3> <a name="errorProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>error</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a>> errorProperty</pre> <div class="block">A property set to a MediaException value when an error occurs. If <code>error</code> is non-<code>null</code>, then the media could not be loaded and is not usable. If <a href="../../../javafx/scene/media/Media.html#onErrorProperty--"><code>onError</code></a> is non-<code>null</code>, it will be invoked when the <code>error</code> property is set.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getError--"><code>getError()</code></a></dd> </dl> </li> </ul> <a name="onErrorProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>onError</h4> <pre>public <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><java.lang.Runnable> onErrorProperty</pre> <div class="block">Event handler called when an error occurs. This will happen if a malformed or invalid URL is passed to the constructor or there is a problem accessing the URL.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getOnError--"><code>getOnError()</code></a>, <a href="../../../javafx/scene/media/Media.html#setOnError-java.lang.Runnable-"><code>setOnError(Runnable)</code></a></dd> </dl> </li> </ul> <a name="widthProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>width</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a> widthProperty</pre> <div class="block">The width in pixels of the source media. This may be zero if the media has no width, e.g., when playing audio, or if the width is currently unknown which may occur with streaming media.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getWidth--"><code>getWidth()</code></a></dd> </dl> </li> </ul> <a name="heightProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>height</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a> heightProperty</pre> <div class="block">The height in pixels of the source media. This may be zero if the media has no height, e.g., when playing audio, or if the height is currently unknown which may occur with streaming media.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getHeight--"><code>getHeight()</code></a></dd> </dl> </li> </ul> <a name="durationProperty"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>duration</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>> durationProperty</pre> <div class="block">The duration in seconds of the source media. If the media duration is unknown then this property value will be <a href="../../../javafx/util/Duration.html#UNKNOWN"><code>Duration.UNKNOWN</code></a>.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getDuration--"><code>getDuration()</code></a></dd> </dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="Media-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Media</h4> <pre>public Media(java.lang.String source)</pre> <div class="block">Constructs a <code>Media</code> instance. This is the only way to specify the media source. The source must represent a valid <code>URI</code> and is immutable. Only HTTP, HTTPS, FILE, and JAR <code>URL</code>s are supported. If the provided URL is invalid then an exception will be thrown. If an asynchronous error occurs, the <a href="../../../javafx/scene/media/Media.html#errorProperty--"><code>error</code></a> property will be set. Listen to this property to be notified of any such errors. <p>If the source uses a non-blocking protocol such as FILE, then any problems which can be detected immediately will cause a <code>MediaException</code> to be thrown. Such problems include the media being inaccessible or in an unsupported format. If however a potentially blocking protocol such as HTTP is used, then the connection will be initialized asynchronously so that these sorts of errors will be signaled by setting the <a href="../../../javafx/scene/media/Media.html#errorProperty--"><code>error</code></a> property.</p> <p>Constraints: <ul> <li>The supplied URI must conform to RFC-2396 as required by <A href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</A>.</li> <li>Only HTTP, HTTPS, FILE, and JAR URIs are supported.</li> </ul> <p>See <A href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</A> for more information about URI formatting in general. JAR URL syntax is specified in <a href="https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html">java.net.JarURLConnection</A>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>source</code> - The URI of the source media.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if the URI string is <code>null</code>.</dd> <dd><code>java.lang.IllegalArgumentException</code> - if the URI string does not conform to RFC-2396 or, if appropriate, the Jar URL specification, or is in a non-compliant form which cannot be modified to a compliant form.</dd> <dd><code>java.lang.IllegalArgumentException</code> - if the URI string has a <code>null</code> scheme.</dd> <dd><code>java.lang.UnsupportedOperationException</code> - if the protocol specified for the source is not supported.</dd> <dd><code><a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a></code> - if the media source cannot be connected (type <a href="../../../javafx/scene/media/MediaException.Type.html#MEDIA_INACCESSIBLE"><code>MediaException.Type.MEDIA_INACCESSIBLE</code></a>) or is not supported (type <a href="../../../javafx/scene/media/MediaException.Type.html#MEDIA_UNSUPPORTED"><code>MediaException.Type.MEDIA_UNSUPPORTED</code></a>).</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getError--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getError</h4> <pre>public final <a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a> getError()</pre> <div class="block">Return any error encountered in the media.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media"><code>MediaException</code></a> or <code>null</code> if there is no error.</dd> </dl> </li> </ul> <a name="errorProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>errorProperty</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a>> errorProperty()</pre> <div class="block">A property set to a MediaException value when an error occurs. If <code>error</code> is non-<code>null</code>, then the media could not be loaded and is not usable. If <a href="../../../javafx/scene/media/Media.html#onErrorProperty--"><code>onError</code></a> is non-<code>null</code>, it will be invoked when the <code>error</code> property is set.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getError--"><code>getError()</code></a></dd> </dl> </li> </ul> <a name="setOnError-java.lang.Runnable-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setOnError</h4> <pre>public final void setOnError(java.lang.Runnable value)</pre> <div class="block">Set the event handler to be called when an error occurs.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - the error event handler.</dd> </dl> </li> </ul> <a name="getOnError--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOnError</h4> <pre>public final java.lang.Runnable getOnError()</pre> <div class="block">Retrieve the error handler to be called if an error occurs.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the error handler or <code>null</code> if none is defined.</dd> </dl> </li> </ul> <a name="onErrorProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>onErrorProperty</h4> <pre>public <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><java.lang.Runnable> onErrorProperty()</pre> <div class="block">Event handler called when an error occurs. This will happen if a malformed or invalid URL is passed to the constructor or there is a problem accessing the URL.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getOnError--"><code>getOnError()</code></a>, <a href="../../../javafx/scene/media/Media.html#setOnError-java.lang.Runnable-"><code>setOnError(Runnable)</code></a></dd> </dl> </li> </ul> <a name="getMetadata--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMetadata</h4> <pre>public final <a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections">ObservableMap</a><java.lang.String,java.lang.Object> getMetadata()</pre> <div class="block">Retrieve the metadata contained in this media source. If there are no metadata, the returned <a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections"><code>ObservableMap</code></a> will be empty.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the metadata contained in this media source.</dd> </dl> </li> </ul> <a name="getWidth--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getWidth</h4> <pre>public final int getWidth()</pre> <div class="block">Retrieve the width in pixels of the media.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the media width or zero if the width is undefined or unknown.</dd> </dl> </li> </ul> <a name="widthProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>widthProperty</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a> widthProperty()</pre> <div class="block">The width in pixels of the source media. This may be zero if the media has no width, e.g., when playing audio, or if the width is currently unknown which may occur with streaming media.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getWidth--"><code>getWidth()</code></a></dd> </dl> </li> </ul> <a name="getHeight--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHeight</h4> <pre>public final int getHeight()</pre> <div class="block">Retrieve the height in pixels of the media.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the media height or zero if the height is undefined or unknown.</dd> </dl> </li> </ul> <a name="heightProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>heightProperty</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a> heightProperty()</pre> <div class="block">The height in pixels of the source media. This may be zero if the media has no height, e.g., when playing audio, or if the height is currently unknown which may occur with streaming media.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getHeight--"><code>getHeight()</code></a></dd> </dl> </li> </ul> <a name="getDuration--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDuration</h4> <pre>public final <a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> getDuration()</pre> <div class="block">Retrieve the duration in seconds of the media.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the duration of the media, <a href="../../../javafx/util/Duration.html#UNKNOWN"><code>Duration.UNKNOWN</code></a> if unknown or <a href="../../../javafx/util/Duration.html#INDEFINITE"><code>Duration.INDEFINITE</code></a> for live streams</dd> </dl> </li> </ul> <a name="durationProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>durationProperty</h4> <pre>public <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>> durationProperty()</pre> <div class="block">The duration in seconds of the source media. If the media duration is unknown then this property value will be <a href="../../../javafx/util/Duration.html#UNKNOWN"><code>Duration.UNKNOWN</code></a>.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/Media.html#getDuration--"><code>getDuration()</code></a></dd> </dl> </li> </ul> <a name="getTracks--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTracks</h4> <pre>public final <a href="../../../javafx/collections/ObservableList.html" title="interface in javafx.collections">ObservableList</a><<a href="../../../javafx/scene/media/Track.html" title="class in javafx.scene.media">Track</a>> getTracks()</pre> <div class="block">Retrieve the tracks contained in this media source. If there are no tracks, the returned <a href="../../../javafx/collections/ObservableList.html" title="interface in javafx.collections"><code>ObservableList</code></a> will be empty.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the tracks contained in this media source.</dd> </dl> </li> </ul> <a name="getMarkers--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMarkers</h4> <pre>public final <a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections">ObservableMap</a><java.lang.String,<a href="../../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>> getMarkers()</pre> <div class="block">Retrieve the markers defined on this <code>Media</code> instance. If there are no markers the returned <a href="../../../javafx/collections/ObservableMap.html" title="interface in javafx.collections"><code>ObservableMap</code></a> will be empty. Programmatic markers may be added by inserting entries in the returned <code>Map</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the markers defined on this media source.</dd> </dl> </li> </ul> <a name="getSource--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getSource</h4> <pre>public java.lang.String getSource()</pre> <div class="block">Retrieve the source URI of the media.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the media source URI as a <code>String</code>.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Media.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/media/EqualizerBand.html" title="class in javafx.scene.media"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/media/MediaErrorEvent.html" title="class in javafx.scene.media"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/media/Media.html" target="_top">Frames</a></li> <li><a href="Media.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"><a href="http://bugreport.java.com/bugreport/" target="_blank">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="https://docs.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html" target="_blank">Copyright</a> © 2008, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to <a href="http://download.oracle.com/otndocs/jcp/java_se-8-mrel-spec/license.html" target="_blank">license terms</a>. Also see the <a target="_blank" href="http://www.oracle.com/technetwork/java/redist-137594.html" target="_blank">documentation redistribution policy</a>.</font></small></p> </body> </html>