OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- saved from url=(0070)https://webrtc.github.io/samples/src/content/datachann
el/datatransfer/ --> |
| 3 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 4 |
| 5 |
| 6 <meta name="description" content="WebRTC code samples"> |
| 7 <meta name="viewport" content="width=device-width, user-scalable=yes, initial-
scale=1, maximum-scale=1"> |
| 8 <meta itemprop="description" content="Client-side WebRTC code samples"> |
| 9 <meta itemprop="image" content="../../../images/webrtc-icon-192x192.png"> |
| 10 <meta itemprop="name" content="WebRTC code samples"> |
| 11 <meta name="mobile-web-app-capable" content="yes"> |
| 12 <meta id="theme-color" name="theme-color" content="#ffffff"> |
| 13 |
| 14 <!--<base target="_blank">--><base href="." target="_blank"> |
| 15 |
| 16 <title>Generate and transfer data</title> |
| 17 |
| 18 <link rel="icon" sizes="192x192" href="https://webrtc.github.io/samples/src/im
ages/webrtc-icon-192x192.png"> |
| 19 <link href="./datachannel_files/css" rel="stylesheet" type="text/css"> |
| 20 <link rel="stylesheet" href="./datachannel_files/main.css"> |
| 21 <link rel="stylesheet" href="./datachannel_files/main(1).css"> |
| 22 |
| 23 </head> |
| 24 |
| 25 <body> |
| 26 |
| 27 <div id="container"> |
| 28 |
| 29 <h1><a href="https://webrtc.github.io/samples/" title="WebRTC samples homepa
ge">WebRTC samples</a> <span>Generate and transfer data</span></h1> |
| 30 <section> |
| 31 |
| 32 <p>This page generates and sends the specified amount of data via WebRTC d
atachannels.</p> |
| 33 |
| 34 <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> |
| 35 |
| 36 <p>Send and receive progress is monitored using HTML5 <i>progress</i> elem
ents.</p> |
| 37 |
| 38 </section> |
| 39 |
| 40 <section> |
| 41 <div id="button"> |
| 42 <button id="sendTheData" type="button">Generate and send data</button> |
| 43 </div> |
| 44 <div class="input"> |
| 45 <input type="number" id="megsToSend" min="1" name="megs" value="128"> |
| 46 <label for="megsToSend">MB</label> |
| 47 <div id="errorMsg"></div> |
| 48 </div> |
| 49 <div class="input"> |
| 50 <input type="checkbox" id="ordered" checked=""> |
| 51 <label for="ordered">Ordered mode</label> |
| 52 </div> |
| 53 <div class="progress"> |
| 54 <div class="label">Send progress: </div> |
| 55 <progress id="sendProgress" max="0" value="0"></progress> |
| 56 </div> |
| 57 |
| 58 <div class="progress"> |
| 59 <div class="label">Receive progress: </div> |
| 60 <progress id="receiveProgress" max="0" value="0"></progress> |
| 61 </div> |
| 62 </section> |
| 63 |
| 64 <section> |
| 65 <p>View the console to see logging.</p> |
| 66 |
| 67 <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> |
| 68 |
| 69 <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> |
| 70 </section> |
| 71 |
| 72 <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> |
| 73 </div> |
| 74 |
| 75 <script async="" src="./datachannel_files/analytics.js"></script><script src="
./datachannel_files/adapter-latest.js"></script> |
| 76 <script src="./datachannel_files/common.js"></script> |
| 77 <script src="./datachannel_files/main.js"></script> |
| 78 |
| 79 <script src="./datachannel_files/ga.js"></script> |
| 80 |
| 81 |
| 82 |
| 83 </body></html> |
OLD | NEW |