Slide 37
Slide 37 text
WebRTC͘Μ
const constraints = getConstraints();
getUserMedia(constraints)
.then((myStream) => {
console.log("created stream");
if (streamUrl !== null) {
URL.revokeObjectURL(streamUrl);
streamUrl = null;
}
// ૹΓଆ
peer1 = new Peer(SKYWAY_OPTIONS);
// ड͚ଆ
peer2 = new Peer(SKYWAY_OPTIONS);
peer2
.on("open", (id) => {
console.log("sending stream...");
call = peer1.call(id, myStream);
})
.on("call", (call) => {
call.answer();
call
.on("stream", (peerStream) => {
console.log("received stream");
streamUrl = URL.createObjectURL(peerStream);
$("#video").attr("src", streamUrl);
});
});
})
தུʢॳظԽॲཧͱ͔ʣ
ೋͭͷ1FFSΦϒδΣΫτ
Λੜ
͔Βίʔϧ