Commit bcdf9a3b authored by jansson's avatar jansson Committed by Commit bot

Replace peerconnection.html with a redirect to github.

Removed all other manual test files in the ../webrtc/manual folder. They
too have moved to GitHub but are not used that often hence no redirect
pages are necessary.

The ../webrtc/manual folder now resides here:
https://github.com/GoogleChrome/webrtc/tree/master/samples/web/content/manual-test

BUG=NONE
NOTRY=TRUE

Review URL: https://codereview.chromium.org/609733002

Cr-Commit-Position: refs/heads/master@{#297156}
parent 52c839c2
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>WebRTC GetUserMedia Constraints Manual Test</title>
<!-- Load the polyfill to switch-hit between Chrome and Firefox -->
<script type="text/javascript" src="../adapter.js"></script>
<script type="text/javascript" src="constraints.js"></script>
<link rel="StyleSheet" type="text/css" href="stylesheet.css">
<meta charset="utf-8">
</head>
<body>
<div id="wrapper">
<div id="left">
<p>This page can create GetUserMedia <a href="http://goo.gl/qZQjV">
MediaStreamConstraints</a> that can be used on the<br/>
<a href="peerconnection.html">PeerConnection Manual Test page.</a></p>
MediaStreamConstraints:<br/>
<textarea id="getusermedia-constraints" rows="10" cols="60"
readonly="readonly"/></textarea>
<br/>
Audio<input type="checkbox" id="audio" checked />
Video<input type="checkbox" id="video" checked />
<h2>Video constraints</h2>
Only applicable if the video checkbox is checked above.
<h3>Mandatory</h3>
Min
<input type="text" id="mandatory-min-width" size="4"/>x
<input type="text" id="mandatory-min-height" size="4"/>
FPS: <input type="text" id="mandatory-min-fps" size="2"/>
Aspect ratio: <input type="text" id="mandatory-min-ar" size="2"/><br/>
Max
<input type="text" id="mandatory-max-width" size="4"/>x
<input type="text" id="mandatory-max-height" size="4"/>
FPS: <input type="text" id="mandatory-max-fps" size="2"/>
Aspect ratio: <input type="text" id="mandatory-max-ar" size="2"/>
<h3>Optional</h3>
Min
<input type="text" id="optional-min-width" size="4"/>x
<input type="text" id="optional-min-height" size="4"/>
FPS: <input type="text" id="optional-min-fps" size="2"/>
Aspect ratio: <input type="text" id="optional-min-ar" size="2"/><br/>
Max
<input type="text" id="optional-max-width" size="4"/>x
<input type="text" id="optional-max-height" size="4"/>
FPS: <input type="text" id="optional-max-fps" size="2"/>
Aspect ratio: <input type="text" id="optional-max-ar" size="2"/><br/>
<button id="re-request" onclick="doGetUserMedia();">
Request GetUserMedia
</button>
<h2>Messages</h2>
<pre id="messages"></pre>
</div>
<div>
<h2>Local Preview</h2>
<video width="320" height="240" id="local-view" autoplay="autoplay">
</video>
</div>
</div>
</body>
</html>
/**
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more
* information on getUserMedia.
*/
/**
* Asks permission to use the webcam and mic from the browser.
*/
function doGetUserMedia() {
// Call into getUserMedia via the polyfill (adapter.js).
var constraints = getConstraints_();
var constraintsString = JSON.stringify(constraints, null, ' ');
$('getusermedia-constraints').innerHTML = constraintsString;
if (!getUserMedia) {
log_('Browser does not support WebRTC.');
return;
}
log_('Requesting getUserMedia with constraints: ' + constraintsString);
getUserMedia(constraints, getUserMediaOkCallback_,
getUserMediaFailedCallback_);
}
// Internals
/**
* Builds a Javascript constraints dictionary out of the selected options in the
* HTML controls on the page.
* @private
* @return {Object} A dictionary of constraints.
*/
function getConstraints_() {
var c = {};
c.audio = $('audio').checked;
if (!$('video').checked) {
c.video = false;
} else {
c.video = { mandatory: {}, optional: [] };
// Mandatory - min
if ($('mandatory-min-width').value != '') {
c.video.mandatory.minWidth = $('mandatory-min-width').value;
}
if ($('mandatory-min-height').value != '') {
c.video.mandatory.minHeight = $('mandatory-min-height').value;
}
if ($('mandatory-min-fps').value != '') {
c.video.mandatory.minFrameRate = $('mandatory-min-fps').value;
}
if ($('mandatory-min-ar').value != '') {
c.video.mandatory.minAspectRatio = $('mandatory-min-ar').value;
}
// Mandatory - max
if ($('mandatory-max-width').value != '') {
c.video.mandatory.maxWidth = $('mandatory-max-width').value;
}
if ($('mandatory-max-height').value != '') {
c.video.mandatory.maxHeight = $('mandatory-max-height').value;
}
if ($('mandatory-max-fps').value != '') {
c.video.mandatory.maxFrameRate = $('mandatory-max-fps').value;
}
if ($('mandatory-max-ar').value != '') {
c.video.mandatory.maxAspectRatio = $('mandatory-max-ar').value;
}
// Optional - min
if ($('optional-min-width').value != '') {
c.video.optional.push({ minWidth: $('optional-min-width').value });
}
if ($('optional-min-height').value != '') {
c.video.optional.push({ minHeight: $('optional-min-height').value });
}
if ($('optional-min-fps').value != '') {
c.video.optional.push({ minFrameRate: $('optional-min-fps').value });
}
if ($('optional-min-ar').value != '') {
c.video.optional.push({ minAspectRatio: $('optional-min-ar').value });
}
// Optional - max
if ($('optional-max-width').value != '') {
c.video.optional.push({ maxWidth: $('optional-max-width').value });
}
if ($('optional-max-height').value != '') {
c.video.optional.push({ maxHeight: $('optional-max-height').value });
}
if ($('optional-max-fps').value != '') {
c.video.optional.push({ maxFrameRate: $('optional-max-fps').value });
}
if ($('optional-max-ar').value != '') {
c.video.optional.push({ maxAspectRatio: $('optional-max-ar').value });
}
}
return c;
}
/**
* @private
* @param {MediaStream} stream Media stream.
*/
function getUserMediaOkCallback_(stream) {
gLocalStream = stream;
var videoTag = $('local-view');
attachMediaStream(videoTag, stream);
// Due to crbug.com/110938 the size is 0 when onloadedmetadata fires.
// videoTag.onloadedmetadata = updateVideoTagSize_(videoTag);
// Use setTimeout as a workaround for now.
setTimeout(function() {updateVideoTagSize_(videoTag)}, 500);
gRequestWebcamAndMicrophoneResult = 'ok-got-stream';
}
/**
* @private
* @param {Object} videoTag The video tag to update.
*/
function updateVideoTagSize_(videoTag) {
// Don't update if sizes are 0 (happens for Chrome M23).
if (videoTag.videoWidth > 0 && videoTag.videoHeight > 0) {
log_('Set video tag width and height: ' + videoTag.videoWidth + 'x' +
videoTag.videoHeight);
videoTag.width = videoTag.videoWidth;
videoTag.height = videoTag.videoHeight;
}
}
/**
* @private
* @param {NavigatorUserMediaError} error Error containing details.
*/
function getUserMediaFailedCallback_(error) {
log_('Failed with error: ' + error);
}
$ = function(id) {
return document.getElementById(id);
};
/**
* Simple logging function.
* @private
* @param {string} message Message to print.
*/
function log_(message) {
console.log(message);
$('messages').innerHTML += message + '<br>';
}
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>WebRTC PeerConnection Manual Test Help Page</title>
<link rel="StyleSheet" type="text/css" href="stylesheet.css">
<meta charset="utf-8">
</head>
<body>
<h1>WebRTC PeerConnection Manual Test Help Page</h1>
<p>
The test page is intended for testing WebRTC calls.
This is how you set up a normal call:
</p>
<ol>
<li>Open this page in two tabs.</li>
<li>Start the peerconnection server. Click on the question mark next
to the 'server' field for instruction on how to do that. The easiest
thing is to start it on localhost, but you can start it on any
machine you like and connect to hostname:8888.</li>
<li>Click the Connect button in both tabs.</li>
<li>Click the Call:Negotiate button in one of the tabs. You should see a bunch
of printouts when this happens. Note that no streams are sent to
begin with (although you could run steps 5-6 before this step to get streams
even in the initial call).</li>
<li>Grant media access using the checkboxes and Request button.</li>
<li>Add the local stream by clicking the "Add" button, in both tabs.</li>
<li>Now you must re-negotiate the call by clicking on Negotiate again.</li>
<li>You should now have a call up and both sides should be receiving
media data (depending on what access you granted on the respective
pages).</li>
<li>You can now choose to stop, re-request, re-send or disable streams
in any way you like, or hang up and re-start the call. You don't
need to disconnect: that's done automatically when you close the
page. Hanging up is NOT done automatically though.</li>
</ol>
<p>
To create a data channel:
</p>
<ol>
<li>Make sure Chrome is started with the --enable-data-channels flag.</li>
<li>Follow the instructions above to connect two tabs to a
peerconnection_server.</li>
<li>Click the Data channel: Create button in one tab. Notice the status
changes to "connecting".</li>
<li>Click the Call:Negotiate button. You should see the status change to
"open" in both tabs. </li>
<li>Enter text in the textbox next to the Send data button and then click Send
data. Notice the text is received in the remote tab in the Received on data
channel text box. Data can be sent in both direct.</li>
<li>To close the channel press the Close button followed by Negotiate. Notice
the status change to "closed"</li>
</ol>
<p>Detailed descriptions:</p>
<ul>
<li>Connect - once a connection is established, you generally won't
need to click this button again. Connecting really isn't something
related to WebRTC as such, it's just the signalling solution.</li>
<li>Note that if more than two users/machines have established a
connection to the same PC server, you will get an error when
pressing this button. The test is hard-coded to only allow 2 peers
on the server at the same time.</li>
<li>Pressing the Add button for local streams will in effect add
the current local stream, such as it is, to the current
peerconnection.</li>
<li>If you request user media again, it will overwrite the current
local stream with the new one. This means that pressing Add will
add the stream you just got from the request. The code will not
attempt to stop or remove the previous stream from the
peerconnection, so depending on peerconnection's semantics the old
stream will remain with the peerconnection (perhaps the streams will
be sent simultaneously?)</li>
<li>Hang Up will clear away peer connections on both sides, and a new
call can be started if desired. The peers remain connected to the
peerconnection server.</li>
<li>The Toggle buttons will set the .enabled properties on the first
video and audio track for the local or remote stream, respectively.
This is effectively a temporary "mute" for the streams.</li>
<li>Stop terminates a stream, which means it will no longer send any
more data.</li>
<li>Remove will remove the current local stream from the current
peerconnection. For instance, you should be able to send a stream,
remove it, re-request a new stream and send that within the same
call. Note that re-requesting user media overwrites the current
media stream, so the reverse is not possible.</li>
<li>The PeerConnection constraints field can pass in constraints for the
peerconnection to be established. The code will attempt to eval the code
you write in and pass it whenever the code asks for constraints.
[experimental]</li>
<li>The Force Opus checkbox will remove all codecs except OPUS for all
outgoing messages sent by this page. Note that this ONLY means that
we are guaranteed to send Opus to the other side; it does NOT mean
that the other side will necessarily send Opus to us. To do that,
you need to check the box on the other side too. You can either
check the box before the call, or check the box and then re-send the
local stream.</li>
</ul>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>WebRTC IFRAME PeerConnection Manual Test</title>
<meta charset="utf-8">
</head>
<body>
<iframe width="100%" height="100%" src="peerconnection.html"></iframe>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <html>
<head> <!--
<title>WebRTC PeerConnection Manual Test</title> Copyright 2014 The Chromium Authors. All rights reserved.
<!-- Load the polyfill to switch-hit between Chrome and Firefox --> Use of this source code is governed by a BSD-style license that can be
<script src="../adapter.js"></script> found in the LICENSE file.
<script src="peerconnection_manual.js"></script> -->
<link rel="StyleSheet" href="stylesheet.css"> <head>
<meta charset="utf-8"> <title>WebRTC PeerConnection Manual Test</title>
</head> <META http-equiv="refresh" content="5;URL=http://goo.gl/Pu2xKX">
<body> </head>
<body>
<div id="wrapper"> <center>
<div id="header"> <p>The contents you are looking for have moved to GitHub. You will be
GetUserMedia <a href="http://goo.gl/V7cZg">MediaStreamConstraints</a>: redirected to the new location automatically in 5 seconds.
<input type="text" id="getusermedia-constraints" wrap="soft"> </p>
Audio<input type="checkbox" id="audio" checked <p>WebRTC demo and sample pages now live on
onclick="updateGetUserMediaConstraints();"/> <a href="http://googlechrome.github.io/webrtc/">GitHub.</a>
Video<input type="checkbox" id="video" checked This is a temporary redirect.
onclick="updateGetUserMediaConstraints();"/> </p>
Screen capture<input type="checkbox" id="screencapture" </center>
onclick="updateGetUserMediaConstraints();"/> </body>
<button class="button-green" id="re-request"
onclick="getUserMediaFromHere();">Request GetUserMedia</button><br/>
Audio source <select class="drop-down" id="audiosrc"
onchange="updateGetUserMediaConstraints();"></select>
Video source <select class="drop-down" id="videosrc"
onchange="updateGetUserMediaConstraints();"></select>
Optional min size <input type="text" id="video-width" value="1280"
size="5px" onblur="updateGetUserMediaConstraints();">
x <input type="text" id="video-height" value="720" size="5px"
onblur="updateGetUserMediaConstraints();">
<button id="get-devices" onclick="getDevices();">
Get devices</button>
Onload<input type="checkbox" id="get-devices-onload">
You can also use <a href="constraints.html">constraints.html</a>&nbsp;&nbsp;
<a href="peerconnection-help.html" target="_blank">Help</a>
<br/>
</div>
<div id="container">
<div class="left">
<div>
<h2>Local Preview</h2>
<video width="320" height="240" id="local-view" autoplay="autoplay"
muted></video><br/>
</div>
<div>
<div>
Size: <div id="local-view-size" class="inline-contents"></div>
<div id="local-view-stream-size" class="inline-contents">(stream
size: N/A)</div><br/>
</div>
<div>
Resize: <button onclick="updateVideoTagSize('local-view')"> To
stream size</button>
<button onclick="updateVideoTagSize('local-view', 320, 240);">
320x240</button>
<button onclick="updateVideoTagSize('local-view', 640, 480);">
640x480</button>
</div>
</div>
<h2>Send on data channel</h2>
<input type="text" id="data-channel-send" size="10" />
<button onclick="sendDataFromHere();">Send data</button><br>
<h2>Settings</h2>
Server [<a href="" onclick="showServerHelp();">?</a>]:
<input type="text" id="pc-server" size="30"
value="http://localhost:8888"/>
Peer ID: <input type="text" id="peer-id" size="10" />
<button class="button-green" id="connect" onclick="connectFromHere();">
Connect</button><br/>
PeerConnection Constraints:
CPU overuse <input type="checkbox" id="cpuoveruse-detection"
onclick="setPeerConnectionConstraints();" checked="true"/>
RTP <input type="checkbox" id="data-channel-type-rtp"
onclick="setPeerConnectionConstraints();"><br/>
<input class="width-100" type="text" id="pc-constraints" value="{}" ><br/>
PeerConnection <a href="http://goo.gl/xVi12">
createOffer MediaConstraints:</a><br/>
<input type="text" class="width-100" id="pc-createoffer-constraints"
value="{}"/><br/>
PeerConnection <a href="http://goo.gl/0TjfX">
createAnswer MediaConstraints:</a><br/>
<input type="text" class="width-100" id="pc-createanswer-constraints"
value="{}"/><br/>
Call:
<button class="button-green" onclick="negotiateCallFromHere();">Negotiate
</button>
<button class="button-red" onclick="hangUpFromHere();">Hang up</button>
<br/>
Local Stream:
<button class="button-green" onclick="addLocalStreamFromHere();">Add
</button>
<button class="button-red" onclick="removeLocalStreamFromHere();">Remove
</button>
<button class="button-red" onclick="stopLocalFromHere();">Stop</button>
<button onclick="toggleLocalVideoFromHere();">Toggle Video</button>
<button onclick="toggleLocalAudioFromHere();">Toggle Audio</button><br/>
Remote Stream:
<button onclick="toggleRemoteVideoFromHere();">Toggle Video</button>
<button onclick="toggleRemoteAudioFromHere();">Toggle Audio</button><br/>
Data Channel:
<button onclick="createDataChannelFromHere();">Create</button>
<button onclick="closeDataChannelFromHere();">Close</button>
status:
<input type="text" id="data-channel-status" size="10" value="not created"
disabled="true"/>
ID:
<input type="text" id="data-channel-id" size="10" disabled="true"/><br/>
DTMF Sender:
<button onclick="createDtmfSenderFromHere();">Create</button>
tones:
<input type="text" id="dtmf-tones" size="10" value="123,abc" />
duration(ms):
<input type="text" id="dtmf-tones-duration" size="10" value="100" />
gap(ms):
<input type="text" id="dtmf-tones-gap" size="10" value="50" />
<button onclick="insertDtmfFromHere();">Send</button><br/>
Options:
<input type="checkbox" id="force-isac" onclick="forceIsacChanged();"/>
Force iSAC in Outgoing SDP<br/>
<button onclick="clearLog();">Clear Logs</button>
</div>
<div class="right">
<div>
<h2>Remote Video</h2>
<video width="320" height="240" id="remote-view" autoplay="autoplay">
</video><br/>
</div>
<div>
<div>
Size: <div id="remote-view-size" class="inline-contents"></div>
<div id="remote-view-stream-size" class="inline-contents">(stream size
:N/A)</div><br/>
</div>
<div>
Resize: <button onclick="updateVideoTagSize('remote-view')"> To
stream size</button>
<button onclick="updateVideoTagSize('remote-view', 320, 240);">
320x240</button>
<button onclick="updateVideoTagSize('remote-view', 640, 480);">
640x480</button>
</div>
</div>
<h2>Received on data channel</h2>
<textarea id="data-channel-receive" rows="7" cols="40" disabled="true">
</textarea>
<h2>Sent DTMF tones</h2>
<textarea id="dtmf-tones-sent" rows="7" cols="40" disabled="true">
</textarea>
</div>
<div id="footer">
<div class="left">
<h2>Messages</h2>
<pre id="messages"></pre>
</div>
<div class="right">
<h2>Debug</h2>
<pre id="debug"></pre>
</div>
</div>
</div>
</div>
</body>
</html> </html>
/**
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
body, td {
font-family: Helvetica Narrow, sans-serif;
font-size: 11px;
}
h1, h2, h3 {
margin: 6px 0px 3px 0px;
}
a {
text-decoration: none;
}
pre {
background-color: #eee;
margin-right: 20px;
}
a:hover {
text-decoration: underline;
}
textarea {
font-size: 11px;
font-family: monospace, Courier;
border: 1px solid #ccc;
}
button {
font-size: 11px;
margin-left: 0px;
}
input[type=text] {
border: 1px solid #ccc;
}
input[type=checkbox] {
position: relative;
top: 2px;
}
video {
background: #eee;
border:1px solid #aaa;
}
.drop-down {
width: 10%;
}
.left {
float: left;
width: 50%;
}
.right {
width: 49%;
margin-left: auto;
position: relative;
}
.inline-contents {
display: inline;
}
.button-green {
background: #064;
color: #FFF;
}
.button-red {
background: #B22;
color: #FFF;
}
.width-100 {
width: 100%;
}
#wrapper {
margin: 0px auto;
padding: 5px;
}
#header {
position: fixed;
overflow: auto;
width: 100%;
height: 50px;
}
#container {
position: fixed;
overflow: auto;
width: 100%;
height: 99%;
margin-top: 50px;
}
#footer {
overflow: auto;
width: 100%;
height: 50%;
}
#getusermedia-constraints {
width: 40%;
}
#debug {
overflow: auto;
word-wrap: break-word;
}
#messages {
overflow: auto;
word-wrap: break-word;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment