index.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>libdatachannel media example</title>
  6. <style>
  7. button {
  8. padding: 8px 16px;
  9. }
  10. pre {
  11. overflow-x: hidden;
  12. overflow-y: auto;
  13. }
  14. video {
  15. width: 100%;
  16. }
  17. .option {
  18. margin-bottom: 8px;
  19. }
  20. #media {
  21. max-width: 1280px;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
  27. <h2>Options</h2>
  28. <div class="option">
  29. <input id="use-stun" type="checkbox"/>
  30. <label for="use-stun">Use STUN server</label>
  31. </div>
  32. <button id="start" onclick="start()" disabled>Start</button>
  33. <button id="stop" style="display: none" onclick="stop()">Stop</button>
  34. <h2>State</h2>
  35. <p>
  36. ICE gathering state: <span id="ice-gathering-state"></span>
  37. </p>
  38. <p>
  39. ICE connection state: <span id="ice-connection-state"></span>
  40. </p>
  41. <p>
  42. Signaling state: <span id="signaling-state"></span>
  43. </p>
  44. <div id="media" style="display: none">
  45. <h2>Media</h2>
  46. <video id="video" autoplay playsinline></video>
  47. </div>
  48. <h2>Data channel</h2>
  49. <pre id="data-channel" style="height: 200px;"></pre>
  50. <h2>SDP</h2>
  51. <h3>Offer</h3>
  52. <pre id="offer-sdp"></pre>
  53. <h3>Answer</h3>
  54. <pre id="answer-sdp"></pre>
  55. <script src="client.js"></script>
  56. </body>
  57. </html>