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 Summary
Modifier and TypeMethodDescriptionvoid
addTrack
(MediaStreamTrack track) Adds the given MediaStreamTrack to this MediaStream.void
dispose()
Invoke native object destructors and free native resources.Returns an array of MediaStreamTrack objects representing the audio tracks in this stream.Returns an array of MediaStreamTrack objects representing the video tracks in this stream.id()
Returns the media stream ID which was initialized when the object was created.void
removeTrack
(MediaStreamTrack track) Removes the given MediaStreamTrack object from this MediaStream.
-
Method Details
-
id
Returns the media stream ID which was initialized when the object was created.- Returns:
- The media stream ID.
-
getAudioTracks
Returns an array of MediaStreamTrack objects representing the audio tracks in this stream.- Returns:
- The audio tracks in this stream.
-
getVideoTracks
Returns an array of MediaStreamTrack objects representing the video tracks in this stream.- Returns:
- The video tracks in this stream.
-
addTrack
Adds the given MediaStreamTrack to this MediaStream.- Parameters:
track
- The track to add.
-
removeTrack
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 classdev.onvoid.webrtc.internal.DisposableNativeObject
-