I have been going over the WebRTC docs and I see two WebRTC methods where I am not sure I understand what the difference is: reattachMediaStream
and attachMediaSource
.
attachMediaSource
This I get, you use it to attach a MediaStream
to something like a video
element.
HTML:
<video id="videoPlayer">
JS:
attachMediaSource(videoPlayer, mediaSource);
But when is reattachMediaStream
used?
Looking at the adapter.js code the WebRTC group provides, doesn't help much.
For Gecko it has:
reattachMediaStream = function(to, from) {
console.log("Reattaching media stream");
to.mozSrcObject = from.mozSrcObject;
to.play();
};
For webkit it has:
reattachMediaStream = function(to, from) {
to.src = from.src;
}
Looking at all the various examples out there also hasn't helped. I don't see anything using reattachMediaStream.
Is it attaching the video from one video element to another?