10
votes

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?

1
I am still waiting for this question. Still not get the solution yet.Xin

1 Answers

5
votes

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.