Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Weblio英会話と
動作チェックツール「WebRTCくん」

taminif
June 13, 2017

 Weblio英会話と
動作チェックツール「WebRTCくん」

WebRTC Meetup #15で登壇した資料です

taminif

June 13, 2017
Tweet

More Decks by taminif

Other Decks in Programming

Transcript

  1. 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ΦϒδΣΫτ Λੜ੒ ͔Β΁ίʔϧ
  2. ʮΧϝϥΛ࢖Θͳ͍ʯΛ ࣮ݱ͢Δίʔυ constraints.audio = { deviceId: audioId, }; if (videoId

    !== "") { constraints.video = { deviceId: videoId, }; } ͭ·ΓΧϝϥσόΠεͷ ஋͕ͳ͚Ε͹ηοτ͠ͳ͍ <select name="videoId"> <option value=“Q3M…”> Corel ScreenCap </option> <option value=""> (disable camera) </option> </select> Χϝϥ෦෼ͷ ηϨΫτϘοΫεͷ஋ ϚΠΫ͸ඞਢͳͷͰ ඞͣηοτ