2
0

index.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <html>
  2. <head>
  3. <title>SRS</title>
  4. <meta charset="utf-8">
  5. <style>
  6. .span6 {
  7. width: 480px;
  8. }
  9. .code {
  10. background-color: rgb(246 248 250);
  11. padding: 8px;
  12. overflow: auto;
  13. font-size: 85%;
  14. line-height: 1.45;
  15. border-radius: 6px;
  16. word-break: normal;
  17. word-wrap: normal;
  18. box-sizing: border-box;
  19. display: block;
  20. white-space: pre;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div>
  26. <h3><a href="https://github.com/ossrs/srs">SRS</a> works!</h3>
  27. <p>
  28. Click <a id="enConsole" href="#">here</a> to enter SRS console.<br/>
  29. 点击进入<a id="cnConsole" href="#">SRS控制台</a>
  30. </p>
  31. <p>
  32. Publish stream by <a href="https://ffmpeg.org/download.html">FFmpeg</a> or <a href="https://obsproject.com/download">OBS</a>:<br/>
  33. 请使用工具<a href="https://ffmpeg.org/download.html">FFmpeg</a>或者<a href="https://obsproject.com/download">OBS</a>推流到下面地址:
  34. <pre id="url" class="code span6"></pre>
  35. </p>
  36. <p>
  37. Click <a id="enPlayer" href="#">here</a> to start SRS player.<br/>
  38. 点击进入<a id="cnPlayer" href="#">SRS播放器</a>
  39. </p>
  40. <p><a href="https://github.com/ossrs/srs">SRS Team &copy; 2022</a></p>
  41. </div>
  42. <script type="text/javascript">
  43. // Build RTMP url.
  44. if (true) {
  45. const rtmpUrl = `rtmp://${window.location.hostname}/live/livestream`;
  46. document.getElementById('url').innerText = rtmpUrl;
  47. }
  48. // Build console url.
  49. if (true) {
  50. // The prefix for default website.
  51. const prefix = `${window.location.protocol}//${window.location.host}`;
  52. // If not 8080, user should proxy to the default port.
  53. const query = parseInt(window.location.port) === 8080 ? `?port=1985` : '';
  54. const enUrl = `${prefix}/console/en_index.html#/summaries${query}`;
  55. const cnUrl = `${prefix}/console/ng_index.html#/summaries${query}`;
  56. document.getElementById("enConsole").setAttribute('href', enUrl);
  57. document.getElementById("cnConsole").setAttribute('href', cnUrl);
  58. }
  59. // The player url.
  60. if (true) {
  61. const prefix = `players/?schema=${window.location.protocol.replace(':', '')}`;
  62. const httpPort = window.location.port || (window.location.protocol === 'http:' ? 80 : 443);
  63. // If not 8080, user should proxy both stream and API to the default port.
  64. const query = parseInt(window.location.port) === 8080 ? '' : `&port=${httpPort}&api=${httpPort}`;
  65. document.getElementById("enPlayer").setAttribute('href', `${prefix}${query}`);
  66. document.getElementById("cnPlayer").setAttribute('href', `${prefix}${query}`);
  67. }
  68. </script>
  69. </body>