📄 player.html
字号:
<P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#CLOSED">CLOSED</A></B></CODE><BR> The state of the <code>Player</code> indicating that the <code>Player</code> is closed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#PREFETCHED">PREFETCHED</A></B></CODE><BR> The state of the <code>Player</code> indicating that it has acquired all the resources to begin playing.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#REALIZED">REALIZED</A></B></CODE><BR> The state of the <code>Player</code> indicating that it has acquired the required information but not the resources to function.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#STARTED">STARTED</A></B></CODE><BR> The state of the <code>Player</code> indicating that the <code>Player</code> has already started.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#TIME_UNKNOWN">TIME_UNKNOWN</A></B></CODE><BR> The returned value indicating that the requested time is unknown.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#UNREALIZED">UNREALIZED</A></B></CODE><BR> The state of the <code>Player</code> indicating that it has not acquired the required information and resources to function.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#addPlayerListener(javax.microedition.media.PlayerListener)">addPlayerListener</A></B>(<A HREF="../../../javax/microedition/media/PlayerListener.html">PlayerListener</A> playerListener)</CODE><BR> Add a player listener for this player.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#close()">close</A></B>()</CODE><BR> Close the <code>Player</code> and release its resources.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#deallocate()">deallocate</A></B>()</CODE><BR> Release the scarce or exclusive resources like the audio device acquired by the <code>Player</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#getContentType()">getContentType</A></B>()</CODE><BR> Get the content type of the media that's being played back by this <code>Player</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#getDuration()">getDuration</A></B>()</CODE><BR> Get the duration of the media.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#getMediaTime()">getMediaTime</A></B>()</CODE><BR> Gets this <code>Player</code>'s current <i>media time</i>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#getState()">getState</A></B>()</CODE><BR> Gets the current state of this <code>Player</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#prefetch()">prefetch</A></B>()</CODE><BR> Acquires the scarce and exclusive resources and processes as much data as necessary to reduce the start latency.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#realize()">realize</A></B>()</CODE><BR> Constructs portions of the <code>Player</code> without acquiring the scarce and exclusive resources.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#removePlayerListener(javax.microedition.media.PlayerListener)">removePlayerListener</A></B>(<A HREF="../../../javax/microedition/media/PlayerListener.html">PlayerListener</A> playerListener)</CODE><BR> Remove a player listener for this player.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#setLoopCount(int)">setLoopCount</A></B>(int count)</CODE><BR> Set the number of times the <code>Player</code> will loop and play the content.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#setMediaTime(long)">setMediaTime</A></B>(long now)</CODE><BR> Sets the <code>Player</code>'s <i>media time</i>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#start()">start</A></B>()</CODE><BR> Starts the <code>Player</code> as soon as possible.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/media/Player.html#stop()">stop</A></B>()</CODE><BR> Stops the <code>Player</code>.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.microedition.media.Controllable"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface javax.microedition.media.<A HREF="../../../javax/microedition/media/Controllable.html">Controllable</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/microedition/media/Controllable.html#getControl(java.lang.String)">getControl</A>, <A HREF="../../../javax/microedition/media/Controllable.html#getControls()">getControls</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="UNREALIZED"><!-- --></A><H3>UNREALIZED</H3><PRE>public static final int <B>UNREALIZED</B></PRE><DL><DD>The state of the <code>Player</code> indicating that it has not acquired the required information and resources to function. <p> Value 100 is assigned to <code>UNREALIZED</code>.</DL><HR><A NAME="REALIZED"><!-- --></A><H3>REALIZED</H3><PRE>public static final int <B>REALIZED</B></PRE><DL><DD>The state of the <code>Player</code> indicating that it has acquired the required information but not the resources to function. <p> Value 200 is assigned to <code>REALIZED</code>.</DL><HR><A NAME="PREFETCHED"><!-- --></A><H3>PREFETCHED</H3><PRE>public static final int <B>PREFETCHED</B></PRE><DL><DD>The state of the <code>Player</code> indicating that it has acquired all the resources to begin playing. <p> Value 300 is assigned to <code>PREFETCHED</code>.</DL><HR><A NAME="STARTED"><!-- --></A><H3>STARTED</H3><PRE>public static final int <B>STARTED</B></PRE><DL><DD>The state of the <code>Player</code> indicating that the <code>Player</code> has already started. <p> Value 400 is assigned to <code>STARTED</code>.</DL><HR><A NAME="CLOSED"><!-- --></A><H3>CLOSED</H3><PRE>public static final int <B>CLOSED</B></PRE><DL><DD>The state of the <code>Player</code> indicating that the <code>Player</code> is closed. <p> Value 0 is assigned to <code>CLOSED</code>.</DL><HR><A NAME="TIME_UNKNOWN"><!-- --></A><H3>TIME_UNKNOWN</H3><PRE>public static final long <B>TIME_UNKNOWN</B></PRE><DL><DD>The returned value indicating that the requested time is unknown. <p> Value -1 is assigned to <code>TIME_UNKNOWN</code>.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="realize()"><!-- --></A><H3>realize</H3><PRE>public void <B>realize</B>() throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE><DL><DD>Constructs portions of the <code>Player</code> without acquiring the scarce and exclusive resources. This may include examining media data and may take some time to complete. <p> When <code>realize</code> completes successfully, the <code>Player</code> is in the <i>REALIZED</i> state. <p> If <code>realize</code> is called when the <code>Player</code> is in the <i>REALIZED</i>, <i>PREFETCHTED</i> or <i>STARTED</i> state, the request will be ignored.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - Thrown if the <code>Player</code> is in the <i>CLOSED</i> state.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if the <code>Player</code> cannot be realized.<DD><CODE>SecurityException</CODE> - Thrown if the caller does not have security permission to realize the <code>Player</code>.</DL></DD></DL><HR><A NAME="prefetch()"><!-- --></A><H3>prefetch</H3><PRE>public void <B>prefetch</B>() throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE><DL><DD>Acquires the scarce and exclusive resources and processes as much data as necessary to reduce the start latency. <p> When <code>prefetch</code> completes successfully, the <code>Player</code> is in the <i>PREFETCHED</i> state. <p> If <code>prefetch</code> is called when the <code>Player</code> is in the <i>UNREALIZED</i> state, it will implicitly call <code>realize</code>. <p> If <code>prefetch</code> is called when the <code>Player</code> is already in the <i>PREFETCHED</i> state, the <code>Player</code> may still process data necessary to reduce the start latency. This is to guarantee that start latency can be maintained at a minimum. <p> If <code>prefetch</code> is called when the <code>Player</code> is in the <i>STARTED</i> state, the request will be ignored. <p> If the <code>Player</code> cannot obtain all of the resources it needs, it throws a <code>MediaException</code>. When that happens, the <code>Player</code> will not be able to start. However, <code>prefetch</code> may be called again when the needed resource is later released perhaps by another <code>Player</code> or application.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - Thrown if the <code>Player</code> is in the <i>CLOSED</i> state.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if the <code>Player</code> cannot
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -