Interface ISubscriberStream

All Superinterfaces:
IClientStream, IStream
All Known Subinterfaces:
IPlaylistSubscriberStream, ISingleItemSubscriberStream
All Known Implementing Classes:
PlaylistSubscriberStream, SingleItemSubscriberStream

public interface ISubscriberStream extends IClientStream
ISubscriberStream is a stream from subscriber's point of view. That is, it provides methods for common stream operations like play, pause or seek.
  • Method Details

    • play

      void play() throws IOException
      Start playing.
      Throws:
      IOException - if an IO error occurred while starting to play the stream
    • pause

      void pause(int position)
      Pause at a position for current playing item.
      Parameters:
      position - Position for pause in millisecond.
    • resume

      void resume(int position)
      Resume from a position for current playing item.
      Parameters:
      position - Position for resume in millisecond.
    • stop

      void stop()
      Stop playing.
      Specified by:
      stop in interface IStream
    • seek

      void seek(int position) throws OperationNotSupportedException
      Seek into a position for current playing item.
      Parameters:
      position - Position for seek in millisecond.
      Throws:
      OperationNotSupportedException - if the stream doesn't support seeking.
    • isPaused

      boolean isPaused()
      Check if the stream is currently paused.
      Returns:
      stream is paused
    • receiveVideo

      void receiveVideo(boolean receive)
      Should the stream send video to the client?
      Parameters:
      receive - toggle
    • receiveAudio

      void receiveAudio(boolean receive)
      Should the stream send audio to the client?
      Parameters:
      receive - toggle
    • getState

      StreamState getState()
      Return the streams state enum.
      Returns:
      current state
    • setState

      void setState(StreamState state)
      Sets the streams state enum.
      Parameters:
      state - sets current state
    • onChange

      void onChange(StreamState state, Object... changed)
      Notification of state change and associated parameters.
      Parameters:
      state - new state
      changed - parameters associated with the change
    • scheduleOnceJob

      String scheduleOnceJob(IScheduledJob job)
      Schedule a job to be executed only once after a 10ms delay.
      Parameters:
      job - scheduled job
      Returns:
      jobName
    • scheduleWithFixedDelay

      String scheduleWithFixedDelay(IScheduledJob job, int interval)
      Schedule a job to be executed regularly at the given interval.
      Parameters:
      job - scheduled job
      interval - interval
      Returns:
      jobName
    • cancelJob

      void cancelJob(String jobName)
      Cancels a scheduled job by name.
      Parameters:
      jobName - job name