Class IAudioController

java.lang.Object
org.zkoss.stateless.state.IAudioController

public class IAudioController extends Object
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
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the immutable audio instance that the controller to build with.
    boolean
    Return whether the audio is ended.
    boolean
    Return whether the audio is paused.
    boolean
    Return whether the audio is playing.
    boolean
    Return whether the audio is stopped.
    of(IAudio owner)
    Returns the controller instance with the given audio
    void
    Pauses the audio at the client.
    void
    Plays the audio at the client.
    void
    Stops the audio at the client.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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

      public static IAudioController of(IAudio owner)
      Returns the controller instance with the given audio
      Parameters:
      owner - The controller to control with
    • build

      public IAudio 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;