瀏覽代碼

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

j8
Philipp Hancke 11 年之前
父節點
當前提交
3ec2fa6d19
共有 3 個文件被更改,包括 21 次插入3 次删除
  1. 10
    1
      app.js
  2. 10
    2
      css/main.css
  3. 1
    0
      index.html

+ 10
- 1
app.js 查看文件

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

+ 10
- 2
css/main.css 查看文件

29
     width: 100%;
29
     width: 100%;
30
     height: 100%;
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
 #largeVideo {
42
 #largeVideo {
34
 }
43
 }
49
     width:auto;
58
     width:auto;
50
     overflow: hidden;
59
     overflow: hidden;
51
     border:1px solid transparent;
60
     border:1px solid transparent;
52
-    font-size:0;
53
     z-index: 2;
61
     z-index: 2;
54
 }
62
 }
55
 
63
 
56
-#remoteVideos span {
64
+#remoteVideos>span {
57
     display: inline-block;
65
     display: inline-block;
58
     z-index:0;
66
     z-index:0;
59
     border:1px solid #FFFFFF;
67
     border:1px solid #FFFFFF;

+ 1
- 0
index.html 查看文件

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

Loading…
取消
儲存