ํตํ ์ค์ ๋ค๋ฅธ ํผ์ด์์ ์ฐ๊ฒฐ์ ๋ซ์ง ์๊ณ ์นด๋ฉ๋ผ ์คํธ๋ฆผ์ ์ ํํ๊ณ ์ถ์ต๋๋ค. ์ด๊ฒ ๊ฐ๋ฅํด?
ํ์ฌ ๋ค์๊ณผ ๊ฐ์ ์์ ์ ์ํํ๊ณ ์์ต๋๋ค.
navigator.webkitGetUserMedia({video: true, audio: true}, (stream) => {
peer.call(key, stream);
});
๋ถ๊ฐ๋ฅํฉ๋๋ค.
๊ฒ์ด ๊ฐ๋ฅํ๋ค. skyway ์์ ๋๋ ๋ค์ ์์ ๋ฅผ ์ดํด๋ณด์ญ์์ค.
https://github.com/muaz-khan/WebRTC-Experiment/blob/master/demos/switch-streams.html
์ ๋ง๋ก??? ๊ทธ๊ฑด ๋ถ๊ฐ๋ฅํ๋ค?
์๋ ํ์ธ์, ํตํ ์ค์ ์นด๋ฉ๋ผ๋ฅผ ์ ํํ ์ ์๋ ์ฌ๋์ด ์์ต๋๊น? ๋์์ฃผ์ธ์?
WebRTC๊ฐ ์๋ํ๋ ๋ฐฉ์ ๋๋ฌธ์ ์๋ก์ด ์ฐ๊ฒฐ์ ์ค์ ํด์ผ ํฉ๋๋ค.
RTCRtpSender์ replaceTrack์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
this.call.peerConnection.getSenders()[0].replaceTrack()
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ถ๊ฐ๋ฅํฉ๋๋ค.