Package org.zkoss.stateless.state
Class IVideoController
- java.lang.Object
-
- org.zkoss.stateless.state.IVideoController
-
public class IVideoController extends java.lang.Object
AnIVideo
controller to control play, stop, pause, and some status with the given video 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IVideo
build()
Returns the immutable audio instance that the controller to build with.boolean
isEnded()
Returns whether the video is ended.boolean
isPaused()
Returns whether the video is paused.boolean
isPlaying()
Returns whether the video is playing.boolean
isStopped()
Returns whether the video is stopped.static IVideoController
of(IVideo owner)
Returns the controller instance with the givenvideo
void
pause()
Pauses the video at the client.void
play()
Plays the video at the client.void
setCurrentTime(double currentTime)
Sets which part of video to play.void
stop()
Stops the video at the client.
-
-
-
Field Detail
-
STOP
public static final int STOP
- See Also:
- Constant Field Values
-
PLAY
public static final int PLAY
- See Also:
- Constant Field Values
-
PAUSE
public static final int PAUSE
- See Also:
- Constant Field Values
-
END
public static final int END
- See Also:
- Constant Field Values
-
-
Method Detail
-
play
public void play()
Plays the video at the client.
-
pause
public void pause()
Pauses the video at the client.
-
stop
public void stop()
Stops the video at the client.
-
setCurrentTime
public void setCurrentTime(double currentTime)
Sets which part of video to play.- Parameters:
currentTime
- which part of video to play, the value is in seconds.
-
of
public static IVideoController of(IVideo owner)
Returns the controller instance with the givenvideo
- Parameters:
owner
- The controller to control with
-
build
public IVideo build()
Returns the immutable audio instance that the controller to build with.
-
isPlaying
public boolean isPlaying()
Returns whether the video is playing.- Returns:
- true if video is playing;
-
isPaused
public boolean isPaused()
Returns whether the video is paused.- Returns:
- true if video is paused;
-
isStopped
public boolean isStopped()
Returns whether the video is stopped. While the video is ended, also means it is stopped.- Returns:
- true if video is stopped or ended;
-
isEnded
public boolean isEnded()
Returns whether the video is ended.- Returns:
- true if video is ended;
-
-