- A peerconnection_server binary (make peerconnection_server). |
I can't see peerconnection_server referenced anywhere but will keep reading. More pointers on this would be great. |
That's some (perhaps unfortunate) static text. It doesn't mean your
browser isn't WebRTC capable.
Cheers,
Andreas
On 18.01.2012 18:50, Serge Lachapelle wrote:
> Hi all,
>
> WebRTC is now available in Chrome, as part of the dev channel, with a
> command line switch.
>
> Chromium blog
> post: http://blog.chromium.org/2012/01/real-time-communications-in-chrome.html
>
> WebRTC.org blog post with
> details: http://www.webrtc.org/blog/webrtcnowavailableinthechromedevchannel
>
>
> Oh.... and we have a shiny new Google+ page
> <https://plus.google.com/u/0/b/113817074606039822053/113817074606039822053/posts>!
<article> <style scoped> video { transform: scaleX(-1); } p { text-align: center; } </style> <h1>Snapshot Kiosk</h1> <section id="splash"> <p id="errorMessage">Loading...</p> </section> <section id="app" hidden> <p><video id="monitor" autoplay></video> <canvas id="photo"></canvas> <p><input type=button value="📷" onclick="snapshot()"> </section> <script> navigator.getUserMedia({video:true}, gotStream, noStream); var video = document.getElementById('monitor'); var canvas = document.getElementById('photo'); function gotStream(stream) { video.src = URL.createObjectURL(stream); video.onerror = function () { stream.stop(); }; stream.onended = noStream; video.onloadedmetadata = function () { canvas.width = video.videoWidth; canvas.height = video.videoHeight; document.getElementById('splash').hidden = true; document.getElementById('app').hidden = false; }; } function noStream() { document.getElementById('errorMessage').textContent = 'No camera available.'; } function snapshot() { canvas.getContext('2d').drawImage(video, 0, 0); } </script> </article>
Google Chrome | 18.0.1011.1 (Official Build 118106) canary |
OS | Mac OS X |
WebKit | 535.18 (@105195) |
JavaScript | V8 3.8.6 |
Flash | 11.2.202.160 |
User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.18 (KHTML, like Gecko) Chrome/18.0.1011.1 Safari/535.18 |
Command Line | /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary --enable-media-stream --enable-p2papi --flag-switches-begin --js-flags=--harmony --enable-media-source --flag-switches-end |
<body onload="initialize()" onunload="uninitialize()">
<input type="button" value="Connect" onclick="connect()" id="connectBtn">
<div>
<textarea id="status" style="width:600pt;height:200pt"></textarea>
</div>
<table>
<tr>
<td>Local</td>
<td>Remote</td>
</tr>
<tr>
<td>
<video id="localVideo1" width="267" height="200" autoPlay></video>
</td>
<td>
<video id="remoteVideo1" width="267" height="200" autoPlay></video>
</td>
</tr>
<tr>
<td>
<video id="localVideo2" width="267" height="200" autoPlay></video>
</td>
<td>
<video id="remoteVideo2" width="267" height="200" autoPlay></video>
</td>
</tr>
</table>
<script>
var pc1, pc2;
var localstream1, localstream2;
function initialize()
{
pc1 = new webkitPeerConnection('STUN stun.l.google.com:19302', signalingCallback1);
pc2 = new webkitPeerConnection('STUN stun.l.google.com:19302', signalingCallback2);
report('PeerConnections created ' + pc1 +":"+ pc2);
navigator.webkitGetUserMedia('video audio', gotStream2, noStream);
navigator.webkitGetUserMedia('video audio', gotStream1, noStream);
pc1.onended = function () {
report('stream.onended... ');
stopSteam();
}
pc1.onaddstream = function(event) {
report('pc1.onaddstream:'+event+'');
var stream = event.stream;
var url = webkitURL.createObjectURL(stream);
remoteVideo1.src = url;
report('pc1.remote Video url:'+url+'');
}
pc2.onaddstream = function(event) {
report('pc2.onaddstream:'+event+'');
var stream = event.stream;
var url = webkitURL.createObjectURL(stream);
remoteVideo2.src = url;
report('pc2.remote Video url set()'+url+'');
}
}
function report(s) {
document.getElementById('status').textContent = (s + '\r\n' + document.getElementById('status').textContent);
}
function gotStream1(stream) {
localstream1 = stream;
var url = webkitURL.createObjectURL(stream);
localVideo1.src = url;
report("gotStream1 "+url);
}
function gotStream2(stream) {
localstream2 = stream;
var url = webkitURL.createObjectURL(stream);
localVideo2.src = url;
report("gotStream2 "+url);
}
function noStream() {
report('Could not obtain access to your microphone.');
}
function signalingCallback1(msg, source) {
try
{
//report("signalingCallbackLocal("+msg+");");
report("signalingCallback1();");
pc1.processSignalingMessage(msg);
//pc2.processSignalingMessage(msg);
report("signalingCallback1 success");
}
catch (e)
{
alert("exception on signalingCallback "+e);
}
}
function signalingCallback2(msg, source) {
try
{
//report("signalingCallbackRemote("+msg+");");
report("signalingCallback2();");
//pc1.processSignalingMessage(msg);
pc2.processSignalingMessage(msg);
report("signalingCallback2 success");
}
catch (e)
{
alert("exception on signalingCallback "+e);
}
}
function connect() {
pc1.addStream(localstream1);
pc2.addStream(localstream2);
}
</script>
</body>
</html>
I made loopback webrtc sample.The page has two local video and one remote video (I tried to make two but I couldn''t).Two use streams made by calling 'webkitGetUserMedia'.And one use stream made by calling 'processSignalingMessage'.Actually I tried to send local video using pc1(PeerConnection1) and receive it using pc2.But it dose not work. I found that only one peerconnection(pc1)'s 'processSignalingMessage' function works properly.(Maybe first created peerconnection)I want to use several peerconnections in one page to show serveral peer's video.Does anybody know how I can do it?
Followings are also a bit strange things for me.- SignalingCallback was called several times after addStream function called.
- When peerconnection created with 'audio' option, it does not work.
Is it possible to activate the log mechanism of WebRTC from Chrome
command line?
Thanks for your help,
Christian
Excellent!
I note three issues and hope you fine GentlePeople can assist -
1) Do you know why certain transforms kill the stream? Specifically, I want to mirror the image in the X-axis and tried
-webkit-transform: scaleX(-1);
to which it properly mirrors the first frame and then stops (freezes) with no discernable error that I can find. Similar results with matrix transforms, although resizing seems to work just fine.
2) Do you know WHY the button click in your example only works once?
3) Do you know WHY the web page must be hosted on a server (i.e. not a local file)? One comment said it might be security, but that seems backwards and makes no sense to me. Especially since you have to (currently) explicitly start Chrome with --enable-media-stream. What could the security issue possibly be?
Rob--
.:t.
Paul.