How to direct audio/vido streams from HTML5 media element to PeerConnection?

I wonder if it is possible to send the audio/video streams from a HTML5 <audio>/<video> element to a RTCPeerConnection object [1], such that when played, the stream is display locally and sent to the remote peer.

The easiest way to do this is to drop the HTML5 audioTrack and videoTrack objects [2] obtained from the HTML5 element into the constructor of MediaStream [3].
But this doesn't seem possible as the HTML5 audioTrack and videoTrack interfaces are unrelated to the MediaStreamTrack interface accepted by the constructor.

Thanks.
Li

[1] http://www.w3.org/TR/webrtc/#peer-to-peer-connections
[2] http://www.w3.org/TR/html5/embedded-content-0.html#htmlmediaelement
[3] http://www.w3.org/TR/mediacapture-streams/#mediastreamtrack

Received on Wednesday, 30 January 2013 21:29:27 UTC