From 90eb5c84f97ac183c529e3972aae98f109273f8c Mon Sep 17 00:00:00 2001 From: "elham@webrtc.org" Date: Tue, 5 Mar 2013 19:53:01 +0000 Subject: [PATCH] 1. Updated test pages to include Chrome Frame meta tag 2. Updated test pages to use adapter.js Review URL: https://webrtc-codereview.appspot.com/1142004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3614 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/test/manual/adapter.js | 51 +++++++++++++++++++++++ webrtc/test/manual/audio-and-video.html | 17 ++++---- webrtc/test/manual/iframe-apprtc.html | 1 + webrtc/test/manual/iframe-video.html | 1 + webrtc/test/manual/multiple-audio.html | 16 ++++--- webrtc/test/manual/multiple-video.html | 16 ++++--- webrtc/test/manual/single-audio.html | 15 ++++--- webrtc/test/manual/single-video.html | 15 ++++--- webrtc/test/manual/two-video-devices.html | 19 +++++---- 9 files changed, 113 insertions(+), 38 deletions(-) create mode 100644 webrtc/test/manual/adapter.js diff --git a/webrtc/test/manual/adapter.js b/webrtc/test/manual/adapter.js new file mode 100644 index 0000000000..b03d758b2f --- /dev/null +++ b/webrtc/test/manual/adapter.js @@ -0,0 +1,51 @@ +var RTCPeerConnection = null; +var getUserMedia = null; +var attachMediaStream = null; + +if (navigator.mozGetUserMedia) { + console.log("This appears to be Firefox"); + + // The RTCPeerConnection object. + RTCPeerConnection = mozRTCPeerConnection; + + // Get UserMedia (only difference is the prefix). + // Code from Adam Barth. + getUserMedia = navigator.mozGetUserMedia.bind(navigator); + + // Attach a media stream to an element. + attachMediaStream = function(element, stream) { + console.log("Attaching media stream"); + element.mozSrcObject = stream; + element.play(); + }; +} else if (navigator.webkitGetUserMedia) { + console.log("This appears to be Chrome"); + + // The RTCPeerConnection object. + RTCPeerConnection = webkitRTCPeerConnection; + + // Get UserMedia (only difference is the prefix). + // Code from Adam Barth. + getUserMedia = navigator.webkitGetUserMedia.bind(navigator); + + // Attach a media stream to an element. + attachMediaStream = function(element, stream) { + element.src = webkitURL.createObjectURL(stream); + }; + + // The representation of tracks in a stream is changed in M26. + // Unify them for earlier Chrome versions in the coexisting period. + if (!webkitMediaStream.prototype.getVideoTracks) { + webkitMediaStream.prototype.getVideoTracks = function() { + return this.videoTracks; + } + } + + if (!webkitMediaStream.prototype.getAudioTracks) { + webkitMediaStream.prototype.getAudioTracks = function() { + return this.audioTracks; + } + } +} else { + console.log("Browser does not appear to be WebRTC-capable"); +} diff --git a/webrtc/test/manual/audio-and-video.html b/webrtc/test/manual/audio-and-video.html index 1e54424d47..c4e1d84c92 100644 --- a/webrtc/test/manual/audio-and-video.html +++ b/webrtc/test/manual/audio-and-video.html @@ -11,11 +11,15 @@ Single Local Preview (Video and Audio) + + + @@ -41,4 +44,4 @@ - \ No newline at end of file + diff --git a/webrtc/test/manual/iframe-apprtc.html b/webrtc/test/manual/iframe-apprtc.html index f2f0f0cb97..31e0db10c0 100644 --- a/webrtc/test/manual/iframe-apprtc.html +++ b/webrtc/test/manual/iframe-apprtc.html @@ -11,6 +11,7 @@ AppRTC web app in an IFRAME + AppRTC in an <iframe> element:
diff --git a/webrtc/test/manual/iframe-video.html b/webrtc/test/manual/iframe-video.html index dffdbef302..3cb532b091 100644 --- a/webrtc/test/manual/iframe-video.html +++ b/webrtc/test/manual/iframe-video.html @@ -11,6 +11,7 @@ IFRAME Single Local Preview (Video Only) + diff --git a/webrtc/test/manual/multiple-audio.html b/webrtc/test/manual/multiple-audio.html index 1575c7d0b0..80e4b646c6 100644 --- a/webrtc/test/manual/multiple-audio.html +++ b/webrtc/test/manual/multiple-audio.html @@ -11,11 +11,15 @@ Multiple Local Preview (Audio Only) + + + @@ -49,4 +53,4 @@ - \ No newline at end of file + diff --git a/webrtc/test/manual/multiple-video.html b/webrtc/test/manual/multiple-video.html index 1ba46c19f8..fd82bf82cf 100644 --- a/webrtc/test/manual/multiple-video.html +++ b/webrtc/test/manual/multiple-video.html @@ -11,11 +11,15 @@ Multiple Local Preview (Video Only) + + + @@ -65,4 +69,4 @@ - \ No newline at end of file + diff --git a/webrtc/test/manual/single-audio.html b/webrtc/test/manual/single-audio.html index e003a62ea2..b5d1ed464a 100644 --- a/webrtc/test/manual/single-audio.html +++ b/webrtc/test/manual/single-audio.html @@ -11,11 +11,14 @@ Single Local Preview (Audio Only) + + + @@ -38,4 +41,4 @@ - \ No newline at end of file + diff --git a/webrtc/test/manual/single-video.html b/webrtc/test/manual/single-video.html index 6b3283c3b2..7a88dcf97d 100644 --- a/webrtc/test/manual/single-video.html +++ b/webrtc/test/manual/single-video.html @@ -11,11 +11,14 @@ Single Local Preview (Video Only) + + + @@ -39,4 +42,4 @@ - \ No newline at end of file + diff --git a/webrtc/test/manual/two-video-devices.html b/webrtc/test/manual/two-video-devices.html index bdd197c6b4..44c0947bdc 100644 --- a/webrtc/test/manual/two-video-devices.html +++ b/webrtc/test/manual/two-video-devices.html @@ -11,13 +11,17 @@ Single Local Preview (Video Only) + + +