Browse Source

use nick field associated with the participants, but dont show them yet

master
Philipp Hancke 11 years ago
parent
commit
3ec2fa6d19
3 changed files with 21 additions and 3 deletions
  1. 10
    1
      app.js
  2. 10
    2
      css/main.css
  3. 1
    0
      index.html

+ 10
- 1
app.js View File

@@ -81,7 +81,7 @@ function doJoin() {
81 81
             roomjid += '/' + Strophe.getNodeFromJid(connection.jid);
82 82
         }
83 83
     } else {
84
-        roomjid += '/' + Strophe.getNodeFromJid(connection.jid);
84
+        roomjid += '/' + Strophe.getNodeFromJid(connection.jid).substr(0,8);
85 85
     }
86 86
     connection.emuc.doJoin(roomjid);
87 87
 }
@@ -246,6 +246,9 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
246 246
 
247 247
 $(document).bind('joined.muc', function (event, jid, info) {
248 248
     updateRoomUrl(window.location.href);
249
+    document.getElementById('localNick').appendChild(
250
+        document.createTextNode(Strophe.getResourceFromJid(jid) + ' (you)')
251
+    );
249 252
 
250 253
     // Once we've joined the muc show the toolbar
251 254
     showToolbar();
@@ -264,6 +267,11 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {
264 267
     var remotes = document.getElementById('remoteVideos');
265 268
     remotes.appendChild(container);
266 269
 
270
+    var nickfield = document.createElement('span');
271
+    nickfield.appendChild(document.createTextNode(Strophe.getResourceFromJid(jid)));
272
+    container.appendChild(nickfield);
273
+    resizeThumbnails();
274
+
267 275
     if (focus !== null) {
268 276
         // FIXME: this should prepare the video
269 277
         if (focus.confid === null) {
@@ -291,6 +299,7 @@ $(document).bind('left.muc', function (event, jid) {
291 299
     if (container) {
292 300
         // hide here, wait for video to close before removing
293 301
         $(container).hide(); 
302
+        resizeThumbnails();
294 303
     }
295 304
 
296 305
     if (Object.keys(connection.emuc.members).length === 0) {

+ 10
- 2
css/main.css View File

@@ -29,6 +29,15 @@ html, body{
29 29
     width: 100%;
30 30
     height: 100%;
31 31
 }
32
+.videocontainer>span {
33
+    display: none; /* enable when you want nicks to be shown */
34
+    position: absolute;
35
+    left: 0px;
36
+    bottom: -20px;
37
+    z-index: 0;
38
+    width: 100%;
39
+    font-size: 10pt;
40
+}
32 41
 
33 42
 #largeVideo {
34 43
 }
@@ -49,11 +58,10 @@ html, body{
49 58
     width:auto;
50 59
     overflow: hidden;
51 60
     border:1px solid transparent;
52
-    font-size:0;
53 61
     z-index: 2;
54 62
 }
55 63
 
56
-#remoteVideos span {
64
+#remoteVideos>span {
57 65
     display: inline-block;
58 66
     z-index:0;
59 67
     border:1px solid #FFFFFF;

+ 1
- 0
index.html View File

@@ -49,6 +49,7 @@
49 49
         <div class="fade_line"></div>
50 50
         <div id="remoteVideos">
51 51
             <span id="localVideoContainer" class="videocontainer">
52
+              <span id="localNick"></span>
52 53
               <video id="localVideo" autoplay oncontextmenu="return false;" muted/>
53 54
             </span>
54 55
         </div>

Loading…
Cancel
Save