Module webrtc.java

Class MediaStream

java.lang.Object
dev.onvoid.webrtc.internal.NativeObject
dev.onvoid.webrtc.internal.DisposableNativeObject
dev.onvoid.webrtc.media.MediaStream

public class MediaStream extends dev.onvoid.webrtc.internal.DisposableNativeObject
A MediaStream is used to group several MediaStreamTrack objects into one unit that can be recorded or rendered. Each MediaStream can contain zero or more MediaStreamTrack objects.
  • Method Details

    • id

      public String id()
      Returns the media stream ID which was initialized when the object was created.
      Returns:
      The media stream ID.
    • getAudioTracks

      public AudioTrack[] getAudioTracks()
      Returns an array of MediaStreamTrack objects representing the audio tracks in this stream.
      Returns:
      The audio tracks in this stream.
    • getVideoTracks

      public VideoTrack[] getVideoTracks()
      Returns an array of MediaStreamTrack objects representing the video tracks in this stream.
      Returns:
      The video tracks in this stream.
    • addTrack

      public void addTrack(MediaStreamTrack track)
      Adds the given MediaStreamTrack to this MediaStream.
      Parameters:
      track - The track to add.
    • removeTrack

      public void removeTrack(MediaStreamTrack track)
      Removes the given MediaStreamTrack object from this MediaStream.
      Parameters:
      track - The track to remove.
    • dispose

      public void dispose()
      Description copied from class: dev.onvoid.webrtc.internal.DisposableNativeObject
      Invoke native object destructors and free native resources.
      Specified by:
      dispose in class dev.onvoid.webrtc.internal.DisposableNativeObject