OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 * Copyright 2017 The Chromium Authors. All rights reserved. |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 --> |
| 7 <html> |
| 8 <head> |
| 9 |
| 10 |
| 11 <base target="_blank"> |
| 12 |
| 13 <title>Generate and transfer data</title> |
| 14 |
| 15 |
| 16 </head> |
| 17 |
| 18 <body> |
| 19 |
| 20 <div id="container"> |
| 21 |
| 22 <h1><a href="https://webrtc.github.io/samples/" title="WebRTC samples homepa
ge">WebRTC samples</a> <span>Generate and transfer data</span></h1> |
| 23 <section> |
| 24 |
| 25 <p>This page generates and sends the specified amount of data via WebRTC d
atachannels.</p> |
| 26 |
| 27 <p>To accomplish this in an interoperable way, the data is split into chun
ks which are then transferred via the datachannel. The datachannel is reliable a
nd ordered by default which is well-suited to filetransfers.</p> |
| 28 |
| 29 <p>Send and receive progress is monitored using HTML5 <i>progress</i> elem
ents.</p> |
| 30 |
| 31 </section> |
| 32 |
| 33 <section> |
| 34 <div id="button"> |
| 35 <button id="sendTheData" type="button">Generate and send data</button> |
| 36 </div> |
| 37 <div class="input"> |
| 38 <input type="number" id="megsToSend" min="1" name="megs" value="128"/> |
| 39 <label for="megsToSend">MB</label> |
| 40 <div id="errorMsg"></div> |
| 41 </div> |
| 42 <div class="input"> |
| 43 <input type="checkbox" id="ordered" checked> |
| 44 <label for="ordered">Ordered mode</label> |
| 45 </div> |
| 46 <div class="progress"> |
| 47 <div class="label">Send progress: </div> |
| 48 <progress id="sendProgress" max="0" value="0"></progress> |
| 49 </div> |
| 50 |
| 51 <div class="progress"> |
| 52 <div class="label">Receive progress: </div> |
| 53 <progress id="receiveProgress" max="0" value="0"></progress> |
| 54 </div> |
| 55 </section> |
| 56 |
| 57 <section> |
| 58 <p>View the console to see logging.</p> |
| 59 |
| 60 <p>The <code>RTCPeerConnection</code> objects <code>localConnection</code>
and <code>remoteConnection</code> are in global scope, so you can inspect them
in the console as well.</p> |
| 61 |
| 62 <p>For more information about RTCDataChannel, see <a href="http://www.html
5rocks.com/en/tutorials/webrtc/basics/#toc-rtcdatachannel" title="RTCDataChannel
section of HTML5 Rocks article about WebRTC">Getting Started With WebRTC</a>.</
p> |
| 63 </section> |
| 64 |
| 65 <a href="https://github.com/webrtc/samples/tree/gh-pages/src/content/datacha
nnel/datatransfer" title="View source for this page on GitHub" id="viewSource">V
iew source on GitHub</a> |
| 66 </div> |
| 67 |
| 68 |
| 69 |
| 70 <script src="datatransfer.js"></script> |
| 71 <script src="adapter.js"></script> |
| 72 <script src="common.js"></script> |
| 73 </body></html> |
OLD | NEW |