Package org.zkoss.stateless.state
Class IAudioController
java.lang.Object
org.zkoss.stateless.state.IAudioController
An
IAudio controller to control play, stop, pause, and some status with
the given audio instance.
Note: this class is not thread-safe, so when it's used in multi-threading environment, the developer should handle the threading issue.
- Author:
- katherine
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the immutable audio instance that the controller to build with.booleanisEnded()Return whether the audio is ended.booleanisPaused()Return whether the audio is paused.booleanReturn whether the audio is playing.booleanReturn whether the audio is stopped.static IAudioControllerReturns the controller instance with the givenaudiovoidpause()Pauses the audio at the client.voidplay()Plays the audio at the client.voidstop()Stops the audio at the client.
-
Field Details
-
STOP
public static final int STOP- See Also:
-
PLAY
public static final int PLAY- See Also:
-
PAUSE
public static final int PAUSE- See Also:
-
END
public static final int END- See Also:
-
-
Method Details
-
play
public void play()Plays the audio at the client. -
stop
public void stop()Stops the audio at the client. -
pause
public void pause()Pauses the audio at the client. -
of
Returns the controller instance with the givenaudio- Parameters:
owner- The controller to control with
-
build
Returns the immutable audio instance that the controller to build with. -
isPlaying
public boolean isPlaying()Return whether the audio is playing.- Returns:
- true if audio is playing;
-
isPaused
public boolean isPaused()Return whether the audio is paused.- Returns:
- true if audio is paused;
-
isStopped
public boolean isStopped()Return whether the audio is stopped. While the audio is ended, also means it is stopped.- Returns:
- true if audio is stopped or ended;
-
isEnded
public boolean isEnded()Return whether the audio is ended.- Returns:
- true if audio is ended;
-