- 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.DisposableNativeObjectA 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTrack(MediaStreamTrack track)Adds the given MediaStreamTrack to this MediaStream.voiddispose()Invoke native object destructors and free native resources.AudioTrack[]getAudioTracks()Returns an array of MediaStreamTrack objects representing the audio tracks in this stream.VideoTrack[]getVideoTracks()Returns an array of MediaStreamTrack objects representing the video tracks in this stream.Stringid()Returns the media stream ID which was initialized when the object was created.voidremoveTrack(MediaStreamTrack track)Removes the given MediaStreamTrack object from this MediaStream.
-
-
-
Method Detail
-
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.DisposableNativeObjectInvoke native object destructors and free native resources.- Specified by:
disposein classdev.onvoid.webrtc.internal.DisposableNativeObject
-
-