⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 player.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 be prefetched.<DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - Thrown if the caller does not have security permission to prefetch the <code>Player</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="start()"><!-- --></A><H3>
start</H3>
<PRE>
public void <B>start</B>()           throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE>
<DL>
<DD>Starts the <code>Player</code> as soon as possible. If the <code>Player</code> was previously stopped by calling <code>stop</code>, it will resume playback from where it was previously stopped.  If the  <code>Player</code> has reached the end of media, calling <code>start</code> will automatically start the playback from the start of the media. <p> When <code>start</code> returns successfully,  the <code>Player</code> must have been started and  a <code>STARTED</code> event will  be delivered to the registered <code>PlayerListener</code>s. However, the <code>Player</code> is not guaranteed to be in the <i>STARTED</i> state.  The <code>Player</code> may have already stopped (in the <i>PREFETCHED</i> state) because  the media has 0 or a very short duration. <p> If <code>start</code> is called when the <code>Player</code> is in the <i>UNREALIZED</i> or <i>REALIZED</i> state, it will implicitly call <code>prefetch</code>. <p> If <code>start</code> is called when the <code>Player</code> is in the <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 started.<DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - Thrown if the caller does not have security permission to start the <code>Player</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="stop()"><!-- --></A><H3>
stop</H3>
<PRE>
public void <B>stop</B>()          throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE>
<DL>
<DD>Stops the <code>Player</code>.  It will pause the playback at the current media time. <p> When <code>stop</code> returns, the <code>Player</code> is in the  <i>PREFETCHED</i> state. A <code>STOPPED</code> event will be delivered to the registered <code>PlayerListener</code>s. <p> If <code>stop</code> is called on a stopped <code>Player</code>, the request is 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 stopped.</DL>
</DD>
</DL>
<HR>

<A NAME="deallocate()"><!-- --></A><H3>
deallocate</H3>
<PRE>
public void <B>deallocate</B>()</PRE>
<DL>
<DD>Release the scarce or exclusive resources like the audio device acquired by the <code>Player</code>. <p> When <code>deallocate</code> returns, the <code>Player</code> is in the <i>UNREALIZED</i> or <i>REALIZED</i> state. <p> If the <code>Player</code> is blocked at the <code>realize</code> call while realizing, calling <code>deallocate</code> unblocks the <code>realize</code> call and returns the <code>Player</code> to the <i>UNREALIZED</i> state. Otherwise, calling <code>deallocate</code> returns the <code>Player</code> to  the <i>REALIZED</i> state. <p> If <code>deallocate</code> is called when the <code>Player</code> is in the <i>UNREALIZED</i> or <i>REALIZED</i> state, the request is ignored. <p> If the <code>Player</code> is <code>STARTED</code> when <code>deallocate</code> is called, <code>deallocate</code> will implicitly call <code>stop</code> on the <code>Player</code>.<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.</DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()</PRE>
<DL>
<DD>Close the <code>Player</code> and release its resources. <p> When the method returns, the <code>Player</code> is in the <i>CLOSED</i> state and can no longer be used. A <code>CLOSED</code> event will be delivered to the registered <code>PlayerListener</code>s. <p> If <code>close</code> is called on a closed <code>Player</code> the request is ignored.<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setMediaTime(long)"><!-- --></A><H3>
setMediaTime</H3>
<PRE>
public long <B>setMediaTime</B>(long&nbsp;now)                  throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE>
<DL>
<DD>Sets the <code>Player</code>'s&nbsp;<i>media time</i>. <p> For some media types, setting the media time may not be very accurate.  The returned value will indicate the  actual media time set. <p> Setting the media time to negative values will effectively set the media time to zero.  Setting the media time to beyond the duration of the media will set the time to the end of media. <p> There are some media types that cannot support the setting of media time.  Calling <code>setMediaTime</code> will throw a <code>MediaException</code> in those cases.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>now</CODE> - The new media time in microseconds.<DT><B>Returns:</B><DD>The actual media time set in microseconds.<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>UNREALIZED</i> or <i>CLOSED</i> state.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if the media time cannot be set.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/media/Player.html#getMediaTime()"><CODE>getMediaTime()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMediaTime()"><!-- --></A><H3>
getMediaTime</H3>
<PRE>
public long <B>getMediaTime</B>()</PRE>
<DL>
<DD>Gets this <code>Player</code>'s current <i>media time</i>. If the <i>media time</i> cannot be determined,  <code>getMediaTime</code> returns <code>TIME_UNKNOWN</code>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The current <i>media time</i> in microseconds or  <code>TIME_UNKNOWN</code>.<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.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/media/Player.html#setMediaTime(long)"><CODE>setMediaTime(long)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getState()"><!-- --></A><H3>
getState</H3>
<PRE>
public int <B>getState</B>()</PRE>
<DL>
<DD>Gets the current state of this <code>Player</code>. The possible states are: <i>UNREALIZED</i>, <i>REALIZED</i>, <i>PREFETCHED</i>, <i>STARTED</i>, <i>CLOSED</i>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The <code>Player</code>'s current state.</DL>
</DD>
</DL>
<HR>

<A NAME="getDuration()"><!-- --></A><H3>
getDuration</H3>
<PRE>
public long <B>getDuration</B>()</PRE>
<DL>
<DD>Get the duration of the media. The value returned is the media's duration when played at the default rate. <br> If the duration cannot be determined (for example, the <code>Player</code> is presenting live media)  <CODE>getDuration</CODE> returns <CODE>TIME_UNKNOWN</CODE>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The duration in microseconds or <code>TIME_UNKNOWN</code>.<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.</DL>
</DD>
</DL>
<HR>

<A NAME="getContentType()"><!-- --></A><H3>
getContentType</H3>
<PRE>
public <A HREF="../../../java/lang/String.html">String</A> <B>getContentType</B>()</PRE>
<DL>
<DD>Get the content type of the media that's being played back by this <code>Player</code>. <p> See <a href="Manager.html#content-type">content type</a> for the syntax of the content type returned.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The content type being played back by this  <code>Player</code>.<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>UNREALIZED</i> or <i>CLOSED</i> state.</DL>
</DD>
</DL>
<HR>

<A NAME="setLoopCount(int)"><!-- --></A><H3>
setLoopCount</H3>
<PRE>
public void <B>setLoopCount</B>(int&nbsp;count)</PRE>
<DL>
<DD>Set the number of times the <code>Player</code> will loop and play the content. <p> By default, the loop count is one.  That is, once started, the <code>Player</code> will start playing from the current media time to the end of media once. <p> If the loop count is set to N where N is bigger than one, starting the <code>Player</code> will start playing the content from the current media time to the end of media. It will then loop back to the beginning of the content  (media time zero) and play till the end of the media. The number of times it will loop to the beginning and  play to the end of media will be N-1. <p> Setting the loop count to 0 is invalid.  An  <code>IllegalArgumentException</code> will be thrown. <p> Setting the loop count to -1 will loop and play the content indefinitely. <p> If the <code>Player</code> is stopped before the preset loop count is reached either because <code>stop</code> is called, calling <code>start</code> again will resume the looping playback from where it was stopped until it fully reaches the preset loop count.  <p>  An <i>END_OF_MEDIA</i> event will be posted  every time the <code>Player</code> reaches the end of media. If the <code>Player</code> loops back to the beginning and starts playing again because it has not completed the loop count, a <i>STARTED</i> event will be posted.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>count</CODE> - indicates the number of times the content will be played.  1 is the default.  0 is invalid.  -1 indicates looping  indefintely.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - Thrown if the given count is invalid.<DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - Thrown if the  <code>Player</code> is in the <i>STARTED</i>  or <i>CLOSED</i> state.</DL>
</DD>
</DL>
<HR>

<A NAME="addPlayerListener(javax.microedition.media.PlayerListener)"><!-- --></A><H3>
addPlayerListener</H3>
<PRE>
public void <B>addPlayerListener</B>(<A HREF="../../../javax/microedition/media/PlayerListener.html">PlayerListener</A>&nbsp;playerListener)</PRE>
<DL>
<DD>Add a player listener for this player.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>playerListener</CODE> - the listener to add. If <code>null</code> is used, the request will be ignored.<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.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/media/Player.html#removePlayerListener(javax.microedition.media.PlayerListener)"><CODE>removePlayerListener(javax.microedition.media.PlayerListener)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="removePlayerListener(javax.microedition.media.PlayerListener)"><!-- --></A><H3>
removePlayerListener</H3>
<PRE>
public void <B>removePlayerListener</B>(<A HREF="../../../javax/microedition/media/PlayerListener.html">PlayerListener</A>&nbsp;playerListener)</PRE>
<DL>
<DD>Remove a player listener for this player.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>playerListener</CODE> - the listener to remove. If <code>null</code> is used or the given  <code>playerListener</code> is not a listener for this <code>Player</code>, the request will be ignored.<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.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/media/Player.html#addPlayerListener(javax.microedition.media.PlayerListener)"><CODE>addPlayerListener(javax.microedition.media.PlayerListener)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Player.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/media/Controllable.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/media/PlayerListener.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Player.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -