The mediaStream interface on webRTC allows multiple MediaStreamTracks and these don't necessary need to be audio and/or video streams from your camera/microphone.
How can I create a MediaStreamTrack using lets say JSON objects?
The MediaStreamTrack interface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.
In WebRTC, "insertable streams" refers to the ability to manipulate raw audio or video content and introduce new components to streams. Some use cases for insertable streams include: "Funny hats" or other video conferencing gadgets.
The MediaStream interface represents a stream of media content. A stream consists of several tracks, such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack . You can obtain a MediaStream object either by using the constructor or by calling functions such as MediaDevices.
Streaming media is video or audio content sent in compressed form over the internet and played immediately over a user's device, rather than being saved to the device hard drive or solid-state drive.
The RTCDataChannel is exactly what you need. See: https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
From the page above: "The RTCDataChannel interface represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data."
In one of the recent meetings the subject was on the table, and it may be possible in the future. This can be used to allow the application to use more than one device of the same type.
We will be able to create the object of the streams tracks, but the Media Stream is always provided by the browser. Either it is a local Media Stream and you get it from the getUserMedia() method, or it's a remote Media Stream and you receive it from the peer connection.
The MediaStreamTrack is an object created by the browser API and the media in it (local or remote) is always provided by the browser, using microphones/cameras or media from the PeerConnection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With