Browse Source

Beta version of the new meet.jit.si interface.

master
yanas 11 years ago
parent
commit
102680512b
16 changed files with 1114 additions and 592 deletions
  1. 285
    304
      app.js
  2. 92
    25
      chat.js
  3. 71
    0
      css/font.css
  4. 11
    239
      css/main.css
  5. 226
    0
      css/videolayout_default.css
  6. 38
    6
      etherpad.js
  7. BIN
      fonts/jitsi.eot
  8. 25
    0
      fonts/jitsi.svg
  9. BIN
      fonts/jitsi.ttf
  10. BIN
      fonts/jitsi.woff
  11. BIN
      images/avatar1.png
  12. BIN
      images/avatarprezi.png
  13. BIN
      images/watermark.png
  14. 22
    18
      index.html
  15. 333
    0
      prezi.js
  16. 11
    0
      util.js

+ 285
- 304
app.js View File

10
 var ssrc2jid = {};
10
 var ssrc2jid = {};
11
 var localVideoSrc = null;
11
 var localVideoSrc = null;
12
 var flipXLocalVideo = true;
12
 var flipXLocalVideo = true;
13
-var preziPlayer = null;
13
+var isFullScreen = false;
14
+var toolbarTimeout = null;
15
+var currentVideoWidth = null;
16
+var currentVideoHeight = null;
14
 
17
 
15
 /* window.onbeforeunload = closePageWarning; */
18
 /* window.onbeforeunload = closePageWarning; */
16
 
19
 
154
 }
157
 }
155
 
158
 
156
 function change_local_audio(stream) {
159
 function change_local_audio(stream) {
157
-
158
     connection.jingle.localAudio = stream;
160
     connection.jingle.localAudio = stream;
159
     RTC.attachMediaStream($('#localAudio'), stream);
161
     RTC.attachMediaStream($('#localAudio'), stream);
160
     document.getElementById('localAudio').autoplay = true;
162
     document.getElementById('localAudio').autoplay = true;
171
     localVideo.volume = 0; // is it required if audio is separated ?
173
     localVideo.volume = 0; // is it required if audio is separated ?
172
     localVideo.oncontextmenu = function () { return false; };
174
     localVideo.oncontextmenu = function () { return false; };
173
 
175
 
174
-    var localVideoContainer = document.getElementById('localVideoContainer');
176
+    localVideo.addEventListener('loadedmetadata', function(e){
177
+        positionLarge(this.videoWidth, this.videoHeight);
178
+    });
179
+
180
+    var localVideoContainer = document.getElementById('localVideoWrapper');
175
     localVideoContainer.appendChild(localVideo);
181
     localVideoContainer.appendChild(localVideo);
176
 
182
 
177
     var localVideoSelector = $('#' + localVideo.id);
183
     var localVideoSelector = $('#' + localVideo.id);
265
     vid.id = id;
271
     vid.id = id;
266
     vid.autoplay = true;
272
     vid.autoplay = true;
267
     vid.oncontextmenu = function () { return false; };
273
     vid.oncontextmenu = function () { return false; };
274
+
275
+    vid.addEventListener('loadedmetadata', function(e){
276
+        positionLarge(this.videoWidth, this.videoHeight);
277
+    });
278
+
268
     container.appendChild(vid);
279
     container.appendChild(vid);
280
+    var sel = $('#' + id);
281
+    sel.hide();
282
+    RTC.attachMediaStream(sel, data.stream);
283
+    waitForRemoteVideo(sel, sid);
284
+
269
     // TODO: make mixedstream display:none via css?
285
     // TODO: make mixedstream display:none via css?
270
     if (id.indexOf('mixedmslabel') !== -1) {
286
     if (id.indexOf('mixedmslabel') !== -1) {
271
         container.id = 'mixedstream';
287
         container.id = 'mixedstream';
555
         showDisplayName(videoSpanId, info.displayName);
571
         showDisplayName(videoSpanId, info.displayName);
556
 
572
 
557
     var nickfield = document.createElement('span');
573
     var nickfield = document.createElement('span');
574
+    nickfield.className = "nick";
558
     nickfield.appendChild(document.createTextNode(Strophe.getResourceFromJid(jid)));
575
     nickfield.appendChild(document.createTextNode(Strophe.getResourceFromJid(jid)));
559
     container.appendChild(nickfield);
576
     container.appendChild(nickfield);
560
     resizeThumbnails();
577
     resizeThumbnails();
681
             });
698
             });
682
 });
699
 });
683
 
700
 
684
-/*
685
- * Presentation has been removed.
686
- */
687
-$(document).bind('presentationremoved.muc', function(event, jid, presUrl) {
688
-    console.log('presentation removed', presUrl);
689
-    var presId = getPresentationId(presUrl);
690
-    setPresentationVisible(false);
691
-    $('#participant_' + Strophe.getResourceFromJid(jid) + '_' + presId).remove();
692
-    $('#presentation>iframe').remove();
693
-    if (preziPlayer !== null) {
694
-        preziPlayer.destroy();
695
-        preziPlayer = null;
696
-    }
697
-});
698
-
699
-/*
700
- * Presentation has been added.
701
- */
702
-$(document).bind('presentationadded.muc', function (event, jid, presUrl, currentSlide) {
703
-    console.log("presentation added", presUrl);
704
-
705
-    var presId = getPresentationId(presUrl);
706
-    var elementId = 'participant_' + Strophe.getResourceFromJid(jid) + '_' + presId;
707
-
708
-    var container = addRemoteVideoContainer(elementId);
709
-    resizeThumbnails();
710
-
711
-    var controlsEnabled = false;
712
-    if (jid === connection.emuc.myroomjid)
713
-        controlsEnabled = true;
714
-
715
-    setPresentationVisible(true);
716
-    $('#largeVideoContainer').hover(
717
-        function (event) {
718
-            if (isPresentationVisible())
719
-                $('#reloadPresentation').css({display:'inline-block'});
720
-        },
721
-        function (event) {
722
-            if (!isPresentationVisible())
723
-                $('#reloadPresentation').css({display:'none'});
724
-            else {
725
-                var e = event.toElement || event.relatedTarget;
726
-
727
-                while(e && e.parentNode && e.parentNode !== window) {
728
-                    if (e.parentNode === this || e === this) {
729
-                        return false;
730
-                    }
731
-                    e = e.parentNode;
732
-                }
733
-                $('#reloadPresentation').css({display:'none'});
734
-            }
735
-        });
736
-
737
-    preziPlayer = new PreziPlayer(
738
-                'presentation',
739
-                {preziId: presId,
740
-                width: $('#largeVideoContainer').width(),
741
-                height: $('#largeVideoContainer').height(),
742
-                controls: controlsEnabled,
743
-                debug: true
744
-                });
745
-
746
-    $('#presentation>iframe').attr('id', preziPlayer.options.preziId);
747
-
748
-    preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
749
-        console.log("prezi status", event.value);
750
-        if (event.value === PreziPlayer.STATUS_CONTENT_READY) {
751
-            if (jid !== connection.emuc.myroomjid)
752
-                preziPlayer.flyToStep(currentSlide);
753
-        }
754
-    });
755
-
756
-    preziPlayer.on(PreziPlayer.EVENT_CURRENT_STEP, function(event) {
757
-        console.log("event value", event.value);
758
-        connection.emuc.addCurrentSlideToPresence(event.value);
759
-        connection.emuc.sendPresence();
760
-    });
761
-
762
-    $("#" + elementId).css('background-image','url(../images/avatarprezi.png)');
763
-    $("#" + elementId).click(
764
-        function () {
765
-            setPresentationVisible(true);
766
-        }
767
-    );
768
-});
769
-
770
-/*
771
- * Indicates presentation slide change.
772
- */
773
-$(document).bind('gotoslide.muc', function (event, jid, presUrl, current) {
774
-    if (preziPlayer) {
775
-        preziPlayer.flyToStep(current);
776
-    }
777
-});
778
-
779
-/**
780
- * Returns the presentation id from the given url.
781
- */
782
-function getPresentationId (presUrl) {
783
-    var presIdTmp = presUrl.substring(presUrl.indexOf("prezi.com/") + 10);
784
-    return presIdTmp.substring(0, presIdTmp.indexOf('/'));
785
-}
786
-
787
-/*
788
- * Reloads the current presentation.
789
- */
790
-function reloadPresentation() {
791
-    var iframe = document.getElementById(preziPlayer.options.preziId);
792
-    iframe.src = iframe.src;
793
-}
794
-
795
-/*
796
- * Shows/hides a presentation.
797
- */
798
-function setPresentationVisible(visible) {
799
-    if (visible) {
800
-        // Trigger the video.selected event to indicate a change in the large video.
801
-        $(document).trigger("video.selected", [true]);
802
-
803
-        $('#largeVideo').fadeOut(300, function () {
804
-            $('#largeVideo').css({visibility:'hidden'});
805
-            $('#presentation>iframe').fadeIn(300, function() {
806
-                $('#presentation>iframe').css({opacity:'1'});
807
-            });
808
-        });
809
-    }
810
-    else {
811
-        if ($('#presentation>iframe')) {
812
-            $('#presentation>iframe').fadeOut(300, function () {
813
-                $('#presentation>iframe').css({opacity:'0'});
814
-                $('#largeVideo').fadeIn(300, function() {
815
-                    $('#largeVideo').css({visibility:'visible'});
816
-                });
817
-            });
818
-        }
819
-    }
820
-}
821
-
822
-function isPresentationVisible() {
823
-    return ($('#presentation>iframe') !== null && $('#presentation>iframe').css('opacity') == 1);
824
-}
825
-
826
 /**
701
 /**
827
  * Updates the large video with the given new video source.
702
  * Updates the large video with the given new video source.
828
  */
703
  */
829
 function updateLargeVideo(newSrc, vol) {
704
 function updateLargeVideo(newSrc, vol) {
830
     console.log('hover in', newSrc);
705
     console.log('hover in', newSrc);
831
 
706
 
832
-    setPresentationVisible(false);
833
-
834
-    if ($('#largeVideo').attr('src') !== newSrc) {
707
+    if ($('#largeVideo').attr('src') != newSrc) {
708
+        document.getElementById('largeVideo')
709
+            .addEventListener('loadedmetadata', function(e){
710
+                currentVideoWidth = this.videoWidth;
711
+                currentVideoHeight = this.videoHeight;
712
+        });
835
 
713
 
836
-        // FIXME: is it still required ? audio is separated
837
-        //document.getElementById('largeVideo').volume = vol;
714
+        var isVisible = $('#largeVideo').is(':visible');
838
 
715
 
839
         $('#largeVideo').fadeOut(300, function () {
716
         $('#largeVideo').fadeOut(300, function () {
840
             $(this).attr('src', newSrc);
717
             $(this).attr('src', newSrc);
850
                 document.getElementById('largeVideo').style.webkitTransform = "none";
727
                 document.getElementById('largeVideo').style.webkitTransform = "none";
851
             }
728
             }
852
 
729
 
853
-            $(this).fadeIn(300);
730
+            if (isVisible)
731
+                $(this).fadeIn(300);
854
         });
732
         });
855
     }
733
     }
856
 }
734
 }
857
 
735
 
736
+/**
737
+ * Shows/hides the large video.
738
+ */
739
+function setLargeVideoVisible(isVisible) {
740
+    if (isVisible) {
741
+        $('#largeVideo').css({visibility:'visible'});
742
+        $('#watermark').css({visibility:'visible'});
743
+    }
744
+    else {
745
+        $('#largeVideo').css({visibility:'hidden'});
746
+        $('#watermark').css({visibility:'hidden'});
747
+    }
748
+}
749
+
858
 function getConferenceHandler() {
750
 function getConferenceHandler() {
859
     return focus ? focus : activecall;
751
     return focus ? focus : activecall;
860
 }
752
 }
876
             }
768
             }
877
         );
769
         );
878
     }
770
     }
771
+    var sess = focus || activecall;
772
+    if (!sess) {
773
+        return;
774
+    }
775
+    sess.pendingop = ismuted ? 'unmute' : 'mute';
776
+    sess.modifySources();
879
 }
777
 }
880
 
778
 
881
 function toggleAudio() {
779
 function toggleAudio() {
886
     }
784
     }
887
 }
785
 }
888
 
786
 
889
-var resizeLarge = function () {
890
-    Chat.resizeChat();
891
-    var availableHeight = window.innerHeight;
892
-    var chatspaceWidth = $('#chatspace').is(":visible")
893
-                            ? $('#chatspace').width()
894
-                            : 0;
787
+/**
788
+ * Positions the large video.
789
+ *
790
+ * @param videoWidth the stream video width
791
+ * @param videoHeight the stream video height
792
+ */
793
+var positionLarge = function(videoWidth, videoHeight) {
794
+    var videoSpaceWidth = $('#videospace').width();
795
+    var videoSpaceHeight = window.innerHeight;
796
+
797
+    var videoSize = getVideoSize(   videoWidth,
798
+                                    videoHeight,
799
+                                    videoSpaceWidth,
800
+                                    videoSpaceHeight);
801
+
802
+    var availableWidth = videoSize[0];
803
+    var availableHeight = videoSize[1];
804
+
805
+    var videoPosition = getVideoPosition(   availableWidth,
806
+                                            availableHeight,
807
+                                            videoSpaceWidth,
808
+                                            videoSpaceHeight);
809
+
810
+    var horizontalIndent = videoPosition[0];
811
+    var verticalIndent = videoPosition[1];
812
+
813
+    positionVideo(  $('#largeVideo'),
814
+                    availableWidth,
815
+                    availableHeight,
816
+                    horizontalIndent, verticalIndent);
817
+};
895
 
818
 
896
-    var numvids = $('#remoteVideos>video:visible').length;
897
-    if (numvids < 5)
898
-        availableHeight -= 100; // min thumbnail height for up to 4 videos
899
-    else
900
-        availableHeight -= 50; // min thumbnail height for more than 5 videos
819
+/**
820
+ * Returns an array of the video horizontal and vertical indents,
821
+ * so that if fits its parent.
822
+ *
823
+ * @return an array with 2 elements, the horizontal indent and the vertical
824
+ * indent
825
+ */
826
+var getVideoPosition = function (   videoWidth,
827
+                                    videoHeight,
828
+                                    videoSpaceWidth,
829
+                                    videoSpaceHeight) {
830
+    // Parent height isn't completely calculated when we position the video in
831
+    // full screen mode and this is why we use the screen height in this case.
832
+    // Need to think it further at some point and implement it properly.
833
+    var isFullScreen = document.fullScreen
834
+                        || document.mozFullScreen
835
+                        || document.webkitIsFullScreen; 
836
+    if (isFullScreen)
837
+        videoSpaceHeight = window.innerHeight;
838
+
839
+    var horizontalIndent = (videoSpaceWidth - videoWidth)/2;
840
+    var verticalIndent = (videoSpaceHeight - videoHeight)/2;
841
+
842
+    return [horizontalIndent, verticalIndent];
843
+};
901
 
844
 
902
-    availableHeight -= 79; // padding + link ontop
903
-    var availableWidth = window.innerWidth - chatspaceWidth;
904
-    var aspectRatio = 16.0 / 9.0;
905
-    if (availableHeight < availableWidth / aspectRatio) {
906
-        availableWidth = Math.floor(availableHeight * aspectRatio);
845
+/**
846
+ * Returns an array of the video dimensions, so that if fits the screen.
847
+ *
848
+ * @return an array with 2 elements, the video width and the video height
849
+ */
850
+var getVideoSize = function(videoWidth,
851
+                            videoHeight,
852
+                            videoSpaceWidth,
853
+                            videoSpaceHeight) {
854
+    if (!videoWidth)
855
+        videoWidth = currentVideoWidth;
856
+    if (!videoHeight)
857
+        videoHeight = currentVideoHeight;
858
+
859
+    var aspectRatio = videoWidth / videoHeight;
860
+
861
+    var availableWidth = Math.max(videoWidth, videoSpaceWidth);
862
+    var availableHeight = Math.max(videoHeight, videoSpaceHeight);
863
+
864
+    if (availableWidth / aspectRatio < videoSpaceHeight) {
865
+        availableHeight = videoSpaceHeight;
866
+        availableWidth = availableHeight*aspectRatio;
907
     }
867
     }
908
-    if (availableWidth < 0 || availableHeight < 0) return;
909
-    $('#largeVideo').parent().width(availableWidth);
910
-    $('#largeVideo').parent().height(availableWidth / aspectRatio);
911
 
868
 
912
-    if ($('#presentation>iframe')) {
913
-        $('#presentation>iframe').width(availableWidth);
914
-        $('#presentation>iframe').height(availableWidth / aspectRatio);
869
+    if (availableHeight*aspectRatio < videoSpaceWidth) {
870
+        availableWidth = videoSpaceWidth;
871
+        availableHeight = availableWidth / aspectRatio;
915
     }
872
     }
916
 
873
 
917
-    if ($('#etherpad>iframe')) {
918
-        $('#etherpad>iframe').width(availableWidth);
919
-        $('#etherpad>iframe').height(availableWidth / aspectRatio);
920
-    }
874
+    return [availableWidth, availableHeight];
875
+};
876
+
877
+/**
878
+ * Sets the size and position of the given video element.
879
+ *
880
+ * @param video the video element to position
881
+ * @param width the desired video width
882
+ * @param height the desired video height
883
+ * @param horizontalIndent the left and right indent
884
+ * @param verticalIndent the top and bottom indent
885
+ */
886
+function positionVideo( video,
887
+                        width,
888
+                        height,
889
+                        horizontalIndent,
890
+                        verticalIndent) {
891
+    video.width(width);
892
+    video.height(height);
893
+    video.css({  top: verticalIndent + 'px',
894
+                 bottom: verticalIndent + 'px',
895
+                 left: horizontalIndent + 'px',
896
+                 right: horizontalIndent + 'px'});
897
+}
898
+
899
+var resizeLargeVideoContainer = function () {
900
+    Chat.resizeChat();
901
+    var availableHeight = window.innerHeight;
902
+    var availableWidth = Util.getAvailableVideoWidth();
903
+
904
+    if (availableWidth < 0 || availableHeight < 0) return;
905
+
906
+    $('#videospace').width(availableWidth);
907
+    $('#videospace').height(availableHeight);
908
+    $('#largeVideoContainer').width(availableWidth);
909
+    $('#largeVideoContainer').height(availableHeight);
921
 
910
 
922
     resizeThumbnails();
911
     resizeThumbnails();
923
 };
912
 };
924
 
913
 
925
 function resizeThumbnails() {
914
 function resizeThumbnails() {
926
-    // Calculate the available height, which is the inner window height minus 39px for the header
927
-    // minus 2px for the delimiter lines on the top and bottom of the large video,
928
-    // minus the 36px space inside the remoteVideos container used for highlighting shadow.
929
-    var availableHeight = window.innerHeight - $('#largeVideo').height() - 59;
915
+    // Calculate the available height, which is the inner window height minus
916
+    // 39px for the header minus 2px for the delimiter lines on the top and
917
+    // bottom of the large video, minus the 36px space inside the remoteVideos
918
+    // container used for highlighting shadow.
919
+    var availableHeight = 100;
920
+
930
     var numvids = $('#remoteVideos>span:visible').length;
921
     var numvids = $('#remoteVideos>span:visible').length;
931
 
922
 
932
     // Remove the 1px borders arround videos and the chat width.
923
     // Remove the 1px borders arround videos and the chat width.
951
     // Set the defaults for prompt dialogs.
942
     // Set the defaults for prompt dialogs.
952
     jQuery.prompt.setDefaults({persistent: false});
943
     jQuery.prompt.setDefaults({persistent: false});
953
 
944
 
954
-    resizeLarge();
945
+    resizeLargeVideoContainer();
955
     $(window).resize(function () {
946
     $(window).resize(function () {
956
-        resizeLarge();
947
+        resizeLargeVideoContainer();
948
+        positionLarge();
957
     });
949
     });
958
     if (!$('#settings').is(':visible')) {
950
     if (!$('#settings').is(':visible')) {
959
         console.log('init');
951
         console.log('init');
1035
     return false;
1027
     return false;
1036
 }
1028
 }
1037
 
1029
 
1038
-/*
1030
+/**
1039
  * Changes the style class of the element given by id.
1031
  * Changes the style class of the element given by id.
1040
  */
1032
  */
1041
 function buttonClick(id, classname) {
1033
 function buttonClick(id, classname) {
1042
     $(id).toggleClass(classname); // add the class to the clicked element
1034
     $(id).toggleClass(classname); // add the class to the clicked element
1043
 }
1035
 }
1044
 
1036
 
1045
-/*
1037
+/**
1046
  * Opens the lock room dialog.
1038
  * Opens the lock room dialog.
1047
  */
1039
  */
1048
 function openLockDialog() {
1040
 function openLockDialog() {
1103
     }
1095
     }
1104
 }
1096
 }
1105
 
1097
 
1106
-/*
1098
+/**
1107
  * Opens the invite link dialog.
1099
  * Opens the invite link dialog.
1108
  */
1100
  */
1109
 function openLinkDialog() {
1101
 function openLinkDialog() {
1119
              });
1111
              });
1120
 }
1112
 }
1121
 
1113
 
1122
-/*
1114
+/**
1123
  * Opens the settings dialog.
1115
  * Opens the settings dialog.
1124
  */
1116
  */
1125
 function openSettingsDialog() {
1117
 function openSettingsDialog() {
1160
              });
1152
              });
1161
 }
1153
 }
1162
 
1154
 
1163
-/*
1164
- * Opens the Prezi dialog, from which the user could choose a presentation to load.
1165
- */
1166
-function openPreziDialog() {
1167
-    var myprezi = connection.emuc.getPrezi(connection.emuc.myroomjid);
1168
-    if (myprezi) {
1169
-        $.prompt("Are you sure you would like to remove your Prezi?",
1170
-                {
1171
-                title: "Remove Prezi",
1172
-                buttons: { "Remove": true, "Cancel": false},
1173
-                defaultButton: 1,
1174
-                submit: function(e,v,m,f){
1175
-                if(v)
1176
-                {
1177
-                    connection.emuc.removePreziFromPresence();
1178
-                    connection.emuc.sendPresence();
1179
-                }
1180
-            }
1181
-        });
1182
-    }
1183
-    else if (preziPlayer !== null) {
1184
-        $.prompt("Another participant is already sharing a Prezi." +
1185
-                "This conference allows only one Prezi at a time.",
1186
-                 {
1187
-                 title: "Share a Prezi",
1188
-                 buttons: { "Ok": true},
1189
-                 defaultButton: 0,
1190
-                 submit: function(e,v,m,f){
1191
-                    $.prompt.close();
1192
-                 }
1193
-                 });
1194
-    }
1195
-    else {
1196
-        var openPreziState = {
1197
-        state0: {
1198
-            html:   '<h2>Share a Prezi</h2>' +
1199
-                    '<input id="preziUrl" type="text" placeholder="e.g. http://prezi.com/wz7vhjycl7e6/my-prezi" autofocus>',
1200
-            persistent: false,
1201
-            buttons: { "Share": true , "Cancel": false},
1202
-            defaultButton: 1,
1203
-            submit: function(e,v,m,f){
1204
-                e.preventDefault();
1205
-                if(v)
1206
-                {
1207
-                    var preziUrl = document.getElementById('preziUrl');
1208
-
1209
-                    if (preziUrl.value)
1210
-                    {
1211
-                        var urlValue
1212
-                            = encodeURI(Util.escapeHtml(preziUrl.value));
1213
-
1214
-                        if (urlValue.indexOf('http://prezi.com/') !== 0
1215
-                            && urlValue.indexOf('https://prezi.com/') !== 0)
1216
-                        {
1217
-                            $.prompt.goToState('state1');
1218
-                            return false;
1219
-                        }
1220
-                        else {
1221
-                            var presIdTmp = urlValue.substring(urlValue.indexOf("prezi.com/") + 10);
1222
-                            if (!Util.isAlphanumeric(presIdTmp)
1223
-                                    || presIdTmp.indexOf('/') < 2) {
1224
-                                $.prompt.goToState('state1');
1225
-                                return false;
1226
-                            }
1227
-                            else {
1228
-                                connection.emuc.addPreziToPresence(urlValue, 0);
1229
-                                connection.emuc.sendPresence();
1230
-                                $.prompt.close();
1231
-                            }
1232
-                        }
1233
-                    }
1234
-                }
1235
-                else
1236
-                    $.prompt.close();
1237
-            }
1238
-        },
1239
-        state1: {
1240
-            html:   '<h2>Share a Prezi</h2>' +
1241
-                    'Please provide a correct prezi link.',
1242
-            persistent: false,
1243
-            buttons: { "Back": true, "Cancel": false },
1244
-            defaultButton: 1,
1245
-            submit:function(e,v,m,f) {
1246
-                e.preventDefault();
1247
-                if (v === 0)
1248
-                    $.prompt.close();
1249
-                else
1250
-                    $.prompt.goToState('state0');
1251
-            }
1252
-        }
1253
-        };
1254
-
1255
-        var myPrompt = jQuery.prompt(openPreziState);
1256
-
1257
-        myPrompt.on('impromptu:loaded', function(e) {
1258
-                    document.getElementById('preziUrl').focus();
1259
-                    });
1260
-        myPrompt.on('impromptu:statechanged', function(e) {
1261
-                    document.getElementById('preziUrl').focus();
1262
-                    });
1263
-    }
1264
-}
1265
-
1266
-/*
1155
+/**
1267
  * Locks / unlocks the room.
1156
  * Locks / unlocks the room.
1268
  */
1157
  */
1269
 function lockRoom(lock) {
1158
 function lockRoom(lock) {
1275
     updateLockButton();
1164
     updateLockButton();
1276
 }
1165
 }
1277
 
1166
 
1278
-/*
1167
+/**
1279
  * Sets the shared key.
1168
  * Sets the shared key.
1280
  */
1169
  */
1281
 function setSharedKey(sKey) {
1170
 function setSharedKey(sKey) {
1282
     sharedKey = sKey;
1171
     sharedKey = sKey;
1283
 }
1172
 }
1284
 
1173
 
1285
-/*
1174
+/**
1286
  * Updates the lock button state.
1175
  * Updates the lock button state.
1287
  */
1176
  */
1288
 function updateLockButton() {
1177
 function updateLockButton() {
1289
-    buttonClick("#lockIcon", "fa fa-unlock fa-lg fa fa-lock fa-lg");
1178
+    buttonClick("#lockIcon", "icon-security icon-security-locked");
1290
 }
1179
 }
1291
 
1180
 
1292
-/*
1181
+/**
1182
+ * Hides the toolbar.
1183
+ */
1184
+var hideToolbar = function() {
1185
+
1186
+    var isToolbarHover = false;
1187
+    $('#header').find('*').each(function(){
1188
+        var id = $(this).attr('id');
1189
+        if ($("#" + id + ":hover").length > 0) {
1190
+            isToolbarHover = true;
1191
+        }
1192
+    });
1193
+
1194
+    clearTimeout(toolbarTimeout);
1195
+    toolbarTimeout = null;
1196
+
1197
+    if (!isToolbarHover) {
1198
+        $('#header').hide("slide", { direction: "up", duration: 300});
1199
+    }
1200
+    else {
1201
+        toolbarTimeout = setTimeout(hideToolbar, 2000);
1202
+    }
1203
+};
1204
+
1205
+/**
1293
  * Shows the call main toolbar.
1206
  * Shows the call main toolbar.
1294
  */
1207
  */
1295
 function showToolbar() {
1208
 function showToolbar() {
1296
-    $('#toolbar').css({visibility:"visible"});
1297
-    if (focus !== null)
1209
+    if (!$('#header').is(':visible')) {
1210
+        $('#header').show("slide", { direction: "up", duration: 300});
1211
+
1212
+        if (toolbarTimeout) {
1213
+            clearTimeout(toolbarTimeout);
1214
+            toolbarTimeout = null;
1215
+        }
1216
+        toolbarTimeout = setTimeout(hideToolbar, 2000);
1217
+    }
1218
+
1219
+    if (focus != null)
1298
     {
1220
     {
1299
 //        TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
1221
 //        TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
1300
 //        $('#settingsButton').css({visibility:"visible"});
1222
 //        $('#settingsButton').css({visibility:"visible"});
1303
     setDesktopSharing(config.desktopSharing);
1225
     setDesktopSharing(config.desktopSharing);
1304
 }
1226
 }
1305
 
1227
 
1306
-/*
1228
+/**
1229
+ * Docks/undocks the toolbar.
1230
+ *
1231
+ * @param isDock indicates what operation to perform
1232
+ */
1233
+function dockToolbar(isDock) {
1234
+    if (isDock) {
1235
+        // First make sure the toolbar is shown.
1236
+        if (!$('#header').is(':visible')) {
1237
+            showToolbar();
1238
+        }
1239
+        // Then clear the time out, to dock the toolbar.
1240
+        clearTimeout(toolbarTimeout);
1241
+        toolbarTimeout = null;
1242
+    }
1243
+    else {
1244
+        if (!$('#header').is(':visible')) {
1245
+            showToolbar();
1246
+        }
1247
+        else {
1248
+            toolbarTimeout = setTimeout(hideToolbar, 2000);
1249
+        }
1250
+    }
1251
+}
1252
+
1253
+/**
1307
  * Updates the room invite url.
1254
  * Updates the room invite url.
1308
  */
1255
  */
1309
 function updateRoomUrl(newRoomUrl) {
1256
 function updateRoomUrl(newRoomUrl) {
1310
     roomUrl = newRoomUrl;
1257
     roomUrl = newRoomUrl;
1311
 }
1258
 }
1312
 
1259
 
1313
-/*
1260
+/**
1314
  * Warning to the user that the conference window is about to be closed.
1261
  * Warning to the user that the conference window is about to be closed.
1315
  */
1262
  */
1316
 function closePageWarning() {
1263
 function closePageWarning() {
1320
         return "You are about to leave this conversation.";
1267
         return "You are about to leave this conversation.";
1321
 }
1268
 }
1322
 
1269
 
1323
-/*
1270
+/**
1324
  * Shows a visual indicator for the focus of the conference.
1271
  * Shows a visual indicator for the focus of the conference.
1325
  * Currently if we're not the owner of the conference we obtain the focus
1272
  * Currently if we're not the owner of the conference we obtain the focus
1326
  * from the connection.jingle.sessions.
1273
  * from the connection.jingle.sessions.
1385
 
1332
 
1386
         //Enter Full Screen
1333
         //Enter Full Screen
1387
         if (fsElement.mozRequestFullScreen) {
1334
         if (fsElement.mozRequestFullScreen) {
1388
-
1389
             fsElement.mozRequestFullScreen();
1335
             fsElement.mozRequestFullScreen();
1390
         }
1336
         }
1391
         else {
1337
         else {
1392
             fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
1338
             fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
1393
         }
1339
         }
1394
-
1395
     } else {
1340
     } else {
1396
-
1397
         //Exit Full Screen
1341
         //Exit Full Screen
1398
         if (document.mozCancelFullScreen) {
1342
         if (document.mozCancelFullScreen) {
1399
             document.mozCancelFullScreen();
1343
             document.mozCancelFullScreen();
1400
         } else {
1344
         } else {
1401
             document.webkitCancelFullScreen();
1345
             document.webkitCancelFullScreen();
1402
-            document.webkitCancelFullScreen();
1403
         }
1346
         }
1404
     }
1347
     }
1405
 }
1348
 }
1493
     }
1436
     }
1494
 }
1437
 }
1495
 
1438
 
1439
+/**
1440
+ * Creates the edit display name button.
1441
+ * 
1442
+ * @returns the edit button
1443
+ */
1496
 function createEditDisplayNameButton() {
1444
 function createEditDisplayNameButton() {
1497
     var editButton = document.createElement('a');
1445
     var editButton = document.createElement('a');
1498
     editButton.className = 'displayname';
1446
     editButton.className = 'displayname';
1500
 
1448
 
1501
     return editButton;
1449
     return editButton;
1502
 }
1450
 }
1451
+
1452
+/**
1453
+ * Resizes and repositions videos in full screen mode.
1454
+ */
1455
+$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange',
1456
+        function() {
1457
+            resizeLargeVideoContainer();
1458
+            positionLarge();
1459
+            isFullScreen = document.fullScreen
1460
+                                || document.mozFullScreen
1461
+                                || document.webkitIsFullScreen;
1462
+
1463
+            if (isFullScreen) {
1464
+                setView("fullscreen");
1465
+            }
1466
+            else {
1467
+                setView("default");
1468
+            }
1469
+});
1470
+
1471
+/**
1472
+ * Sets the current view.
1473
+ */
1474
+function setView(viewName) {
1475
+//    if (viewName == "fullscreen") {
1476
+//        document.getElementById('videolayout_fullscreen').disabled  = false;
1477
+//        document.getElementById('videolayout_default').disabled  = true;
1478
+//    }
1479
+//    else {
1480
+//        document.getElementById('videolayout_default').disabled  = false;
1481
+//        document.getElementById('videolayout_fullscreen').disabled  = true;
1482
+//    }
1483
+}

+ 92
- 25
chat.js View File

96
         var chatspace = $('#chatspace');
96
         var chatspace = $('#chatspace');
97
         var videospace = $('#videospace');
97
         var videospace = $('#videospace');
98
 
98
 
99
-        var onShow = function () {
100
-            resizeLarge();
101
-            $('#chatspace').show("slide", { direction: "right", duration: 500});
102
-        };
103
-        var onHide = function () {
104
-            $('#chatspace').hide("slide", { direction: "right", duration: 500});
105
-            resizeLarge();
106
-        };
99
+        var chatSize = (chatspace.is(":visible")) ? [0, 0] : Chat.getChatSize();
100
+        var videospaceWidth = window.innerWidth - chatSize[0];
101
+        var videospaceHeight = window.innerHeight;
102
+        var videoSize
103
+            = getVideoSize(null, null, videospaceWidth, videospaceHeight);
104
+        var videoWidth = videoSize[0];
105
+        var videoHeight = videoSize[1];
106
+        var videoPosition = getVideoPosition(   videoWidth,
107
+                                                videoHeight,
108
+                                                videospaceWidth,
109
+                                                videospaceHeight);
110
+        var horizontalIndent = videoPosition[0];
111
+        var verticalIndent = videoPosition[1];
107
 
112
 
108
         if (chatspace.is(":visible")) {
113
         if (chatspace.is(":visible")) {
109
-            videospace.animate( {right: 0},
114
+            videospace.animate( {right: chatSize[0],
115
+                                width: videospaceWidth,
116
+                                height: videospaceHeight},
110
                                 {queue: false,
117
                                 {queue: false,
111
-                                duration: 500,
112
-                                progress: onHide});
118
+                                duration: 500});
119
+
120
+            $('#largeVideoContainer').animate({ width: videospaceWidth,
121
+                                                height: videospaceHeight},
122
+                                                {queue: false,
123
+                                                 duration: 500
124
+                                                });
125
+
126
+            $('#largeVideo').animate({  width: videoWidth,
127
+                                        height: videoHeight,
128
+                                        top: verticalIndent,
129
+                                        bottom: verticalIndent,
130
+                                        left: horizontalIndent,
131
+                                        right: horizontalIndent},
132
+                                        {   queue: false,
133
+                                            duration: 500
134
+                                        });
135
+
136
+            $('#chatspace').hide("slide", { direction: "right",
137
+                                            queue: false,
138
+                                            duration: 500});
113
         }
139
         }
114
         else {
140
         else {
115
-            videospace.animate({right: chatspace.width()},
141
+            videospace.animate({right: chatSize[0],
142
+                                width: videospaceWidth,
143
+                                height: videospaceHeight},
116
                                {queue: false,
144
                                {queue: false,
117
                                 duration: 500,
145
                                 duration: 500,
118
-                                progress: onShow,
119
                                 complete: function() {
146
                                 complete: function() {
120
                                     scrollChatToBottom();
147
                                     scrollChatToBottom();
121
                                     chatspace.trigger('shown');
148
                                     chatspace.trigger('shown');
122
                                 }
149
                                 }
123
                                });
150
                                });
151
+
152
+            $('#largeVideoContainer').animate({ width: videospaceWidth,
153
+                                                height: videospaceHeight},
154
+                                                {queue: false,
155
+                                                 duration: 500
156
+                                                });
157
+
158
+            $('#largeVideo').animate({  width: videoWidth,
159
+                                        height: videoHeight,
160
+                                        top: verticalIndent,
161
+                                        bottom: verticalIndent,
162
+                                        left: horizontalIndent,
163
+                                        right: horizontalIndent},
164
+                                        {queue: false,
165
+                                         duration: 500
166
+                                        });
167
+
168
+            $('#chatspace').show("slide", { direction: "right",
169
+                                            queue: false,
170
+                                            duration: 500});
124
         }
171
         }
125
 
172
 
126
         // Request the focus in the nickname field or the chat input field.
173
         // Request the focus in the nickname field or the chat input field.
147
      * Resizes the chat area.
194
      * Resizes the chat area.
148
      */
195
      */
149
     my.resizeChat = function () {
196
     my.resizeChat = function () {
197
+        var chatSize = Chat.getChatSize();
198
+
199
+        $('#chatspace').width(chatSize[0]);
200
+        $('#chatspace').height(chatSize[1]);
201
+
202
+        resizeChatConversation();
203
+    };
204
+
205
+    /**
206
+     * Returns the size of the chat.
207
+     */
208
+    my.getChatSize = function() {
150
         var availableHeight = window.innerHeight;
209
         var availableHeight = window.innerHeight;
151
         var availableWidth = window.innerWidth;
210
         var availableWidth = window.innerWidth;
152
 
211
 
154
         if (availableWidth*0.2 < 200)
213
         if (availableWidth*0.2 < 200)
155
             chatWidth = availableWidth*0.2;
214
             chatWidth = availableWidth*0.2;
156
 
215
 
157
-        $('#chatspace').width(chatWidth);
158
-        $('#chatspace').height(availableHeight - 40);
159
-
160
-        resizeChatConversation();
216
+        return [chatWidth, availableHeight];
161
     };
217
     };
162
 
218
 
163
     /**
219
     /**
168
         var usermsgHeight = usermsgStyleHeight
224
         var usermsgHeight = usermsgStyleHeight
169
             .substring(0, usermsgStyleHeight.indexOf('px'));
225
             .substring(0, usermsgStyleHeight.indexOf('px'));
170
 
226
 
227
+        $('#usermsg').width($('#chatspace').width() - 10);
171
         $('#chatconversation').width($('#chatspace').width() - 10);
228
         $('#chatconversation').width($('#chatspace').width() - 10);
172
         $('#chatconversation')
229
         $('#chatconversation')
173
-            .height(window.innerHeight - 50 - parseInt(usermsgHeight));
174
-    }
230
+            .height(window.innerHeight - 10 - parseInt(usermsgHeight));
231
+    };
175
 
232
 
176
     /**
233
     /**
177
      * Shows/hides a visual notification, indicating that a message has arrived.
234
      * Shows/hides a visual notification, indicating that a message has arrived.
179
     function setVisualNotification(show) {
236
     function setVisualNotification(show) {
180
         var unreadMsgElement = document.getElementById('unreadMessages');
237
         var unreadMsgElement = document.getElementById('unreadMessages');
181
 
238
 
239
+        var glower = $('#chatButton');
240
+
182
         if (unreadMessages) {
241
         if (unreadMessages) {
183
             unreadMsgElement.innerHTML = unreadMessages.toString();
242
             unreadMsgElement.innerHTML = unreadMessages.toString();
184
 
243
 
244
+            showToolbar();
245
+
185
             var chatButtonElement
246
             var chatButtonElement
186
-                = document.getElementById('chat').parentNode;
247
+                = document.getElementById('chatButton').parentNode;
187
             var leftIndent = (Util.getTextWidth(chatButtonElement)
248
             var leftIndent = (Util.getTextWidth(chatButtonElement)
188
-                                - Util.getTextWidth(unreadMsgElement) - 5)/2;
249
+                                - Util.getTextWidth(unreadMsgElement))/2;
189
             var topIndent = (Util.getTextHeight(chatButtonElement)
250
             var topIndent = (Util.getTextHeight(chatButtonElement)
190
-                                - Util.getTextHeight(unreadMsgElement))/2 - 2;
251
+                                - Util.getTextHeight(unreadMsgElement))/2 - 3;
191
 
252
 
192
             unreadMsgElement.setAttribute(
253
             unreadMsgElement.setAttribute(
193
                     'style',
254
                     'style',
194
                     'top:' + topIndent
255
                     'top:' + topIndent
195
                      + '; left:' + leftIndent +';');
256
                      + '; left:' + leftIndent +';');
257
+
258
+            if (!glower.hasClass('icon-chat-simple')) {
259
+                glower.removeClass('icon-chat');
260
+                glower.addClass('icon-chat-simple');
261
+            }
196
         }
262
         }
197
-        else
263
+        else {
198
             unreadMsgElement.innerHTML = '';
264
             unreadMsgElement.innerHTML = '';
199
-
200
-        var glower = $('#chat');
265
+            glower.removeClass('icon-chat-simple');
266
+            glower.addClass('icon-chat');
267
+        }
201
 
268
 
202
         if (show && !notificationInterval) {
269
         if (show && !notificationInterval) {
203
             notificationInterval = window.setInterval(function() {
270
             notificationInterval = window.setInterval(function() {

+ 71
- 0
css/font.css View File

1
+@font-face {
2
+    font-family: 'jitsi';
3
+    src:url('../fonts/jitsi.eot?94d075');
4
+    src:url('../fonts/jitsi.eot?#iefix94d075') format('embedded-opentype'),
5
+        url('../fonts/jitsi.woff?94d075') format('woff'),
6
+        url('../fonts/jitsi.ttf?94d075') format('truetype'),
7
+        url('../fonts/jitsi.svg?94d075#jitsi') format('svg');
8
+    font-weight: normal;
9
+    font-style: normal;
10
+}
11
+
12
+[class^="icon-"], [class*=" icon-"] {
13
+    font-family: 'jitsi';
14
+    speak: none;
15
+    font-style: normal;
16
+    font-weight: normal;
17
+    font-variant: normal;
18
+    text-transform: none;
19
+    line-height: 0.75em;
20
+    font-size: 1.22em;
21
+
22
+    /* Better Font Rendering =========== */
23
+    -webkit-font-smoothing: antialiased;
24
+    -moz-osx-font-smoothing: grayscale;
25
+}
26
+
27
+.icon-share-desktop:before {
28
+	content: "\e602";
29
+}
30
+.icon-chat-simple:before {
31
+	content: "\e606";
32
+}
33
+.icon-full-screen:before {
34
+	content: "\e60d";
35
+}
36
+.icon-exit-full-screen:before {
37
+	content: "\e60e";
38
+}
39
+.icon-prezi:before {
40
+	content: "\e60c";
41
+}
42
+.icon-link:before {
43
+	content: "\e600";
44
+}
45
+.icon-chat:before {
46
+	content: "\e601";
47
+}
48
+.icon-presentation:before {
49
+	content: "\e603";
50
+}
51
+.icon-security:before {
52
+	content: "\e604";
53
+}
54
+.icon-share-doc:before {
55
+	content: "\e605";
56
+}
57
+.icon-security-locked:before {
58
+	content: "\e607";
59
+}
60
+.icon-camera:before {
61
+	content: "\e608";
62
+}
63
+.icon-camera-disabled:before {
64
+	content: "\e609";
65
+}
66
+.icon-mic-disabled:before {
67
+	content: "\e60a";
68
+}
69
+.icon-microphone:before {
70
+	content: "\e60b";
71
+}

+ 11
- 239
css/main.css View File

4
     color: #424242;
4
     color: #424242;
5
     font-family:'Helvetica Neue', Helvetica, sans-serif;
5
     font-family:'Helvetica Neue', Helvetica, sans-serif;
6
     font-weight: 400;
6
     font-weight: 400;
7
-    background: #e9e9e9;
7
+    background: #000000;
8
     overflow-x: hidden;
8
     overflow-x: hidden;
9
 }
9
 }
10
 
10
 
11
-#videospace {
12
-    display: block;
13
-    position: absolute;
14
-    top: 39px;
15
-    left: 0px;
16
-    right: 0px;
17
-    float: left;
18
-}
19
-
20
-.videocontainer {
21
-    position: relative;
22
-    margin-left: auto;
23
-    margin-right: auto;
24
-}
25
-#presentation, #etherpad, .videocontainer>video {
26
-    position: absolute;
27
-    left: 0px;
28
-    top: 0px;
29
-    z-index: 1;
30
-    width: 100%;
31
-    height: 100%;
32
-}
33
-
34
-#etherpad {
35
-    z-index: 0;
36
-}
37
-
38
-#etherpadButton {
39
-    display: none;
40
-}
41
-
42
-.videocontainer>span {
43
-    display: none; /* enable when you want nicks to be shown */
44
-    position: absolute;
45
-    left: 0px;
46
-    bottom: -20px;
47
-    z-index: 0;
48
-    width: 100%;
49
-    font-size: 10pt;
50
-}
51
-
52
-.flipVideoX {
53
-    -moz-transform: scaleX(-1);
54
-    -webkit-transform: scaleX(-1);
55
-    -o-transform: scaleX(-1);
56
-    transform: scaleX(-1);
57
-}
58
-
59
-#remoteVideos {
60
-    display:block;
61
-    position:relative;
62
-    text-align:center;
63
-    height:196px;
64
-    padding: 5px 0px;
65
-    width:auto;
66
-    overflow: hidden;
67
-    border:1px solid transparent;
68
-    z-index: 2;
69
-}
70
-
71
-#remoteVideos>span {
72
-    display: inline-block;
73
-    z-index:0;
74
-    border:1px solid #FFFFFF;
75
-    background-image:url(../images/avatar1.png);
76
-    background-size: contain;
77
-}
78
-
79
-#remoteVideos>span:hover {
80
-    cursor: pointer;
81
-    cursor: hand;
82
-    transform:scale(1.08, 1.08);
83
-    -webkit-transform:scale(1.08, 1.08);
84
-    transition-duration: 0.5s;
85
-    -webkit-transition-duration: 0.5s;
86
-    background-color: #FFFFFF;
87
-    -webkit-animation-name: greyPulse;
88
-    -webkit-animation-duration: 2s;
89
-    -webkit-animation-iteration-count: 1;
90
-    -webkit-box-shadow: 0 0 18px #515151;
91
-    border:1px solid #FFFFFF;
92
-    z-index: 10;
93
-}
94
-
95
 #chatspace {
11
 #chatspace {
96
     display:none;
12
     display:none;
97
     position:absolute;
13
     position:absolute;
98
     float: right;
14
     float: right;
99
-    top: 40px;
15
+    top: 0px;
100
     bottom: 0px;
16
     bottom: 0px;
101
     right: 0px;
17
     right: 0px;
102
     width: 20%;
18
     width: 20%;
105
     /* background-color:#dfebf1;*/
21
     /* background-color:#dfebf1;*/
106
     background-color:#FFFFFF;
22
     background-color:#FFFFFF;
107
     border-left:1px solid #424242;
23
     border-left:1px solid #424242;
24
+    z-index: 5;
108
 }
25
 }
109
 
26
 
110
 #chatconversation {
27
 #chatconversation {
28
+    visibility: hidden;
111
     position: relative;
29
     position: relative;
112
     top: 5px;
30
     top: 5px;
113
     padding: 5px;
31
     padding: 5px;
119
     overflow-y: scroll;
37
     overflow-y: scroll;
120
     overflow-x: hidden;
38
     overflow-x: hidden;
121
     word-wrap: break-word;
39
     word-wrap: break-word;
122
-    visibility: hidden;
123
 }
40
 }
124
 
41
 
125
 .localuser {
42
 .localuser {
131
 }
48
 }
132
 
49
 
133
 #usermsg {
50
 #usermsg {
51
+    visibility:hidden;
134
     position: relative;
52
     position: relative;
135
     width: 100%;
53
     width: 100%;
136
     height: 5%;
54
     height: 5%;
137
     padding: 5px;
55
     padding: 5px;
138
-    z-index: 5;
139
     max-height:150px;
56
     max-height:150px;
140
     min-height:50px;
57
     min-height:50px;
141
-    visibility:hidden;
142
     border: 0px none;
58
     border: 0px none;
143
     border-top: 1px solid #cccccc;
59
     border-top: 1px solid #cccccc;
144
     background: #FFFFFF;
60
     background: #FFFFFF;
145
     box-shadow: none;
61
     box-shadow: none;
146
     border-radius:0;
62
     border-radius:0;
147
     font-size: 10pt;
63
     font-size: 10pt;
64
+    overflow: hidden;
148
 }
65
 }
149
 
66
 
150
 #usermsg: hover {
67
 #usermsg: hover {
169
     font-size: 14;
86
     font-size: 14;
170
 }
87
 }
171
 
88
 
172
-#spacer {
173
-    height:5px;
174
-}
175
-
176
 #settings {
89
 #settings {
177
     display:none;
90
     display:none;
178
 }
91
 }
181
     display:none;
94
     display:none;
182
 }
95
 }
183
 
96
 
184
-#header{
185
-    display:block;
186
-    height:39px;
187
-    text-align:center;
188
-    background-color: #2591e5;
189
-}
190
-
191
-#left {
192
-    display:block;
193
-    position: absolute;
194
-    left: 0px;
195
-    top: 0px;
196
-    width: 100px;
197
-    height: 39px;
198
-    background-image:url(../images/left1.png);
199
-    background-repeat:no-repeat;
200
-    margin: 0;
201
-    padding: 0;
202
-}
203
-
204
-#leftlogo {
205
-    position:absolute;
206
-    top: 5px;
207
-    left: 15px;
208
-    background-image:url(../images/jitsilogo.png);
209
-    background-repeat:no-repeat;
210
-    height: 31px;
211
-    width: 68px;
212
-    z-index:1;
213
-}
214
-
215
-#toolbar {
216
-    display:block;
217
-    position:relative;
218
-    height:39px;
219
-    width:auto;
220
-    overflow: hidden;
221
-    z-index:0;
222
-    visibility: hidden;
223
-}
224
-
225
 #settingsButton {
97
 #settingsButton {
226
     visibility: hidden;
98
     visibility: hidden;
227
 }
99
 }
254
     cursor: pointer;
126
     cursor: pointer;
255
 }
127
 }
256
 
128
 
257
-#chat {
258
-    font-size:1.65em;
129
+#chatButton {
259
     -webkit-transition: all .5s ease-in-out;;
130
     -webkit-transition: all .5s ease-in-out;;
260
        -moz-transition: all .5s ease-in-out;;
131
        -moz-transition: all .5s ease-in-out;;
261
             transition: all .5s ease-in-out;;
132
             transition: all .5s ease-in-out;;
262
 }
133
 }
263
 
134
 
264
-#chat.active {
135
+#chatButton.active {
265
     -webkit-text-shadow: 0 0 10px #ffffff;
136
     -webkit-text-shadow: 0 0 10px #ffffff;
266
     -moz-text-shadow: 0 0 10px #ffffff;
137
     -moz-text-shadow: 0 0 10px #ffffff;
267
     text-shadow: 0 0 10px #ffffff;
138
     text-shadow: 0 0 10px #ffffff;
268
-    /* -webkit-transform: scale(1.1); */
269
 }
139
 }
270
 
140
 
271
 a.button:hover {
141
 a.button:hover {
282
     color: #636363;
152
     color: #636363;
283
 }
153
 }
284
 
154
 
285
-.fade_line {
286
-    height: 1px;
287
-    background: black;
288
-    background: -webkit-gradient(linear, 0 0, 100% 0, from(#e9e9e9), to(#e9e9e9), color-stop(50%, black));
289
-}
290
-
291
 .header_button_separator {
155
 .header_button_separator {
292
     display: inline-block;
156
     display: inline-block;
293
     position:relative;
157
     position:relative;
294
-    top: 7;
158
+    top: 5;
295
     width: 1px;
159
     width: 1px;
296
-    height: 25px;
297
-    background: white;
298
-    background: -webkit-gradient(linear, 0 0, 0 100%, from(#087dba), to(#087dba), color-stop(50%, white));
299
-}
300
-
301
-#right {
302
-    display:block;
303
-    position:absolute;
304
-    right: 0px;
305
-    top: 0px;
306
-    background-image:url(../images/right1.png);
307
-    background-repeat:no-repeat;
308
-    margin:0;
309
-    padding:0;
310
-    width:100px;
311
-    height:39px;
312
-}
313
-
314
-#rightlogo {
315
-    position:absolute;
316
-    top: 6px;
317
-    right: 15px;
318
-    background-image:url(../images/estoslogo.png);
319
-    background-repeat:no-repeat;
320
-    height: 25px;
321
-    width: 62px;
322
-    z-index:1;
160
+    height: 20px;
161
+    background: #676767;
323
 }
162
 }
324
 
163
 
325
 input[type='text'], textarea {
164
 input[type='text'], textarea {
387
     overflow: visible;
226
     overflow: visible;
388
     z-index: 100;
227
     z-index: 100;
389
 }
228
 }
390
-
391
-.videocontainer>span.focusindicator {
392
-    display: inline-block;
393
-    position: absolute;
394
-    color: #FFFFFF;
395
-    top: 0;
396
-    padding: 5px 0px;
397
-    width: 25px;
398
-    font-size: 11pt;
399
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
400
-    border: 0px;
401
-    z-index: 2;
402
-}
403
-
404
-.videocontainer>span.displayname,
405
-.videocontainer>input.displayname {
406
-    display: inline-block;
407
-    position: absolute;
408
-    background: -webkit-linear-gradient(left, rgba(0,0,0,.7), rgba(0,0,0,0));
409
-    color: #b7b7b7;
410
-    bottom: 0;
411
-    left: 0;
412
-    padding: 3px 5px;
413
-    width: 100%;
414
-    height: auto;
415
-    max-height: 18px;
416
-    font-size: 9pt;
417
-    text-align: left;
418
-    text-overflow: ellipsis;
419
-    overflow: hidden;
420
-    white-space: nowrap;
421
-    z-index: 2;
422
-    box-sizing: border-box;
423
-}
424
-
425
-#localVideoContainer>span.displayname:hover {
426
-    cursor: text;
427
-}
428
-
429
-.videocontainer>a.displayname {
430
-    display: inline-block;
431
-    position: absolute;
432
-    color: #b7b7b7;
433
-    bottom: 0;
434
-    right: 0;
435
-    padding: 3px 5px;
436
-    font-size: 9pt;
437
-    cursor: pointer;
438
-    z-index: 2;
439
-}
440
-
441
-#reloadPresentation {
442
-    display: none;
443
-    position: absolute;
444
-    color: #FFFFFF;
445
-    top: 0;
446
-    right: 0;
447
-    padding: 10px 10px;
448
-    font-size: 11pt;
449
-    cursor: pointer;
450
-    background: rgba(0, 0, 0, 0.3);
451
-    border-radius: 5px;
452
-    background-clip: padding-box;
453
-    -webkit-border-radius: 5px;
454
-    -webkit-background-clip: padding-box;
455
-    z-index: 3;
456
-}

+ 226
- 0
css/videolayout_default.css View File

1
+#videospace {
2
+    display: block;
3
+    position: absolute;
4
+    top: 0px;
5
+    left: 0px;
6
+    right: 0px;
7
+}
8
+
9
+#remoteVideos {
10
+    display:block;
11
+    position:absolute;
12
+    text-align:right;
13
+    height:196px;
14
+    padding: 18px;
15
+    bottom: 0;
16
+    left: 0;
17
+    right: 0;
18
+    width:auto;
19
+    overflow: hidden;
20
+    border:1px solid transparent;
21
+    z-index: 2;
22
+}
23
+
24
+.videocontainer {
25
+    position: relative;
26
+    margin-left: auto;
27
+    margin-right: auto;
28
+}
29
+
30
+#remoteVideos .videocontainer {
31
+    display: inline-block;
32
+    background-image:url(../images/avatar1.png);
33
+    background-size: contain;
34
+    border-radius:8px;
35
+    border: 2px solid #212425;
36
+}
37
+
38
+#remoteVideos .videocontainer:hover {
39
+    width: 100%;
40
+    height: 100%;
41
+    content:"";
42
+    cursor: pointer;
43
+    cursor: hand;
44
+    transform:scale(1.08, 1.08);
45
+    -webkit-transform:scale(1.08, 1.08);
46
+    transition-duration: 0.5s;
47
+    -webkit-transition-duration: 0.5s;
48
+    -webkit-animation-name: greyPulse;
49
+    -webkit-animation-duration: 2s;
50
+    -webkit-animation-iteration-count: 1;
51
+    -webkit-box-shadow: 0 0 18px #388396;
52
+    border: 2px solid #388396;
53
+    z-index: 3;
54
+}
55
+
56
+#localVideoWrapper {
57
+    display:inline-block;
58
+    -webkit-mask-box-image: url(http://emcho.com/db/videomask.svg);
59
+    border-radius:0px !important;
60
+    border: 0px !important;
61
+}
62
+
63
+#remoteVideos .videocontainer>video {
64
+    border-radius:6px;
65
+}
66
+
67
+.flipVideoX {
68
+    transform: scale(-1, 1);
69
+    -moz-transform: scale(-1, 1);
70
+    -webkit-transform: scale(-1, 1);
71
+    -o-transform: scale(-1, 1);
72
+}
73
+
74
+#localVideoWrapper>video {
75
+    border-radius:0px !important;
76
+}
77
+
78
+#largeVideo,
79
+#largeVideoContainer {
80
+    overflow: hidden;
81
+    text-align: center;
82
+}
83
+
84
+#presentation,
85
+#etherpad,
86
+#localVideoWrapper>video,
87
+#localVideoWrapper,
88
+.videocontainer>video {
89
+    position: absolute;
90
+    left: 0;
91
+    top: 0;
92
+    z-index: 1;
93
+    width: 100%;
94
+    height: 100%;
95
+}
96
+
97
+#etherpad,
98
+#presentation {
99
+    text-align: center;
100
+}
101
+
102
+#etherpad {
103
+    z-index: 0;
104
+}
105
+
106
+#etherpadButton {
107
+    display: none;
108
+}
109
+
110
+#remoteVideos .videocontainer>span.focusindicator {
111
+    display: inline-block;
112
+    position: absolute;
113
+    color: #FFFFFF;
114
+    top: 0;
115
+    left: 0;
116
+    padding: 5px 0px;
117
+    width: 25px;
118
+    font-size: 11pt;
119
+    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
120
+    border: 0px;
121
+    z-index: 2;
122
+}
123
+
124
+#remoteVideos .nick {
125
+    display: none; /* enable when you want nicks to be shown */
126
+    position: absolute;
127
+    left: 0px;
128
+    bottom: -20px;
129
+    z-index: 0;
130
+    width: 100%;
131
+    font-size: 10pt;
132
+}
133
+
134
+.videocontainer>span.displayname,
135
+.videocontainer>input.displayname {
136
+    display: inline-block;
137
+    position: absolute;
138
+    background: -webkit-linear-gradient(left, rgba(0,0,0,.7), rgba(0,0,0,0));
139
+    color: #FFFFFF;
140
+    bottom: 0;
141
+    left: 0;
142
+    padding: 3px 5px;
143
+    width: 100%;
144
+    height: auto;
145
+    max-height: 18px;
146
+    font-size: 9pt;
147
+    text-align: left;
148
+    text-overflow: ellipsis;
149
+    overflow: hidden;
150
+    white-space: nowrap;
151
+    z-index: 2;
152
+    box-sizing: border-box;
153
+    border-bottom-left-radius:6px;
154
+    border-bottom-right-radius:6px;
155
+}
156
+
157
+#localVideoContainer>span.displayname:hover {
158
+    cursor: text;
159
+}
160
+
161
+.videocontainer>a.displayname {
162
+    display: inline-block;
163
+    position: absolute;
164
+    color: #FFFFFF;
165
+    bottom: 0;
166
+    right: 0;
167
+    padding: 3px 5px;
168
+    font-size: 9pt;
169
+    cursor: pointer;
170
+    z-index: 2;
171
+}
172
+
173
+#reloadPresentation {
174
+    display: none;
175
+    position: absolute;
176
+    color: #FFFFFF;
177
+    top: 0;
178
+    right:0;
179
+    padding: 10px 10px;
180
+    font-size: 11pt;
181
+    cursor: pointer;
182
+    background: rgba(0, 0, 0, 0.3);
183
+    border-radius: 5px;
184
+    background-clip: padding-box;
185
+    -webkit-border-radius: 5px;
186
+    -webkit-background-clip: padding-box;
187
+    z-index: 20; /*The reload button should appear on top of the header!*/
188
+}
189
+
190
+#header{
191
+    display:none;
192
+    position:absolute;
193
+    height:39px;
194
+    text-align:center;
195
+    top:0;
196
+    left:0;
197
+    right:0;
198
+    z-index:10;
199
+}
200
+
201
+#toolbar {
202
+    display:inline-block;
203
+    position:relative;
204
+    margin-left:auto;
205
+    margin-right:auto;
206
+    height:39px;
207
+    width:auto;
208
+    overflow: hidden;
209
+    background: linear-gradient(to bottom, rgba(103,103,103,.65) , rgba(0,0,0,.65));
210
+    -webkit-box-shadow: 0 0 2px #000000, 0 0 10px #000000;
211
+    border-bottom-left-radius: 12px;
212
+    border-bottom-right-radius: 12px;
213
+}
214
+
215
+#watermark {
216
+    display: block;
217
+    position: absolute;
218
+    left: 15;
219
+    top: 15;
220
+    width: 20%;
221
+    height: 10%;
222
+    background-image:url(../images/watermark.png);
223
+    background-size: contain;
224
+    background-repeat: no-repeat;
225
+    z-index: 2;
226
+}

+ 38
- 6
etherpad.js View File

33
         if (!etherpadIFrame)
33
         if (!etherpadIFrame)
34
             createIFrame();
34
             createIFrame();
35
 
35
 
36
-        // TODO FIX large video and prezi toggling. Too many calls from different places.
37
         var largeVideo = null;
36
         var largeVideo = null;
38
-        if (isPresentationVisible())
37
+        if (Prezi.isPresentationVisible())
39
             largeVideo = $('#presentation>iframe');
38
             largeVideo = $('#presentation>iframe');
40
         else
39
         else
41
             largeVideo = $('#largeVideo');
40
             largeVideo = $('#largeVideo');
42
 
41
 
43
         if ($('#etherpad>iframe').css('visibility') === 'hidden') {
42
         if ($('#etherpad>iframe').css('visibility') === 'hidden') {
44
             largeVideo.fadeOut(300, function () {
43
             largeVideo.fadeOut(300, function () {
45
-                if (isPresentationVisible())
44
+                if (Prezi.isPresentationVisible())
46
                     largeVideo.css({opacity:'0'});
45
                     largeVideo.css({opacity:'0'});
47
-                else
48
-                    largeVideo.css({visibility:'hidden'});
46
+                else {
47
+                    setLargeVideoVisible(false);
48
+                    dockToolbar(true);
49
+                }
49
 
50
 
50
                 $('#etherpad>iframe').fadeIn(300, function() {
51
                 $('#etherpad>iframe').fadeIn(300, function() {
52
+                    document.body.style.background = '#eeeeee';
51
                     $('#etherpad>iframe').css({visibility:'visible'});
53
                     $('#etherpad>iframe').css({visibility:'visible'});
52
                     $('#etherpad').css({zIndex:2});
54
                     $('#etherpad').css({zIndex:2});
53
                 });
55
                 });
57
             $('#etherpad>iframe').fadeOut(300, function () {
59
             $('#etherpad>iframe').fadeOut(300, function () {
58
                 $('#etherpad>iframe').css({visibility:'hidden'});
60
                 $('#etherpad>iframe').css({visibility:'hidden'});
59
                 $('#etherpad').css({zIndex:0});
61
                 $('#etherpad').css({zIndex:0});
62
+                document.body.style.background = 'black';
60
                 if (!isPresentation) {
63
                 if (!isPresentation) {
61
                     $('#largeVideo').fadeIn(300, function() {
64
                     $('#largeVideo').fadeIn(300, function() {
62
-                        $('#largeVideo').css({visibility:'visible'});
65
+                        setLargeVideoVisible(true);
66
+                        dockToolbar(false);
63
                     });
67
                     });
64
                 }
68
                 }
65
             });
69
             });
66
         }
70
         }
71
+        resize();
67
     };
72
     };
68
 
73
 
74
+    /**
75
+     * Resizes the etherpad.
76
+     */
77
+    function resize() {
78
+        if ($('#etherpad>iframe').length) {
79
+            var remoteVideos = $('#remoteVideos');
80
+            var availableHeight
81
+                = window.innerHeight - remoteVideos.outerHeight();
82
+            var availableWidth = Util.getAvailableVideoWidth();
83
+
84
+            var aspectRatio = 16.0 / 9.0;
85
+            if (availableHeight < availableWidth / aspectRatio) {
86
+                availableWidth = Math.floor(availableHeight * aspectRatio);
87
+            }
88
+
89
+            $('#etherpad>iframe').width(availableWidth);
90
+            $('#etherpad>iframe').height(availableHeight);
91
+        }
92
+    }
93
+
69
     /**
94
     /**
70
      * Shares the Etherpad name with other participants.
95
      * Shares the Etherpad name with other participants.
71
      */
96
      */
127
             Etherpad.toggleEtherpad(isPresentation);
152
             Etherpad.toggleEtherpad(isPresentation);
128
     });
153
     });
129
 
154
 
155
+    /**
156
+     * Resizes the etherpad, when the window is resized.
157
+     */
158
+    $(window).resize(function () {
159
+        resize();
160
+    });
161
+
130
     return my;
162
     return my;
131
 }(Etherpad || {}));
163
 }(Etherpad || {}));

BIN
fonts/jitsi.eot View File


+ 25
- 0
fonts/jitsi.svg View File

1
+<?xml version="1.0" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+<svg xmlns="http://www.w3.org/2000/svg">
4
+<metadata>Generated by IcoMoon</metadata>
5
+<defs>
6
+<font id="jitsi" horiz-adv-x="512">
7
+<font-face units-per-em="512" ascent="480" descent="-32" />
8
+<missing-glyph horiz-adv-x="512" />
9
+<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
10
+<glyph unicode="&#xe600;" d="M162.143 99.956c-13.522-0.146-24.863 7.774-29.852 20.164-1.911 4.822-1.9 9.598-1.865 13.781 0.146 11.159 5.852 18.418 10.793 23.563l176.701 185.143c4.673 4.908 10.599 7.942 18.122 9.315 1.569 0.284 3.145 0.427 4.69 0.443 11.064 0.12 22.613-6.356 27.503-15.401 2.315-4.202 3.714-8.478 4.301-13.042 1.106-8.555-0.829-16.432-5.736-23.433-1.303-1.836-2.858-3.44-4.421-5.014l-158.308-166.022c-6.047-6.321-12.078-12.64-17.983-19.085-6.311-6.825-13.743-10.366-22.099-10.457 0 0.002-1.811 0.046-1.846 0.046zM339.482 168.63c-10.974 0-21.341 4.307-29.194 12.099l-110.512 110.16c-7.819 7.809-12.137 18.148-12.137 29.133 0.016 10.763 4.192 20.82 11.727 28.332l120.504 120.138c7.565 7.526 17.655 11.675 28.437 11.675 10.971 0 21.372-4.306 29.192-12.1l110.494-110.142c15.955-15.98 16.142-41.753 0.411-57.482l-120.487-120.12c-7.568-7.542-17.654-11.693-28.435-11.693zM338.851 229.352l100.377 100.053-90.29 90.057-100.406-100.082 90.319-90.028zM151.84-31.065c-10.987 0-21.341 4.274-29.191 12.070l-110.512 110.188c-7.817 7.793-12.138 18.13-12.138 29.103 0.015 10.777 4.192 20.836 11.727 28.348l120.492 120.137c7.565 7.527 17.667 11.676 28.435 11.676 11.003 0 21.375-4.305 29.209-12.101l110.495-110.158c15.952-15.967 16.143-41.738 0.411-57.45l-120.49-120.154c-7.565-7.512-17.672-11.658-28.438-11.658zM151.227 29.654l100.362 100.038-90.306 90.060-100.389-100.087 90.334-90.012z" horiz-adv-x="501" />
11
+<glyph unicode="&#xe601;" d="M478.031 481.466h-409.912c-36.518 0-66.245-30.358-66.245-67.658v-270.103c0-37.269 29.727-67.623 66.245-67.623h17.913v-106.471l172.493 106.471h219.506c36.482 0 66.21 30.356 66.21 67.623v270.101c0 37.301-29.728 67.659-66.21 67.659zM248.25 146.943l-97.857-61.998v61.998h-79.13v263.628h403.594l0.032-263.627h-226.639zM119.531 357.777h302.563v-55.31h-302.563v55.31zM119.531 261.238h302.563v-55.308h-302.563v55.308z" horiz-adv-x="544" />
12
+<glyph unicode="&#xe602;" d="M477.908 480.159h-411.421c-36.651 0-66.487-30.466-66.487-67.922v-271.093c0-37.425 29.836-67.892 66.487-67.892h411.421c36.62 0 66.458 30.467 66.458 67.892v271.093c0 37.457-29.838 67.922-66.458 67.922zM474.755 144.392h-405.113v264.611h405.082l0.031-264.611zM472.61 0.17c0-17.869-14.13-32.33-31.603-32.33h-337.614c-17.475 0-31.605 14.461-31.605 32.33v14.809c0 17.85 14.13 32.329 31.605 32.329h337.614c17.473 0 31.603-14.478 31.603-32.329v-14.809zM388.396 171.217l-151.334 151.303 56.206 56.158 151.273-151.301v-56.159z" horiz-adv-x="545" />
13
+<glyph unicode="&#xe603;" d="M476.248 477.533h-409.344c-36.405 0-66.091-30.315-66.091-67.581v-375.36c0-37.236 29.686-67.55 66.091-67.55h409.343c36.468 0 66.157 30.313 66.157 67.55v375.361c0.001 37.266-29.689 67.579-66.156 67.579zM473.173 37.825h-403.070v368.911h403.007l0.063-368.911zM342.877 337.272h108.455v-283.379h-108.456v283.379zM214.336 273.001h108.456v-219.108h-108.456v219.108zM86.169 208.73h108.081v-154.839h-108.081v154.839z" horiz-adv-x="544" />
14
+<glyph unicode="&#xe604;" d="M439.13 482.757c-81.772 0-148.286-66.518-148.286-148.306v-21.876h-224.454c-36.57 0-66.388-30.454-66.388-67.875v-206.384c0-37.389 29.819-67.839 66.388-67.839h282.076c36.632 0 66.459 30.45 66.459 67.839v206.384c0 35.027-26.134 63.948-59.52 67.504v22.247c0 46.183 37.577 83.745 83.726 83.745 46.152 0 83.731-37.56 83.731-83.745v-38.711c0-17.841 14.442-32.282 32.278-32.282 17.845 0 32.284 14.441 32.284 32.282v38.711c-0.001 81.788-66.514 148.306-148.293 148.306z" horiz-adv-x="590" />
15
+<glyph unicode="&#xe605;" d="M0.759 320.807h138.767v159.899c0 0-39.017-4.051-88.090-55.817-49.069-51.764-50.676-104.082-50.676-104.082zM341.64 480.706h-169.842v-192.298l-171.040 0.125-0.757 1.734v-255.251c0-36.923 30.7-66.99 68.424-66.99h273.217c37.757 0 68.456 30.068 68.456 66.99v378.702c-0.002 36.921-30.699 66.988-68.457 66.988zM345.927 72.582h-286.424v46.394h286.423v-46.394zM345.927 169.401h-286.424v46.392h286.423v-46.392z" horiz-adv-x="410" />
16
+<glyph unicode="&#xe606;" d="M476.95 481.193h-409.887c-36.483 0-66.209-30.356-66.209-67.672v-270.084c0-37.284 29.727-67.639 66.209-67.639h17.912v-106.445l172.483 106.445h219.493c36.482 0 66.208 30.355 66.208 67.639v270.084c0.001 37.316-29.725 67.672-66.207 67.672zM247.214 146.677l-97.885-62v62h-79.092v263.626h403.539l0.062-263.626h-226.625z" horiz-adv-x="545" />
17
+<glyph unicode="&#xe607;" d="M354.757 310.047v22.227c0 81.545-66.331 147.875-147.875 147.875-81.546 0-147.876-66.329-147.876-147.875v-22.227c-33.113-3.697-59.007-32.458-59.007-67.304v-205.811c0-37.315 29.741-67.683 66.236-67.683h281.291c36.529 0 66.267 30.368 66.267 67.683v205.811c0 34.848-25.896 63.609-59.037 67.304zM206.882 415.769c46.022 0 83.493-37.472 83.493-83.494v-21.816h-166.989v21.816c0 46.022 37.441 83.494 83.495 83.494z" horiz-adv-x="414" />
18
+<glyph unicode="&#xe608;" d="M613.039 358.427l-90.297-88.124v109.103c0 37.441-29.829 67.911-66.474 67.911h-318.101c-36.644 0-66.469-30.47-66.469-67.911v-305.329c0-37.425 29.826-67.894 66.469-67.894h318.101c36.645 0 66.474 30.469 66.474 67.894v86.562l96.954-77.070c24.451-17.791 48.463 2.608 48.463 20.292v242.327c0.001 17.682-28.015 35.754-55.122 12.24zM301.315 99.154c-70.723 0-128.065 57.342-128.065 128.066s57.341 128.065 128.065 128.065c70.724 0 128.067-57.341 128.067-128.065 0-70.725-57.344-128.066-128.067-128.066zM296.894 299.788c-40.335 0-73.037-32.704-73.037-73.036 0-40.335 32.703-73.040 73.037-73.040 40.331 0 73.036 32.707 73.036 73.040 0 40.332-32.705 73.036-73.036 73.036zM296.894 260.049c-14.916 0-27.014-12.116-27.014-27.013 0-4.423-3.594-8.004-8.005-8.004-4.44 0-8.002 3.58-8.002 8.004 0 23.716 19.291 43.024 43.022 43.024 4.409 0 8.002-3.58 8.002-8.005-0.002-4.426-3.596-8.005-8.002-8.005z" horiz-adv-x="667" />
19
+<glyph unicode="&#xe609;" d="M611.967 358.573l-90.149-87.978v108.924c0 3.831-0.333 7.574-0.951 11.216l36.847 32.673c13.174 11.705 14.42 31.9 2.684 45.12-11.737 13.203-31.902 14.436-45.136 2.7l-504.51-447.356c-13.204-11.705-14.421-31.903-2.699-45.104 6.303-7.118 15.091-10.769 23.925-10.769 7.538 0 15.107 2.652 21.195 8.050l47.92 42.49c10.498-7.313 23.13-11.616 36.796-11.616h317.596c36.55 0 66.33 30.404 66.33 67.769v86.434l96.83-76.978c24.408-17.73 48.383 2.624 48.383 20.292v241.914c0.001 17.653-27.966 35.693-55.062 12.22zM300.757 99.724c-29.405 0-56.283 10.108-77.763 26.899l41.465 36.767c10.431-5.832 22.425-9.193 35.235-9.193 40.267 0 72.916 32.649 72.916 72.918 0 9.71-1.948 18.928-5.428 27.357l43.423 38.501c11.424-19.13 18.006-41.484 18.006-65.391 0-70.607-57.246-127.855-127.853-127.855zM172.899 227.58c0 70.608 57.248 127.857 127.858 127.857 10.75 0 21.038-1.717 30.993-4.214l108.379 96.096h-302.237c-36.569 0-66.349-30.419-66.349-67.799v-259.037l102.947 91.272c-0.654 5.243-1.592 10.426-1.592 15.826z" horiz-adv-x="667" />
20
+<glyph unicode="&#xe60a;" d="M560.562 469.433c-11.74 13.207-31.942 14.425-45.148 2.686l-504.653-447.452c-13.207-11.709-14.426-31.908-2.717-45.116 6.306-7.122 15.112-10.774 23.947-10.774 7.525 0 15.112 2.654 21.201 8.054l128.536 113.967c16.613-11.432 34.994-19.839 54.305-24.856-35.096-17.827-59.386-53.858-59.386-95.947h215.936c0 42.868-25.164 79.558-61.382 97.039 27.475 7.245 52.921 19.983 73.748 38.748 25.944 23.356 56.856 65.757 56.856 135.165v65.162c0 9.406-3.962 17.883-10.293 23.899l106.332 94.279c13.21 11.738 14.424 31.908 2.717 45.147zM395.767 240.946c0-78.993-58.825-114.961-113.495-114.961-17.607 0-34.329 3.608-49.142 10.393l27.868 24.708c7.366-2.295 15.178-3.566 23.305-3.566 44.678 0 80.992 36.344 80.992 80.99v15.050l30.474 27.021v-39.635zM365.295 396.933c0 44.649-36.313 80.992-80.992 80.992-44.649 0-80.992-36.344-80.992-80.992v-158.425c0-0.125 0-0.249 0-0.374l161.984 143.625v15.174zM175.398 213.345c-1.623 8.741-2.559 17.891-2.559 27.601v65.161c0 18.203-14.8 33.002-33.003 33.002-18.233 0-33.002-14.798-33.002-33.002v-65.161c0-28.599 5.558-53.513 14.549-75.466l54.015 47.865z" horiz-adv-x="569" />
21
+<glyph unicode="&#xe60b;" d="M429.207 339.972c-18.298 0-33.123-14.826-33.123-33.091v-65.362c0-79.211-58.991-115.298-113.817-115.298-29.337 0-56.309 9.935-75.93 27.98-22.115 20.409-33.848 50.601-33.848 87.32v65.363c0 18.265-14.827 33.091-33.091 33.091-18.265 0-33.091-14.826-33.091-33.091v-65.363c0-97.917 59.747-157.382 129.589-175.52-35.204-17.855-59.588-54.007-59.588-96.216h216.559c0 42.996-25.204 79.81-61.514 97.286 27.539 7.32 53.060 20.063 73.943 38.895 26.025 23.438 57.004 65.963 57.004 135.553v65.363c0 18.265-14.795 33.091-33.092 33.091zM284.286 157.86c-44.794 0-81.23 36.466-81.23 81.26v158.832c0 44.795 36.435 81.23 81.23 81.23 44.796 0 81.262-36.435 81.262-81.23v-158.832c0.002-44.796-36.464-81.26-81.262-81.26z" horiz-adv-x="569" />
22
+<glyph unicode="&#xe60c;" d="M256.178 480c-141.228 0-256.178-114.919-256.178-256.239 0-141.195 114.95-256.113 256.178-256.113 141.257 0 256.207 114.919 256.207 256.113 0 141.32-114.95 256.239-256.207 256.239zM256.178 7.428c-119.272 0-216.335 97.063-216.335 216.333 0 119.398 97.063 216.429 216.335 216.429 119.3 0 216.428-97.031 216.428-216.429 0-119.27-97.127-216.333-216.428-216.333zM256.272 427.481c-112.377 0-203.754-91.375-203.754-203.657 0-112.281 91.375-203.657 203.754-203.657 112.219 0 203.594 91.377 203.594 203.658-0.002 112.283-91.375 203.658-203.594 203.658zM256.272 63.661c-88.358 0-160.226 71.902-160.226 160.162 0 88.262 71.868 160.162 160.226 160.162 88.262 0 160.098-71.901 160.098-160.162 0-88.26-71.837-160.162-160.098-160.162zM141.925 281.394l-0.477-0.699v-117.207l0.477-0.699c7.879-11.53 18.237-22.271 30.85-31.899l4.481-3.401v189.171l-4.481-3.368c-12.55-9.595-22.907-20.272-30.85-31.899zM207.819 332.865l-1.81-0.667v-220.18l1.81-0.699c9.341-3.527 19.444-5.97 30.883-7.466l3.112-0.381v237.207l-3.082-0.381c-11.119-1.398-21.508-3.876-30.913-7.435zM273.683 340.299l-3.082 0.381v-237.208l3.082 0.381c11.151 1.397 21.538 3.906 30.882 7.432l1.842 0.7v220.244l-1.842 0.667c-9.406 3.526-19.762 6.005-30.882 7.403zM370.49 281.394c-7.846 11.501-18.236 22.24-30.849 31.899l-4.447 3.43v-189.234l4.447 3.401c12.675 9.69 23.066 20.431 30.849 31.93l0.445 0.699v117.176l-0.445 0.7z" horiz-adv-x="513" />
23
+<glyph unicode="&#xe60d;" d="M476.183 480.067h-410.238c-36.514 0-66.266-30.38-66.266-67.728v-376.179c0-37.33 29.752-67.712 66.266-67.712h410.24c36.545 0 66.298 30.383 66.298 67.712v376.179c-0.001 37.347-29.754 67.728-66.299 67.728zM473.067 39.401h-403.947v369.731h403.917l0.029-369.731zM284.871 255.938l45.886 48.433-38.652 38.654 158.197 42.52-42.49-158.195-37.678 37.647-45.917-48.433zM257.382 192.281l-45.883-48.433 38.65-38.652-158.194-42.522 42.489 158.194 37.678-37.645 45.917 48.435z" horiz-adv-x="545" />
24
+<glyph unicode="&#xe60e;" d="M476.613 479.59h-410.332c-36.523 0-66.281-30.388-66.281-67.744v-376.262c0-37.324 29.759-67.71 66.281-67.71h410.33c36.553 0 66.312 30.388 66.312 67.711v376.262c0.001 37.356-29.758 67.744-66.311 67.744zM473.497 38.824h-404.039v369.798h404.009l0.031-369.798zM457.769 353.35l-45.897-48.445 38.663-38.661-158.232-42.515 42.5 158.232 37.687-37.67 45.926 48.445zM85.313 94.111l45.897 48.442-38.661 38.663 158.232 42.514-42.499-158.23-37.686 37.671-45.928-48.445z" horiz-adv-x="545" />
25
+</font></defs></svg>

BIN
fonts/jitsi.ttf View File


BIN
fonts/jitsi.woff View File


BIN
images/avatar1.png View File


BIN
images/avatarprezi.png View File


BIN
images/watermark.png View File


+ 22
- 18
index.html View File

20
     <script src="chat.js?v=3"></script><!-- chat logic -->
20
     <script src="chat.js?v=3"></script><!-- chat logic -->
21
     <script src="util.js?v=2"></script><!-- utility functions -->
21
     <script src="util.js?v=2"></script><!-- utility functions -->
22
     <script src="etherpad.js?v=5"></script><!-- etherpad plugin -->
22
     <script src="etherpad.js?v=5"></script><!-- etherpad plugin -->
23
+    <script src="prezi.js?v=1"></script><!-- prezi plugin -->
23
     <script src="smileys.js?v=1"></script><!-- smiley images -->
24
     <script src="smileys.js?v=1"></script><!-- smiley images -->
24
     <script src="replacement.js?v=5"></script><!-- link and smiley replacement -->
25
     <script src="replacement.js?v=5"></script><!-- link and smiley replacement -->
25
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
26
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
27
+    <link rel="stylesheet" href="css/font.css"/>
26
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=19"/>
28
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=19"/>
29
+    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=1" id="videolayout_default"/>
30
+    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_fullscreen.css?v=1" id="videolayout_fullscreen" disabled>
27
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
31
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
28
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
32
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
29
     <!--
33
     <!--
39
         <a href="http://jitsi.org" target="_blank"><div id="leftlogo"></div></a>
43
         <a href="http://jitsi.org" target="_blank"><div id="leftlogo"></div></a>
40
         <a href="http://www.estos.com/" target="_blank"><div id="rightlogo"></div></a>
44
         <a href="http://www.estos.com/" target="_blank"><div id="rightlogo"></div></a>
41
         <span id="toolbar">
45
         <span id="toolbar">
42
-            <a class="button" onclick='buttonClick("#mute", "fa fa-microphone fa-lg fa fa-microphone-slash fa-lg");toggleAudio();'>
43
-                <i id="mute" title="Mute / unmute" class="fa fa-microphone fa-lg"></i></a>
46
+            <a class="button" onclick='buttonClick("#mute", "icon-microphone icon-mic-disabled");toggleAudio();'>
47
+                <i id="mute" title="Mute / unmute" class="icon-microphone"></i></a>
44
             <div class="header_button_separator"></div>
48
             <div class="header_button_separator"></div>
45
-            <a class="button" onclick='buttonClick("#video");toggleVideo();'>
46
-                <i id="video" title="Start / stop camera" class="fa fa-video-camera fa-lg"></i></a>
49
+            <a class="button" onclick='buttonClick("#video", "icon-camera icon-camera-disabled");toggleVideo();'>
50
+                <i id="video" title="Start / stop camera" class="icon-camera"></i></a>
47
             <div class="header_button_separator"></div>
51
             <div class="header_button_separator"></div>
48
-            <a class="button" onclick="openLockDialog();"><i id="lockIcon" title="Lock/unlock room" class="fa fa-unlock fa-lg"></i></a>
52
+            <a class="button" onclick="openLockDialog();"><i id="lockIcon" title="Lock/unlock room" class="icon-security"></i></a>
49
             <div class="header_button_separator"></div>
53
             <div class="header_button_separator"></div>
50
-            <a class="button" onclick="openLinkDialog();"><i title="Invite others" class="fa fa-link fa-lg"></i></a>
54
+            <a class="button" onclick="openLinkDialog();"><i title="Invite others" class="icon-link"></i></a>
51
             <div class="header_button_separator"></div>
55
             <div class="header_button_separator"></div>
52
             <span class="toolbar_span">
56
             <span class="toolbar_span">
53
-                <a class="button" onclick='Chat.toggleChat();'><i id="chat" title="Open chat" class="fa fa-comments-o fa-lg"></i></a>
57
+                <a class="button" onclick='Chat.toggleChat();'><i id="chatButton" title="Open chat" class="icon-chat"></i></a>
54
                 <span id="unreadMessages"></span>
58
                 <span id="unreadMessages"></span>
55
             </span>
59
             </span>
56
             <div class="header_button_separator"></div>
60
             <div class="header_button_separator"></div>
57
-            <a class="button" onclick='openPreziDialog();'><i title="Share prezi" class="fa fa-picture-o fa-lg"></i></a>
61
+            <a class="button" onclick='Prezi.openPreziDialog();'><i title="Share prezi" class="icon-prezi"></i></a>
58
             <span id="etherpadButton">
62
             <span id="etherpadButton">
59
                 <div class="header_button_separator"></div>
63
                 <div class="header_button_separator"></div>
60
-                <a class="button" onclick='Etherpad.toggleEtherpad(0);'><i title="Open shared document" class="fa fa-file-text fa-lg"></i></a>
64
+                <a class="button" onclick='Etherpad.toggleEtherpad(0);'><i title="Open shared document" class="icon-share-doc"></i></a>
61
             </span>
65
             </span>
62
             <div class="header_button_separator"></div>
66
             <div class="header_button_separator"></div>
63
             <span id="desktopsharing" style="display: none">
67
             <span id="desktopsharing" style="display: none">
64
-                <a class="button" onclick="toggleScreenSharing();"><i title="Share screen" class="fa fa-desktop fa-lg"></i></a>
68
+                <a class="button" onclick="toggleScreenSharing();"><i title="Share screen" class="icon-share-desktop"></i></a>
65
                 <div class="header_button_separator"></div>
69
                 <div class="header_button_separator"></div>
66
             </span>
70
             </span>
67
-            <a class="button" onclick='toggleFullScreen();'><i title="Enter / Exit Full Screen" class="fa fa-arrows-alt fa-lg"></i></a>
71
+            <a class="button" onclick='buttonClick("#fullScreen", "icon-full-screen icon-exit-full-screen");toggleFullScreen();'><i id="fullScreen" title="Enter / Exit Full Screen" class="icon-full-screen"></i></a>
68
         </span>
72
         </span>
69
     </div>
73
     </div>
70
     <div id="settings">
74
     <div id="settings">
76
         <input id="connect" type="submit" value="Connect" />
80
         <input id="connect" type="submit" value="Connect" />
77
       </form>
81
       </form>
78
     </div>
82
     </div>
79
-
80
-    <div id="videospace">
81
-        <div class="fade_line"></div>
83
+    <div id="reloadPresentation"><a onclick='Prezi.reloadPresentation();'><i title="Reload Prezi" class="fa fa-repeat fa-lg"></i></a></div>
84
+    <div id="videospace" onmousemove="showToolbar();">
82
         <div id="largeVideoContainer" class="videocontainer">
85
         <div id="largeVideoContainer" class="videocontainer">
83
-            <div id="reloadPresentation"><a onclick='reloadPresentation();'><i title="Reload Prezi" class="fa fa-repeat fa-lg"></i></a></div>
84
             <div id="presentation"></div>
86
             <div id="presentation"></div>
85
             <div id="etherpad"></div>
87
             <div id="etherpad"></div>
88
+            <a href="http://jitsi.org" target="_new"><div id="watermark"></div></a>
86
             <video id="largeVideo" autoplay oncontextmenu="return false;"></video>
89
             <video id="largeVideo" autoplay oncontextmenu="return false;"></video>
87
         </div>
90
         </div>
88
-        <div class="fade_line"></div>
89
         <div id="remoteVideos">
91
         <div id="remoteVideos">
90
             <span id="localVideoContainer" class="videocontainer">
92
             <span id="localVideoContainer" class="videocontainer">
91
-                <span id="localNick"></span>
92
-                <!--<video id="localVideo" autoplay oncontextmenu="return false;" muted></video> - is now per stream generated -->
93
+                <span id="localNick" class="nick"></span>
94
+                <span id="localVideoWrapper">
95
+                    <!--<video id="localVideo" autoplay oncontextmenu="return false;" muted></video> - is now per stream generated -->
96
+                </span>
93
                 <audio id="localAudio" autoplay oncontextmenu="return false;" muted></audio>
97
                 <audio id="localAudio" autoplay oncontextmenu="return false;" muted></audio>
94
                 <span class="focusindicator"></span>
98
                 <span class="focusindicator"></span>
95
             </span>
99
             </span>

+ 333
- 0
prezi.js View File

1
+var Prezi = (function (my) {
2
+    var preziPlayer = null;
3
+
4
+    /**
5
+     * Reloads the current presentation.
6
+     */
7
+    my.reloadPresentation = function() {
8
+        var iframe = document.getElementById(preziPlayer.options.preziId);
9
+        iframe.src = iframe.src;
10
+    };
11
+
12
+    /**
13
+     * Shows/hides a presentation.
14
+     */
15
+    my.setPresentationVisible = function (visible) {
16
+        if (visible) {
17
+            // Trigger the video.selected event to indicate a change in the
18
+            // large video.
19
+            $(document).trigger("video.selected", [true]);
20
+
21
+            $('#largeVideo').fadeOut(300, function () {
22
+                setLargeVideoVisible(false);
23
+                $('#presentation>iframe').fadeIn(300, function() {
24
+                    $('#presentation>iframe').css({opacity:'1'});
25
+                    dockToolbar(true);
26
+                });
27
+            });
28
+        }
29
+        else {
30
+            if ($('#presentation>iframe').css('opacity') == '1') {
31
+                $('#presentation>iframe').fadeOut(300, function () {
32
+                    $('#presentation>iframe').css({opacity:'0'});
33
+                    $('#reloadPresentation').css({display:'none'});
34
+                    $('#largeVideo').fadeIn(300, function() {
35
+                        setLargeVideoVisible(true);
36
+                        dockToolbar(false);
37
+                    });
38
+                });
39
+            }
40
+        }
41
+    };
42
+
43
+    /**
44
+     * Returns <tt>true</tt> if the presentation is visible, <tt>false</tt> -
45
+     * otherwise.
46
+     */
47
+    my.isPresentationVisible = function () {
48
+        return ($('#presentation>iframe') != null
49
+                && $('#presentation>iframe').css('opacity') == 1);
50
+    };
51
+
52
+    /**
53
+     * Opens the Prezi dialog, from which the user could choose a presentation
54
+     * to load.
55
+     */
56
+    my.openPreziDialog = function() {
57
+        var myprezi = connection.emuc.getPrezi(connection.emuc.myroomjid);
58
+        if (myprezi) {
59
+            $.prompt("Are you sure you would like to remove your Prezi?",
60
+                    {
61
+                    title: "Remove Prezi",
62
+                    buttons: { "Remove": true, "Cancel": false},
63
+                    defaultButton: 1,
64
+                    submit: function(e,v,m,f){
65
+                    if(v)
66
+                    {
67
+                        connection.emuc.removePreziFromPresence();
68
+                        connection.emuc.sendPresence();
69
+                    }
70
+                }
71
+            });
72
+        }
73
+        else if (preziPlayer != null) {
74
+            $.prompt("Another participant is already sharing a Prezi." +
75
+                    "This conference allows only one Prezi at a time.",
76
+                     {
77
+                     title: "Share a Prezi",
78
+                     buttons: { "Ok": true},
79
+                     defaultButton: 0,
80
+                     submit: function(e,v,m,f){
81
+                        $.prompt.close();
82
+                     }
83
+                     });
84
+        }
85
+        else {
86
+            var openPreziState = {
87
+            state0: {
88
+                html:   '<h2>Share a Prezi</h2>' +
89
+                        '<input id="preziUrl" type="text" ' +
90
+                        'placeholder="e.g. ' +
91
+                        'http://prezi.com/wz7vhjycl7e6/my-prezi" autofocus>',
92
+                persistent: false,
93
+                buttons: { "Share": true , "Cancel": false},
94
+                defaultButton: 1,
95
+                submit: function(e,v,m,f){
96
+                    e.preventDefault();
97
+                    if(v)
98
+                    {
99
+                        var preziUrl = document.getElementById('preziUrl');
100
+
101
+                        if (preziUrl.value)
102
+                        {
103
+                            var urlValue
104
+                                = encodeURI(Util.escapeHtml(preziUrl.value));
105
+
106
+                            if (urlValue.indexOf('http://prezi.com/') != 0
107
+                                && urlValue.indexOf('https://prezi.com/') != 0)
108
+                            {
109
+                                $.prompt.goToState('state1');
110
+                                return false;
111
+                            }
112
+                            else {
113
+                                var presIdTmp = urlValue.substring(
114
+                                        urlValue.indexOf("prezi.com/") + 10);
115
+                                if (!Util.isAlphanumeric(presIdTmp)
116
+                                        || presIdTmp.indexOf('/') < 2) {
117
+                                    $.prompt.goToState('state1');
118
+                                    return false;
119
+                                }
120
+                                else {
121
+                                    connection.emuc
122
+                                        .addPreziToPresence(urlValue, 0);
123
+                                    connection.emuc.sendPresence();
124
+                                    $.prompt.close();
125
+                                }
126
+                            }
127
+                        }
128
+                    }
129
+                    else
130
+                        $.prompt.close();
131
+                }
132
+            },
133
+            state1: {
134
+                html:   '<h2>Share a Prezi</h2>' +
135
+                        'Please provide a correct prezi link.',
136
+                persistent: false,
137
+                buttons: { "Back": true, "Cancel": false },
138
+                defaultButton: 1,
139
+                submit:function(e,v,m,f) {
140
+                    e.preventDefault();
141
+                    if(v==0)
142
+                        $.prompt.close();
143
+                    else
144
+                        $.prompt.goToState('state0');
145
+                }
146
+            }
147
+            };
148
+
149
+            var myPrompt = jQuery.prompt(openPreziState);
150
+
151
+            myPrompt.on('impromptu:loaded', function(e) {
152
+                        document.getElementById('preziUrl').focus();
153
+                        });
154
+            myPrompt.on('impromptu:statechanged', function(e) {
155
+                        document.getElementById('preziUrl').focus();
156
+                        });
157
+        }
158
+    };
159
+
160
+    /**
161
+     * A new presentation has been added.
162
+     * 
163
+     * @param event the event indicating the add of a presentation
164
+     * @param jid the jid from which the presentation was added
165
+     * @param presUrl url of the presentation
166
+     * @param currentSlide the current slide to which we should move
167
+     */
168
+    var presentationAdded = function(event, jid, presUrl, currentSlide) {
169
+        console.log("presentation added", presUrl);
170
+
171
+        var presId = getPresentationId(presUrl);
172
+        var elementId = 'participant_'
173
+                        + Strophe.getResourceFromJid(jid)
174
+                        + '_' + presId;
175
+
176
+        addRemoteVideoContainer(elementId);
177
+        resizeThumbnails();
178
+
179
+        var controlsEnabled = false;
180
+        if (jid === connection.emuc.myroomjid)
181
+            controlsEnabled = true;
182
+
183
+        Prezi.setPresentationVisible(true);
184
+        $('#largeVideoContainer').hover(
185
+            function (event) {
186
+                if (Prezi.isPresentationVisible()) {
187
+                    var reloadButtonRight = window.innerWidth
188
+                        - $('#presentation>iframe').offset().left
189
+                        - $('#presentation>iframe').width();
190
+
191
+                    $('#reloadPresentation').css({  right: reloadButtonRight,
192
+                                                    display:'inline-block'});
193
+                }
194
+            },
195
+            function (event) {
196
+                if (!Prezi.isPresentationVisible())
197
+                    $('#reloadPresentation').css({display:'none'});
198
+                else {
199
+                    var e = event.toElement || event.relatedTarget;
200
+
201
+                    if (e && e.id != 'reloadPresentation' && e.id != 'header')
202
+                        $('#reloadPresentation').css({display:'none'});
203
+                }
204
+            });
205
+
206
+        preziPlayer = new PreziPlayer(
207
+                    'presentation',
208
+                    {preziId: presId,
209
+                    width: getPresentationWidth(),
210
+                    height: getPresentationHeihgt(),
211
+                    controls: controlsEnabled,
212
+                    debug: true
213
+                    });
214
+
215
+        $('#presentation>iframe').attr('id', preziPlayer.options.preziId);
216
+
217
+        preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
218
+            console.log("prezi status", event.value);
219
+            if (event.value == PreziPlayer.STATUS_CONTENT_READY) {
220
+                if (jid != connection.emuc.myroomjid)
221
+                    preziPlayer.flyToStep(currentSlide);
222
+            }
223
+        });
224
+
225
+        preziPlayer.on(PreziPlayer.EVENT_CURRENT_STEP, function(event) {
226
+            console.log("event value", event.value);
227
+            connection.emuc.addCurrentSlideToPresence(event.value);
228
+            connection.emuc.sendPresence();
229
+        });
230
+
231
+        $("#" + elementId).css( 'background-image',
232
+                                'url(../images/avatarprezi.png)');
233
+        $("#" + elementId).click(
234
+            function () {
235
+                Prezi.setPresentationVisible(true);
236
+            }
237
+        );
238
+    };
239
+
240
+    /**
241
+     * A presentation has been removed.
242
+     * 
243
+     * @param event the event indicating the remove of a presentation
244
+     * @param jid the jid for which the presentation was removed
245
+     * @param the url of the presentation
246
+     */
247
+    var presentationRemoved = function (event, jid, presUrl) {
248
+        console.log('presentation removed', presUrl);
249
+        var presId = getPresentationId(presUrl);
250
+        Prezi.setPresentationVisible(false);
251
+        $('#participant_'
252
+                + Strophe.getResourceFromJid(jid)
253
+                + '_' + presId).remove();
254
+        $('#presentation>iframe').remove();
255
+        if (preziPlayer != null) {
256
+            preziPlayer.destroy();
257
+            preziPlayer = null;
258
+        }
259
+    };
260
+
261
+    /**
262
+     * Returns the presentation id from the given url.
263
+     */
264
+    function getPresentationId (presUrl) {
265
+        var presIdTmp = presUrl.substring(presUrl.indexOf("prezi.com/") + 10);
266
+        return presIdTmp.substring(0, presIdTmp.indexOf('/'));
267
+    }
268
+
269
+    /**
270
+     * Returns the presentation width.
271
+     */
272
+    function getPresentationWidth() {
273
+        var availableWidth = Util.getAvailableVideoWidth();
274
+        var availableHeight = getPresentationHeihgt();
275
+
276
+        var aspectRatio = 16.0 / 9.0;
277
+        if (availableHeight < availableWidth / aspectRatio) {
278
+            availableWidth = Math.floor(availableHeight * aspectRatio);
279
+        }
280
+        return availableWidth;
281
+    }
282
+
283
+    /**
284
+     * Returns the presentation height.
285
+     */
286
+    function getPresentationHeihgt() {
287
+        var remoteVideos = $('#remoteVideos');
288
+        return window.innerHeight - remoteVideos.outerHeight();
289
+    }
290
+
291
+    /**
292
+     * Resizes the presentation iframe.
293
+     */
294
+    function resize() {
295
+        if ($('#presentation>iframe')) {
296
+            $('#presentation>iframe').width(getPresentationWidth());
297
+            $('#presentation>iframe').height(getPresentationHeihgt());
298
+        }
299
+    }
300
+
301
+    /**
302
+     * Presentation has been removed.
303
+     */
304
+    $(document).bind('presentationremoved.muc', presentationRemoved);
305
+
306
+    /**
307
+     * Presentation has been added.
308
+     */
309
+    $(document).bind('presentationadded.muc', presentationAdded);
310
+
311
+    /*
312
+     * Indicates presentation slide change.
313
+     */
314
+    $(document).bind('gotoslide.muc', function (event, jid, presUrl, current) {
315
+        if (preziPlayer) {
316
+            preziPlayer.flyToStep(current);
317
+        }
318
+    });
319
+
320
+    /**
321
+     * On video selected event.
322
+     */
323
+    $(document).bind('video.selected', function (event, isPresentation) {
324
+        if (!isPresentation && $('#presentation>iframe'))
325
+            Prezi.setPresentationVisible(false);
326
+    });
327
+
328
+    $(window).resize(function () {
329
+        resize();
330
+    });
331
+
332
+    return my;
333
+}(Prezi || {}));

+ 11
- 0
util.js View File

57
         return regex.test(unsafeText);
57
         return regex.test(unsafeText);
58
     };
58
     };
59
 
59
 
60
+    /**
61
+     * Returns the available video width.
62
+     */
63
+    my.getAvailableVideoWidth = function() {
64
+        var chatspaceWidth = $('#chatspace').is(":visible")
65
+        ? $('#chatspace').width()
66
+        : 0;
67
+
68
+        return window.innerWidth - chatspaceWidth;
69
+    };
70
+
60
     return my;
71
     return my;
61
 }(Util || {}));
72
 }(Util || {}));

Loading…
Cancel
Save