From a856db26a69f91dd1026240a95d72fe5b15db143 Mon Sep 17 00:00:00 2001 From: "vikasmarwaha@webrtc.org" Date: Tue, 5 Mar 2013 03:35:26 +0000 Subject: [PATCH] Moved trace function to adapter.js and removed from pc1 & multiple.html. Review URL: https://webrtc-codereview.appspot.com/1156005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3608 4adac7df-926f-26a2-2b94-8c16560cd09d --- samples/js/base/adapter.js | 8 ++++++++ samples/js/demos/html/multiple.html | 8 -------- samples/js/demos/html/pc1.html | 7 ------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/samples/js/base/adapter.js b/samples/js/base/adapter.js index 5441a6c892..4294f34d88 100644 --- a/samples/js/base/adapter.js +++ b/samples/js/base/adapter.js @@ -4,6 +4,14 @@ var attachMediaStream = null; var reattachMediaStream = null; var webrtcDetectedBrowser = null; +function trace(text) { + // This function is used for logging. + if (text[text.length - 1] == '\n') { + text = text.substring(0, text.length - 1); + } + console.log((performance.now() / 1000).toFixed(3) + ": " + text); +} + if (navigator.mozGetUserMedia) { console.log("This appears to be Firefox"); diff --git a/samples/js/demos/html/multiple.html b/samples/js/demos/html/multiple.html index 81d768e7d0..e5b8a0bec3 100644 --- a/samples/js/demos/html/multiple.html +++ b/samples/js/demos/html/multiple.html @@ -44,14 +44,6 @@ var sdpConstraints = {'mandatory': { 'OfferToReceiveAudio':true, 'OfferToReceiveVideo':true }}; -function trace(text) { - // This function is used for logging. - if (text[text.length - 1] == '\n') { - text = text.substring(0, text.length - 1); - } - console.log((performance.now() / 1000).toFixed(3) + ": " + text); -} - function gotStream(stream){ trace("Received local stream"); // Call the polyfill wrapper to attach the media stream to this element. diff --git a/samples/js/demos/html/pc1.html b/samples/js/demos/html/pc1.html index 0a3e81e3a9..61dc6a997b 100644 --- a/samples/js/demos/html/pc1.html +++ b/samples/js/demos/html/pc1.html @@ -43,13 +43,6 @@ var localstream; var sdpConstraints = {'mandatory': { 'OfferToReceiveAudio':true, 'OfferToReceiveVideo':true }}; -function trace(text) { - // This function is used for logging. - if (text[text.length - 1] == '\n') { - text = text.substring(0, text.length - 1); - } - console.log((performance.now() / 1000).toFixed(3) + ": " + text); -} function gotStream(stream){ trace("Received local stream");