diff --git a/samples/js/base/adapter.js b/samples/js/base/adapter.js index 9cf875bef1..6d6e039b73 100644 --- a/samples/js/base/adapter.js +++ b/samples/js/base/adapter.js @@ -33,6 +33,7 @@ if (navigator.mozGetUserMedia) { // Get UserMedia (only difference is the prefix). // Code from Adam Barth. getUserMedia = navigator.mozGetUserMedia.bind(navigator); + navigator.getUserMedia = getUserMedia; // Creates iceServer from the url for FF. createIceServer = function(url, username, password) { @@ -118,6 +119,7 @@ if (navigator.mozGetUserMedia) { // Get UserMedia (only difference is the prefix). // Code from Adam Barth. getUserMedia = navigator.webkitGetUserMedia.bind(navigator); + navigator.getUserMedia = getUserMedia; // Attach a media stream to an element. attachMediaStream = function(element, stream) { diff --git a/samples/js/demos/html/constraints-and-stats.html b/samples/js/demos/html/constraints-and-stats.html index 6134a3a3ea..f74bda943c 100644 --- a/samples/js/demos/html/constraints-and-stats.html +++ b/samples/js/demos/html/constraints-and-stats.html @@ -27,15 +27,15 @@ function openCamera() { if (mystream) { mystream.stop(); } - navigator.webkitGetUserMedia(cameraConstraints(), gotStream, function() { + navigator.getUserMedia(cameraConstraints(), gotStream, function() { log("GetUserMedia failed"); }); -} +} function gotStream(stream) { log("GetUserMedia succeeded"); mystream = stream; - $("local-video").src = webkitURL.createObjectURL(stream); + attachMediaStream($("local-video"), stream); } function cameraConstraints() { @@ -73,8 +73,8 @@ function streamConstraints() { } function connect() { - pc1 = new webkitRTCPeerConnection(null); - pc2 = new webkitRTCPeerConnection(null); + pc1 = new RTCPeerConnection(null); + pc2 = new RTCPeerConnection(null); pc1.addStream(mystream, streamConstraints()); log('PC1 creating offer'); pc1.onnegotiationeeded = function() { @@ -97,7 +97,7 @@ function connect() { } pc2.onaddstream = function(e) { log('PC2 got stream'); - $('remote-video').src = webkitURL.createObjectURL(e.stream); + attachMediaStream($('remote-video'), e.stream); log('Remote video is ' + $('remote-video').src); } pc1.createOffer(function(desc) { @@ -280,7 +280,7 @@ function dumpStats(obj) { } return statsString; } - + // Utility to show the value of a field in a span called name+Display function showValue(name, value) { diff --git a/samples/js/demos/html/create-offer.html b/samples/js/demos/html/create-offer.html new file mode 100644 index 0000000000..aa541bfa14 --- /dev/null +++ b/samples/js/demos/html/create-offer.html @@ -0,0 +1,85 @@ + + +
+ +This page tests the createOffer method for a WebRTC implementation. It + creates a PeerConnection, and then prints out the SDP generated by + createOffer, with the number of desired audio MediaStreamTracks and the + checked createOffer constraints. Currently, only audio tracks can be added, + as there is no programmatic way to generate video tracks. (Web Audio is + used to generate the audio tracks.)
+Number of Audio Tracks
+
This page tests the trickle ICE functionality in a WebRTC implementation. It + creates a PeerConnection with the specified ICEServers, and then starts + candidate gathering for a session with a single audio stream. As candidates + are gathered, they are displayed in the text box below, along with an + indication when candidate gathering is complete.
+Individual STUN and TURN servers can be added using the Add Server/Remove + Server controls below; in addition, the type of candidates released to the + application can be controlled via the IceTransports contraint.
+