Class MediaStream.Builder<B extends MediaStream.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
MediaFile.Builder
Enclosing class:
MediaStream

public static class MediaStream.Builder<B extends MediaStream.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public MediaStream build()
      Finish building the MediaStream object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to MediaStream.
      Overrides:
      build in class GObject.Builder<B extends MediaStream.Builder<B>>
      Returns:
      a new instance of MediaStream with the properties that were set in the Builder object.
    • setLoop

      public B setLoop(boolean loop)
      Try to restart the media from the beginning once it ended.
      Parameters:
      loop - the value for the loop property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMuted

      public B setMuted(boolean muted)
      Whether the audio stream should be muted.
      Parameters:
      muted - the value for the muted property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPlaying

      public B setPlaying(boolean playing)
      Whether the stream is currently playing.
      Parameters:
      playing - the value for the playing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVolume

      public B setVolume(double volume)
      Volume of the audio stream.
      Parameters:
      volume - the value for the volume property
      Returns:
      the Builder instance is returned, to allow method chaining