Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Spielebahn's Stream</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="description" content="Just some random website, move on...">
  7. <meta charset="UTF-8">
  8. <link rel="stylesheet" href="/style/style.css">
  9. <script src="/script/pageVisibilityAPI.js"></script>
  10. <link rel="icon" href="/media/favicon.ico" type="image/x-icon">
  11. </head>
  12. <body>
  13. <header>
  14. <a href="/" id="logo"></a>
  15. <nav>
  16. <a href="#" id="menu-icon"></a>
  17. <ul>
  18. <li>
  19. <a href="/member">Members</a>
  20. </li>
  21. <li>
  22. <a href="/why">Why 'Five'?</a>
  23. </li>
  24. <li>
  25. <a href="/stream">Stream</a>
  26. </li>
  27. <li id="discord_app">
  28. <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">Discord</a>
  29. </li>
  30. <li id="NavBarBorder">
  31. <a class="menuLink" href="/wiki/Hauptseite">Wiki</a>
  32. </li>
  33. <li id="discord_link">
  34. <a href="https://discord.gg/RVvMcDk">Discord</a>
  35. </li>
  36. </ul>
  37. </nav>
  38. </header>
  39. <main>
  40. <!-- Twitch embedding stuff -->
  41. <script src="https://player.twitch.tv/js/embed/v1.js"></script>
  42. <div class="cd-fixed-bg text">
  43. <!-- Display -->
  44. <div class="grid-container" id="StreamSizeHelper">
  45. <div id="stream_container">
  46. <div id='twitch_stream'></div>
  47. </div>
  48. <div id="twitch_Chat">
  49. <!-- Twitch Chat -->
  50. <iframe
  51. id="chat_embed"
  52. src="https://www.twitch.tv/embed/spielebahn/chat">
  53. </iframe>
  54. </div>
  55. <div id="youtube_chat">
  56. <!-- Youtube Live Chat embed -->
  57. <iframe id="YoutubeChatiFrame" allowfullscreen="" src="https://www.youtube.com/live_chat?v=Wsm7vIJQSrg&embed_domain=groupfive.de"></iframe>
  58. </div>
  59. <div id="Stream_Switch">
  60. <button onclick="StreamSwitch()">Stream wechseln (Twitch/Youtube)</button>
  61. </div>
  62. </div>
  63. </div>
  64. <script>
  65. // Twitch Stream settings
  66. function TwitchStreamJS() {
  67. // Get the ViewPort Width
  68. var ViewPortWidth = document.documentElement.clientWidth;
  69. // If as wide as HD place chats to the left of the stream (chats need 320px each)
  70. if (ViewPortWidth >= 1240) {
  71. var StreamWidth = ViewPortWidth - 640;
  72. // If not make the stream use the full width
  73. } else {
  74. // Force Scrollbar
  75. document.getElementById('Stream_Switch').setAttribute("style","height:100000px");
  76. // Figure out stream width with scrollbar
  77. var ViewPortWidth = document.getElementById('StreamSizeHelper').offsetWidth;
  78. // Get rid of scrollbarhelper
  79. document.getElementById('Stream_Switch').setAttribute("style","height:null");
  80. var StreamWidth = ViewPortWidth;
  81. }
  82. // Calc stream height
  83. var StreamHeight = StreamWidth / ( 16 / 9 );
  84. // Set the stream options
  85. var options = {
  86. height: StreamHeight,
  87. width: StreamWidth,
  88. channel: "spielebahn"
  89. };
  90. // Initialize stream player
  91. var player = new Twitch.Player("twitch_stream", options);
  92. player.setVolume(0.5);
  93. }
  94.  
  95. // Initialize Twitch Stream
  96. TwitchStreamJS();
  97.  
  98. // Set default stream
  99. var CurStream = "twitch";
  100.  
  101. // Stream Switch
  102. function StreamSwitch() {
  103. // Compare Stream
  104. if (CurStream == "twitch") {
  105. CurStream = "youtube";
  106. // Get the ViewPort Width
  107. var ViewPortWidth = document.documentElement.clientWidth;
  108. // If as wide as HD place chats to the left of the stream (chats need 320px each)
  109. if (ViewPortWidth >= 1240) {
  110. var StreamWidth = ViewPortWidth - 640;
  111. // If not make the stream use the full width
  112. } else {
  113. // Force Scrollbar
  114. document.getElementById('Stream_Switch').setAttribute("style","height:100000px");
  115. // Figure out stream width with scrollbar
  116. var ViewPortWidth = document.getElementById('StreamSizeHelper').offsetWidth;
  117. // Get rid of scrollbarhelper
  118. document.getElementById('Stream_Switch').setAttribute("style","height:null");
  119. var StreamWidth = ViewPortWidth;
  120. }
  121. var StreamHeight = StreamWidth / ( 16 / 9 );
  122. document.getElementById('stream_container').innerHTML = "<iframe id='youtube_stream' class='stream' width='" + StreamWidth + "' height='" + StreamHeight + "' src='https://www.youtube.com/embed/Wsm7vIJQSrg'></iframe>";
  123. } else {
  124. CurStream = "twitch";
  125. document.getElementById('stream_container').innerHTML = "<div id='twitch_stream'></div>";
  126. TwitchStreamJS();
  127. }
  128. }
  129. </script>
  130. <!-- discord stuff - WHAT THE FUCK IS WRONG WITH ME!? -->
  131. <iframe id="light" class="white_content" src="https://discordapp.com/widget?id=196377584143958016&theme=dark" width="350" height="500"></iframe>
  132. <div id="fade" class="black_overlay" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"></div>
  133. </main>
  134. </body>
  135. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement