Class IVideoController


  • public class IVideoController
    extends java.lang.Object
    An IVideo 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int END  
      static int PAUSE  
      static int PLAY  
      static int STOP  
    • 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 given video
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 given video
        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;