diff --git a/src/styles/components/_audiovideo.scss b/src/styles/components/_audiovideo.scss index d7f0e479..fd946f97 100644 --- a/src/styles/components/_audiovideo.scss +++ b/src/styles/components/_audiovideo.scss @@ -96,6 +96,54 @@ right:520px; border:1px solid #9dd53a; } +.renderer-conferencekiosk { + #remoteVideos { + top:auto; + bottom:2px; + text-align:center; + background:rgba(0,0,0,0.4); + padding-right:192px; + >div { + height:108px; + width:192px; + cursor:pointer; + } + .overlaylogo { + display:none; + } + .peerlabel, .peeractions i { + font-size:1.1em; + } + .peerlabel { + background: rgba(0,0,0,0.9); + } + } + #mini { + max-height: none; + height:108px; + width:192px; + } + .bigVideo { + position:absolute; + left:0px; + right:0px; + bottom:112px; + top:2px; + margin: auto; + opacity: 0; + transition-property: opacity; + -webkit-transition-property: opacity; + transition-duration: 2s; + -webkit-transition-duration: 2s; + } + +} + +.bigVideo video { + width:100%; + height:100%; +} + @media only screen and (max-width: 630px) { .mainScreenshare #audiovideo { display:none; @@ -106,4 +154,4 @@ right:520px; right:0px; z-index:12; } -} \ No newline at end of file +} diff --git a/static/js/directives/audiovideo.js b/static/js/directives/audiovideo.js index 3c0f7927..0a2c6855 100644 --- a/static/js/directives/audiovideo.js +++ b/static/js/directives/audiovideo.js @@ -64,6 +64,7 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ peerTemplate(subscope, function(clonedElement, scope) { $($scope.remoteVideos).append(clonedElement); + clonedElement.data("peerid", scope.peerid); scope.element = clonedElement; var video = clonedElement.find("video").get(0); $window.attachMediaStream(video, stream); @@ -238,14 +239,20 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ $(scope.card).on("doubletap dblclick", _.debounce(scope.toggleFullscreen, 100, true)); + //scope.rendererName = "conferencekiosk"; + scope.rendererName = "onepeople"; + var needsResize = false; - var rendererName = "onepeople"; scope.resize = function() { needsResize = true; }; var resize = function() { - videoLayout.update(rendererName, scope, controller); + var size = { + width: scope.layoutparent.width(), + height: scope.layoutparent.height() + } + videoLayout.update(scope.rendererName, size, scope, controller); }; $($window).on("resize", scope.resize); diff --git a/static/js/services/videolayout.js b/static/js/services/videolayout.js index aa651309..07ddd3fd 100644 --- a/static/js/services/videolayout.js +++ b/static/js/services/videolayout.js @@ -23,20 +23,32 @@ define(["jquery", "underscore"], function($, _) { var dynamicCSSContainer = "audiovideo-dynamic"; var renderers = {}; + var getRemoteVideoSize = function(videos, peers) { + var size = { + width: 1920, + height: 1080 + } + if (videos.length) { + if (videos.length === 1) { + var remoteVideo = peers[videos[0]].element.find("video").get(0); + size.width = remoteVideo.videoWidth; + size.height = remoteVideo.videoHeight; + console.log("Remote video size: ", size); + } + } + return size; + } + // videoLayout - return [function() { + return ["$window", function($window) { // Video layout with all persons rendered the same size. - var OnePeople = function(scope, controller) { - this.stylesBackup = { - width: scope.container.style.width, - left: scope.container.style.left - } + var OnePeople = function(container, scope, controller) { }; OnePeople.prototype.name = "onepeople"; - OnePeople.prototype.render = function(scope, videos, peers) { + OnePeople.prototype.render = function(container, size, scope, videos, peers) { if (this.closed) { return; @@ -46,7 +58,8 @@ define(["jquery", "underscore"], function($, _) { var videoHeight; if (videos.length) { - if (videos.length === 1) { + var remoteSize = getRemoteVideoSize(videos, peers); + /*if (videos.length === 1) { var remoteVideo = peers[videos[0]].element.find("video").get(0); videoWidth = remoteVideo.videoWidth; videoHeight = remoteVideo.videoHeight; @@ -54,7 +67,9 @@ define(["jquery", "underscore"], function($, _) { } else { videoWidth = 1920; videoHeight = 1080; - } + }*/ + videoWidth = remoteSize.width; + videoHeight = remoteSize.height; } if (!videoWidth) { @@ -79,9 +94,8 @@ define(["jquery", "underscore"], function($, _) { } var aspectRatio = videoWidth/videoHeight; - var innerHeight = scope.layoutparent.height(); - var innerWidth = scope.layoutparent.width(); - var container = scope.container; + var innerHeight = size.height; //scope.layoutparent.height(); + var innerWidth = size.width; //scope.layoutparent.width(); //console.log("resize", innerHeight, innerWidth); //console.log("resize", container, videos.length, aspectRatio, innerHeight, innerWidth); @@ -135,40 +149,114 @@ define(["jquery", "underscore"], function($, _) { }; - OnePeople.prototype.close = function(scope, controller) { + OnePeople.prototype.close = function(container, scope, controller) { - scope.container.css(this.stylesBackup); - $.injectCSS({}, { - truncateFirst: true, - containerName: dynamicCSSContainer - }); this.closed = true; }; + var ConferenceKiosk = function(container, scope, controller) { + + this.remoteVideos = $(container).find("#remoteVideos"); + this.bigVideo = $("