Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add toogle to message and made the video of you smaller

  • Loading branch information...
commit 79b1a1576aa8ab65d04c9fb80416772f3f3fb299 1 parent e40f50e
Dennis authored March 22, 2013
5  site/index.html
@@ -8,9 +8,10 @@
8 8
   <body onload="init()">
9 9
     <div id="videos">
10 10
       <a href="https://github.com/webRTC"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
11  
-      <video id="you" class="flip" autoplay></video>
  11
+      <video id="you" class="flip" autoplay width="263" height="200" style="position: absolute; left: 0px; bottom: 0px;"></video>
12 12
     </div>
13 13
     <div id="chatbox">
  14
+      <div id="hideShowMessages" class="button">toggle chat</div>
14 15
       <div id="messages">
15 16
       </div>
16 17
       <input id="chatinput" type="text" placeholder="Message:"/>
@@ -23,4 +24,4 @@
23 24
     
24 25
     <script src="/script.js"></script>
25 26
   </body>
26  
-</html>
  27
+</html>
17  site/script.js
@@ -135,9 +135,22 @@ function initChat() {
135 135
   }
136 136
 
137 137
   var input = document.getElementById("chatinput");
  138
+  var toggleHideShow = document.getElementById("hideShowMessages");
138 139
   var room = window.location.hash.slice(1);
139 140
   var color = "#" + ((1 << 24) * Math.random() | 0).toString(16);
140 141
 
  142
+  toggleHideShow.addEventListener('click', function() {
  143
+    var element = document.getElementById("messages");
  144
+
  145
+    if(element.style.display === "block") {
  146
+      element.style.display = "none";
  147
+    }
  148
+    else {
  149
+      element.style.display = "block";
  150
+    }
  151
+
  152
+  });
  153
+
141 154
   input.addEventListener('keydown', function(event) {
142 155
     var key = event.which || event.keyCode;
143 156
     if(key === 13) {
@@ -169,9 +182,9 @@ function init() {
169 182
     }, function(stream) {
170 183
       document.getElementById('you').src = URL.createObjectURL(stream);
171 184
       document.getElementById('you').play();
172  
-      videos.push(document.getElementById('you'));
  185
+      //videos.push(document.getElementById('you'));
173 186
       //rtc.attachStream(stream, 'you');
174  
-      subdivideVideos();
  187
+      //subdivideVideos();
175 188
     });
176 189
   } else {
177 190
     alert('Your browser is not supported or you have to turn on flags. In chrome you go to chrome://flags and turn on Enable PeerConnection remember to restart chrome');

0 notes on commit 79b1a15

Please sign in to comment.
Something went wrong with that request. Please try again.