|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javazoom.jl.player.PlayerApplet
public class PlayerApplet
A simple applet that plays an MPEG audio file. The URL (relative to the document base) is passed as the "audioURL" parameter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
AUDIO_PARAMETER
|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PlayerApplet()
|
|
| Method Summary | |
|---|---|
protected Thread |
createPlayerThread()
Creates a new thread used to run the audio player. |
void |
destroy()
|
protected AudioDevice |
getAudioDevice()
Retrieves the AudioDevice instance that will
be used to sound the audio data. |
protected String |
getAudioFileName()
|
protected InputStream |
getAudioStream()
Retrieves the InputStream that provides the MPEG audio stream data. |
protected URL |
getAudioURL()
|
String |
getFileName()
|
void |
init()
Initializes this applet. |
protected void |
play(InputStream in,
AudioDevice dev)
Decompresses audio data from an InputStream and plays it back through an AudioDevice. |
void |
run()
The run method for the audio player thread. |
void |
setFileName(String name)
Sets the URL of the audio stream to play. |
void |
start()
Starts this applet. |
void |
stop()
Stops this applet. |
protected void |
stopPlayer()
Stops the audio player. |
| Methods inherited from class java.applet.Applet |
|---|
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String AUDIO_PARAMETER
| Constructor Detail |
|---|
public PlayerApplet()
| Method Detail |
|---|
protected AudioDevice getAudioDevice()
throws JavaLayerException
AudioDevice instance that will
be used to sound the audio data.
JavaLayerExceptionprotected InputStream getAudioStream()
protected String getAudioFileName()
protected URL getAudioURL()
public void setFileName(String name)
public String getFileName()
protected void stopPlayer()
throws JavaLayerException
JavaLayerException
protected void play(InputStream in,
AudioDevice dev)
throws JavaLayerException
in - The InputStream that provides the MPEG audio data.dev - The AudioDevice to use to sound the decompressed data.
JavaLayerException - if there was a problem decoding
or playing the audio data.protected Thread createPlayerThread()
public void init()
init in class Appletpublic void start()
start in class Appletpublic void stop()
stop in class Appletpublic void destroy()
destroy in class Appletpublic void run()
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||