Small transitions for previews

Also fix main video removal if it's a peer's screen
master
Daniel Berteaud 11 years ago
parent 1913a24a44
commit d6f70c8594
  1. 1
      public/css/vroom.css
  2. 14
      public/js/vroom.js

@ -22,6 +22,7 @@
.previewContainer{ .previewContainer{
margin-top: 5px; margin-top: 5px;
margin-bottom: 5px; margin-bottom: 5px;
display: none;
} }
.previewContainer:nth-child(2n+1){ .previewContainer:nth-child(2n+1){
clear: left; clear: left;

@ -341,7 +341,7 @@ function initVroom(room) {
}).css('max-height', maxHeight())); }).css('max-height', maxHeight()));
$('.selected').removeClass('selected'); $('.selected').removeClass('selected');
el.addClass('selected'); el.addClass('selected');
mainVid = id; mainVid = el.attr('id');
$('#mainVideo').show(300); $('#mainVideo').show(300);
} }
}, wait); }, wait);
@ -441,7 +441,7 @@ function initVroom(room) {
}, 3500); }, 3500);
// Stop moh // Stop moh
$('#mohPlayer')[0].pause(); $('#mohPlayer')[0].pause();
$('.aloneEl').hide(200); $('.aloneEl').hide(300);
moh = false; moh = false;
} }
$(div).attr('id', 'peer_' + id); $(div).attr('id', 'peer_' + id);
@ -458,6 +458,8 @@ function initVroom(room) {
$(video).click(function() { $(video).click(function() {
handlePreviewClick($(this), peer.id); handlePreviewClick($(this), peer.id);
}); });
// Now display the div
div.show(200);
} }
// Update volume of the corresponding peer // Update volume of the corresponding peer
@ -918,6 +920,7 @@ function initVroom(room) {
$('.aloneEl').show(200); $('.aloneEl').show(200);
} }
}, 2000); }, 2000);
$('#videoLocalContainer').show(200);
}); });
// Handle new video stream added: someone joined the room // Handle new video stream added: someone joined the room
@ -948,8 +951,11 @@ function initVroom(room) {
else if (peer && peers[peer.id]){ else if (peer && peers[peer.id]){
delete peers[peer.id]; delete peers[peer.id];
} }
$("#peer_" + id).remove(); $("#peer_" + id).hide(300);
if (mainVid === id){ setTimeout(function(){
$("#peer_" + id).remove();
}, 300);
if (mainVid == id || mainVid == id + '_incoming'){
$('#mainVideo').hide(500); $('#mainVideo').hide(500);
setTimeout(function(){ setTimeout(function(){
$('#mainVideo').html(''); $('#mainVideo').html('');

Loading…
Cancel
Save