Updates for web test page.

- Only showing text about browser needing WebRTC support if support not detected. Text is now contains more information and link to blog post.
- Removed the debug buttons.
- Clarifications and corrections in the readme file.
Review URL: https://webrtc-codereview.appspot.com/352015

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1491 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrikg@webrtc.org
2012-01-20 07:53:26 +00:00
parent 56ee5d5d98
commit 16a04273bb
2 changed files with 31 additions and 33 deletions

View File

@ -1,7 +1,10 @@
This test client is a simple functional test for WebRTC enabled Chrome build.
This test client is a simple functional test for a WebRTC enabled browser. It
has only been tested with Chrome, and is most likely only working with Chrome at
the moment. The following instructions are in part Chrome specific.
The following is necessary to run the test:
- A WebRTC Chrome binary.
- A WebRTC enabled Chrome binary. (Available in dev or canary channel, 18.0.1008
or newer.)
- A peerconnection_server binary (make peerconnection_server).
It can be used in two scenarios:
@ -12,11 +15,9 @@ client.
To start the test for scenario (1):
1. Start peerconnection_server.
2. Start the WebRTC Chrome build: $ <path_to_chome_binary>/chrome
--enable-media-stream --enable-p2papi --user-data-dir=<path_to_data>
<path_to_data> is where Chrome looks for all its states, use for example
"temp/chrome_webrtc_data". If you don't always start the browser from the same
directory, use an absolute path instead.
2. Start the WebRTC Chrome build:
$ <path_to_chrome_binary>/chrome --enable-media-stream
The --enable-media-stream flag is required for the time being.
3. Open the server test page, ensure loopback is enabled, choose a name (for
example "loopback") and connect to the server.
4. Open the test page, connect to the server, select the loopback peer, click

View File

@ -52,13 +52,6 @@ function setElementValuesFromURL() {
});
}
function toggleExtraButtons() {
document.getElementById("createPcBtn").hidden =
!document.getElementById("createPcBtn").hidden;
document.getElementById("test1Btn").hidden =
!document.getElementById("test1Btn").hidden;
}
function trace(txt) {
var elem = document.getElementById("debug");
elem.innerHTML += txt + "<br>";
@ -130,15 +123,14 @@ function peerExists(id) {
}
function addPeer(id, pname) {
try {
var peerList = document.getElementById("peers");
var option = document.createElement("option");
option.text = pname;
option.value = id;
try {
// For IE earlier than version 8
peerList.add(option, x.options[null]);
} catch (e) {
peerList.add(option, null);
} catch (e) {
trace_exception(e, "Error adding peer");
}
}
@ -523,21 +515,32 @@ function disconnect() {
// Window event handling
window.onload = function() {
if (navigator.webkitGetUserMedia) {
document.getElementById('testApp').hidden = false;
setElementValuesFromURL();
getUserMedia();
} else {
document.getElementById('errorText').hidden = false;
}
}
window.onbeforeunload = disconnect;
</script>
</head>
<body>
<h1>WebRTC</h1>
You must have a WebRTC capable browser in order to make calls using this test
page.<br>&nbsp;
<section id="errorText" hidden="true">
Could not detect WebRTC support.<p>
You must have WebRTC enabled Chrome browser to use this test page. The browser
must be started with the --enable-media-stream command line flag. For more
information, please see
<a href="https://sites.google.com/site/webrtc/blog/webrtcnowavailableinthechromedevchannel">
this blog post</a>.
</section>
<section id="testApp" hidden="true">
<table border="0">
<tr>
<td>Local Preview</td>
@ -585,19 +588,13 @@ page.<br>&nbsp;
<button id="call" onclick="doCall();" disabled="true">Call</button><br>
<button id="hangup" onclick="hangUp();" disabled="true">Hang up</button><br>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<button onclick="toggleExtraButtons();">Toggle extra buttons (debug)</button>
<br>
<button id="createPcBtn" onclick="createPeerConnection();" hidden="true">
Create peer connection</button>
</td>
</tr>
</table>
<button onclick="document.getElementById('debug').innerHTML='';">Clear log
</button>
<pre id="debug"></pre>
</section>
</body>