Socket
Socket
Sign inDemoInstall

opentok-layout-js

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentok-layout-js - npm Package Compare versions

Comparing version 3.7.0 to 3.7.1

2

bower.json
{
"name": "opentok-layout-js",
"version": "3.7.0",
"version": "3.7.1",
"homepage": "https://github.com/aullman/opentok-layout-js",

@@ -5,0 +5,0 @@ "authors": [

@@ -592,2 +592,8 @@ (function webpackUniversalModuleDefinition(root, factory) {

if (child) {
if (child.videoHeight && child.videoWidth) {
return {
height: child.videoHeight,
width: child.videoWidth
};
}
var video = child.querySelector('video');

@@ -600,8 +606,2 @@ if (video && video.videoHeight && video.videoWidth) {

}
if (child.videoHeight && child.videoWidth) {
return {
height: child.videoHeight,
width: child.videoWidth
};
}
}

@@ -608,0 +608,0 @@ return {

@@ -1,2 +0,2 @@

!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.initLayoutContainer=i():t.initLayoutContainer=i()}("undefined"!=typeof self?self:this,function(){return function(t){var i={};function e(o){if(i[o])return i[o].exports;var n=i[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=t,e.c=i,e.d=function(t,i,o){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)e.d(o,n,function(i){return t[i]}.bind(null,n));return o},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=2)}([function(t,i,e){"use strict";var o=function(t,i,e,o,n,r,a){for(var d=void 0,h=void 0,f=void 0,u=void 0,g=void 0,l=void 0,s=void 0,c=void 0,v=1;v<=n;v+=1){var m=v,p=Math.ceil(n/m);(c=(s=Math.floor(o/p))/(l=Math.floor(e/m)))>i?s=l*(c=i):c<t&&(l=s/(c=t));var x=(l=Math.min(r,l))*(s=Math.min(a,s))*n;(void 0===d||x>=d)&&(d=x,u=s,g=l,h=m,f=p)}return{maxArea:d,targetCols:h,targetRows:f,targetHeight:u,targetWidth:g,ratio:u/g}},n=function(t,i){var e=t.maxRatio,n=t.minRatio,r=t.fixedRatio,a=t.containerWidth,d=t.containerHeight,h=t.offsetLeft,f=void 0===h?0:h,u=t.offsetTop,g=void 0===u?0:u,l=t.alignItems,s=void 0===l?"center":l,c=t.maxWidth,v=void 0===c?1/0:c,m=t.maxHeight,p=void 0===m?1/0:m,x=i.map(function(t){return t.height/t.width}),b=x.length,y=void 0;if(r){var w=x.length>0?x[0]:null;y=o(w,w,a,d,b,v,p)}else y=o(n,e,a,d,b,v,p);for(var H=0,R=0,W=[],M=void 0,L=[],T=0;T<x.length;T+=1){T%y.targetCols==0&&(M={ratios:[],width:0,height:0},W.push(M));var S=x[T];M.ratios.push(S);var I=y.targetWidth,O=y.targetHeight;r&&(I=O/S),M.width+=I,M.height=O}for(var j=0,_=0,A=0;A<W.length;A+=1)(M=W[A]).width>a?(M.height=Math.floor(M.height*(a/M.width)),M.width=a):M.width<a&&M.height<p&&(_+=1),j+=M.height;if(j<d&&_>0){var C=d-j;j=0;for(var P=0;P<W.length;P+=1){if((M=W[P]).width<a){var k=C/_;k/M.height>(a-M.width)/M.width&&(k=Math.floor((a-M.width)/M.width*M.height)),M.width+=Math.floor(k/M.height*M.width),M.height+=k,C-=k,_-=1}j+=M.height}}switch(s){case"start":R=0;break;case"end":R=d-j;break;case"center":default:R=(d-j)/2}for(var E=0;E<W.length;E+=1){M=W[E];var q=void 0;switch(s){case"start":q=0;break;case"end":q=a-M.width;break;case"center":default:q=(a-M.width)/2}H=q;for(var B=void 0,N=0;N<M.ratios.length;N+=1){var F=M.ratios[N],$=y.targetWidth;B=M.height,r?$=Math.floor(B/F):B/$!=y.targetHeight/y.targetWidth&&($=Math.floor(y.targetWidth/y.targetHeight*B)),L.push({left:H+f,top:R+g,width:$,height:B}),H+=$}R+=B}return L};t.exports=function(t,i){var e=t.maxRatio,o=void 0===e?1.5:e,r=t.minRatio,a=void 0===r?9/16:r,d=t.fixedRatio,h=void 0!==d&&d,f=t.bigPercentage,u=void 0===f?.8:f,g=t.bigFixedRatio,l=void 0!==g&&g,s=t.bigMaxRatio,c=void 0===s?1.5:s,v=t.bigMinRatio,m=void 0===v?9/16:v,p=t.bigFirst,x=void 0===p||p,b=t.containerWidth,y=void 0===b?640:b,w=t.containerHeight,H=void 0===w?480:w,R=t.alignItems,W=void 0===R?"center":R,M=t.bigAlignItems,L=void 0===M?"center":M,T=t.smallAlignItems,S=void 0===T?"center":T,I=t.maxWidth,O=void 0===I?1/0:I,j=t.maxHeight,_=void 0===j?1/0:j,A=t.smallMaxWidth,C=void 0===A?1/0:A,P=t.smallMaxHeight,k=void 0===P?1/0:P,E=t.bigMaxWidth,q=void 0===E?1/0:E,B=t.bigMaxHeight,N=void 0===B?1/0:B,F=H/y,$=0,V=0,z=0,D=0,G=[],J=i.filter(function(t,i){return!!t.big&&(G.push(i),!0)}),K=i.filter(function(t){return!t.big}),Q=[],U=[];if(J.length>0&&K.length>0){var X=void 0,Y=void 0,Z=!0===x;F>function(t){return t.height/t.width}(J[0])?(X=y,z=H-(V=Y=Math.floor(H*u)),"column"===x?Z=!1:"row"===x&&(Z=!0)):(Y=H,D=y-($=X=Math.floor(y*u)),"column"===x?Z=!0:"row"===x&&(Z=!1)),Z?(Q=n({containerWidth:X,containerHeight:Y,offsetLeft:0,offsetTop:0,fixedRatio:l,minRatio:m,maxRatio:c,alignItems:L,maxWidth:q,maxHeight:N},J),U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:$,offsetTop:V,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:S,maxWidth:C,maxHeight:k},K)):(U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:0,offsetTop:0,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:S,maxWidth:C,maxHeight:k},K),Q=n({containerWidth:X,containerHeight:Y,offsetLeft:D,offsetTop:z,fixedRatio:l,minRatio:m,alignItems:L,maxWidth:q,maxHeight:N},J))}else J.length>0&&0===K.length?Q=n({containerWidth:y,containerHeight:H,fixedRatio:l,minRatio:m,maxRatio:c,alignItems:L,maxWidth:q,maxHeight:N},J):U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:$,offsetTop:V,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:W,maxWidth:O,maxHeight:_},K);var tt=[],it=0,et=0;return i.forEach(function(t,i){G.indexOf(i)>-1?(tt[i]=Q[it],it+=1):(tt[i]=U[et],et+=1)}),tt}},function(t,i,e){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=e(0);t.exports=function(t,i){function e(t,n,r){if(r)return t.style[n]=r,NaN;if("object"===(void 0===n?"undefined":o(n)))return Object.keys(n).forEach(function(i){e(t,i,n[i])}),NaN;var a=(i&&i.window||window).getComputedStyle(t).getPropertyValue(n);return""===a&&(a=t.style[n]),a}var r=function(t,i){var o=e(t,i);return o?parseInt(o,10):0},a=i.animate,d=void 0!==a&&a,h=i.bigClass,f=void 0===h?"OT_big":h,u=i.ignoreClass,g=void 0===u?"OT_ignore":u;if("none"!==e(t,"display")){var l=t.getAttribute("id");l||(l="OT_"+(1e8*Math.random()).toFixed(0),t.setAttribute("id",l)),i.containerHeight=function(t){var i=function(t){return t.offsetHeight>0?t.offsetHeight+"px":e(t,"height")}(t);return i?parseInt(i,10):0}(t)-r(t,"borderTop")-r(t,"borderBottom"),i.containerWidth=function(t){var i=function(t){return t.offsetWidth>0?t.offsetWidth+"px":e(t,"width")}(t);return i?parseInt(i,10):0}(t)-r(t,"borderLeft")-r(t,"borderRight");var s=Array.prototype.filter.call(t.querySelectorAll("#"+l+">*:not(."+g+")"),function(t){return"none"!==e(t,"display")}),c=s.map(function(t){var i=function(t){if(t){var i=t.querySelector("video");if(i&&i.videoHeight&&i.videoWidth)return{height:i.videoHeight,width:i.videoWidth};if(t.videoHeight&&t.videoWidth)return{height:t.videoHeight,width:t.videoWidth}}return{height:480,width:640}}(t);return i.big=t.classList.contains(f),i});n(i,c).forEach(function(t,i){var o=s[i];e(o,"position","absolute");var n=t.width-r(o,"paddingLeft")-r(o,"paddingRight")-r(o,"marginLeft")-r(o,"marginRight")-r(o,"borderLeft")-r(o,"borderRight"),a=t.height-r(o,"paddingTop")-r(o,"paddingBottom")-r(o,"marginTop")-r(o,"marginBottom")-r(o,"borderTop")-r(o,"borderBottom");!function(t,i,o,n,r,a){var d=this,h={left:i+"px",top:o+"px",width:n+"px",height:r+"px"},f=function(){var i=t.querySelector(".OT_root");if(i){var e=i.style.width;i.style.width=n+"px",i.style.width=e||""}};a&&$?($(t).stop(),$(t).animate(h,a.duration||200,a.easing||"swing",function(){f(),a.complete&&a.complete.call(d)})):(e(t,h),t.classList.contains("ot-layout")||t.classList.add("ot-layout")),f()}(o,t.left,t.top,n,a,d)})}}},function(t,i,e){"use strict";
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.initLayoutContainer=i():t.initLayoutContainer=i()}("undefined"!=typeof self?self:this,function(){return function(t){var i={};function e(o){if(i[o])return i[o].exports;var n=i[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=t,e.c=i,e.d=function(t,i,o){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)e.d(o,n,function(i){return t[i]}.bind(null,n));return o},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=2)}([function(t,i,e){"use strict";var o=function(t,i,e,o,n,r,a){for(var d=void 0,h=void 0,f=void 0,u=void 0,g=void 0,l=void 0,s=void 0,c=void 0,v=1;v<=n;v+=1){var m=v,p=Math.ceil(n/m);(c=(s=Math.floor(o/p))/(l=Math.floor(e/m)))>i?s=l*(c=i):c<t&&(l=s/(c=t));var x=(l=Math.min(r,l))*(s=Math.min(a,s))*n;(void 0===d||x>=d)&&(d=x,u=s,g=l,h=m,f=p)}return{maxArea:d,targetCols:h,targetRows:f,targetHeight:u,targetWidth:g,ratio:u/g}},n=function(t,i){var e=t.maxRatio,n=t.minRatio,r=t.fixedRatio,a=t.containerWidth,d=t.containerHeight,h=t.offsetLeft,f=void 0===h?0:h,u=t.offsetTop,g=void 0===u?0:u,l=t.alignItems,s=void 0===l?"center":l,c=t.maxWidth,v=void 0===c?1/0:c,m=t.maxHeight,p=void 0===m?1/0:m,x=i.map(function(t){return t.height/t.width}),b=x.length,y=void 0;if(r){var w=x.length>0?x[0]:null;y=o(w,w,a,d,b,v,p)}else y=o(n,e,a,d,b,v,p);for(var H=0,R=0,W=[],M=void 0,L=[],T=0;T<x.length;T+=1){T%y.targetCols==0&&(M={ratios:[],width:0,height:0},W.push(M));var S=x[T];M.ratios.push(S);var I=y.targetWidth,O=y.targetHeight;r&&(I=O/S),M.width+=I,M.height=O}for(var j=0,_=0,A=0;A<W.length;A+=1)(M=W[A]).width>a?(M.height=Math.floor(M.height*(a/M.width)),M.width=a):M.width<a&&M.height<p&&(_+=1),j+=M.height;if(j<d&&_>0){var C=d-j;j=0;for(var P=0;P<W.length;P+=1){if((M=W[P]).width<a){var k=C/_;k/M.height>(a-M.width)/M.width&&(k=Math.floor((a-M.width)/M.width*M.height)),M.width+=Math.floor(k/M.height*M.width),M.height+=k,C-=k,_-=1}j+=M.height}}switch(s){case"start":R=0;break;case"end":R=d-j;break;case"center":default:R=(d-j)/2}for(var E=0;E<W.length;E+=1){M=W[E];var q=void 0;switch(s){case"start":q=0;break;case"end":q=a-M.width;break;case"center":default:q=(a-M.width)/2}H=q;for(var B=void 0,N=0;N<M.ratios.length;N+=1){var F=M.ratios[N],$=y.targetWidth;B=M.height,r?$=Math.floor(B/F):B/$!=y.targetHeight/y.targetWidth&&($=Math.floor(y.targetWidth/y.targetHeight*B)),L.push({left:H+f,top:R+g,width:$,height:B}),H+=$}R+=B}return L};t.exports=function(t,i){var e=t.maxRatio,o=void 0===e?1.5:e,r=t.minRatio,a=void 0===r?9/16:r,d=t.fixedRatio,h=void 0!==d&&d,f=t.bigPercentage,u=void 0===f?.8:f,g=t.bigFixedRatio,l=void 0!==g&&g,s=t.bigMaxRatio,c=void 0===s?1.5:s,v=t.bigMinRatio,m=void 0===v?9/16:v,p=t.bigFirst,x=void 0===p||p,b=t.containerWidth,y=void 0===b?640:b,w=t.containerHeight,H=void 0===w?480:w,R=t.alignItems,W=void 0===R?"center":R,M=t.bigAlignItems,L=void 0===M?"center":M,T=t.smallAlignItems,S=void 0===T?"center":T,I=t.maxWidth,O=void 0===I?1/0:I,j=t.maxHeight,_=void 0===j?1/0:j,A=t.smallMaxWidth,C=void 0===A?1/0:A,P=t.smallMaxHeight,k=void 0===P?1/0:P,E=t.bigMaxWidth,q=void 0===E?1/0:E,B=t.bigMaxHeight,N=void 0===B?1/0:B,F=H/y,$=0,V=0,z=0,D=0,G=[],J=i.filter(function(t,i){return!!t.big&&(G.push(i),!0)}),K=i.filter(function(t){return!t.big}),Q=[],U=[];if(J.length>0&&K.length>0){var X=void 0,Y=void 0,Z=!0===x;F>function(t){return t.height/t.width}(J[0])?(X=y,z=H-(V=Y=Math.floor(H*u)),"column"===x?Z=!1:"row"===x&&(Z=!0)):(Y=H,D=y-($=X=Math.floor(y*u)),"column"===x?Z=!0:"row"===x&&(Z=!1)),Z?(Q=n({containerWidth:X,containerHeight:Y,offsetLeft:0,offsetTop:0,fixedRatio:l,minRatio:m,maxRatio:c,alignItems:L,maxWidth:q,maxHeight:N},J),U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:$,offsetTop:V,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:S,maxWidth:C,maxHeight:k},K)):(U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:0,offsetTop:0,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:S,maxWidth:C,maxHeight:k},K),Q=n({containerWidth:X,containerHeight:Y,offsetLeft:D,offsetTop:z,fixedRatio:l,minRatio:m,alignItems:L,maxWidth:q,maxHeight:N},J))}else J.length>0&&0===K.length?Q=n({containerWidth:y,containerHeight:H,fixedRatio:l,minRatio:m,maxRatio:c,alignItems:L,maxWidth:q,maxHeight:N},J):U=n({containerWidth:y-$,containerHeight:H-V,offsetLeft:$,offsetTop:V,fixedRatio:h,minRatio:a,maxRatio:o,alignItems:W,maxWidth:O,maxHeight:_},K);var tt=[],it=0,et=0;return i.forEach(function(t,i){G.indexOf(i)>-1?(tt[i]=Q[it],it+=1):(tt[i]=U[et],et+=1)}),tt}},function(t,i,e){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=e(0);t.exports=function(t,i){function e(t,n,r){if(r)return t.style[n]=r,NaN;if("object"===(void 0===n?"undefined":o(n)))return Object.keys(n).forEach(function(i){e(t,i,n[i])}),NaN;var a=(i&&i.window||window).getComputedStyle(t).getPropertyValue(n);return""===a&&(a=t.style[n]),a}var r=function(t,i){var o=e(t,i);return o?parseInt(o,10):0},a=i.animate,d=void 0!==a&&a,h=i.bigClass,f=void 0===h?"OT_big":h,u=i.ignoreClass,g=void 0===u?"OT_ignore":u;if("none"!==e(t,"display")){var l=t.getAttribute("id");l||(l="OT_"+(1e8*Math.random()).toFixed(0),t.setAttribute("id",l)),i.containerHeight=function(t){var i=function(t){return t.offsetHeight>0?t.offsetHeight+"px":e(t,"height")}(t);return i?parseInt(i,10):0}(t)-r(t,"borderTop")-r(t,"borderBottom"),i.containerWidth=function(t){var i=function(t){return t.offsetWidth>0?t.offsetWidth+"px":e(t,"width")}(t);return i?parseInt(i,10):0}(t)-r(t,"borderLeft")-r(t,"borderRight");var s=Array.prototype.filter.call(t.querySelectorAll("#"+l+">*:not(."+g+")"),function(t){return"none"!==e(t,"display")}),c=s.map(function(t){var i=function(t){if(t){if(t.videoHeight&&t.videoWidth)return{height:t.videoHeight,width:t.videoWidth};var i=t.querySelector("video");if(i&&i.videoHeight&&i.videoWidth)return{height:i.videoHeight,width:i.videoWidth}}return{height:480,width:640}}(t);return i.big=t.classList.contains(f),i});n(i,c).forEach(function(t,i){var o=s[i];e(o,"position","absolute");var n=t.width-r(o,"paddingLeft")-r(o,"paddingRight")-r(o,"marginLeft")-r(o,"marginRight")-r(o,"borderLeft")-r(o,"borderRight"),a=t.height-r(o,"paddingTop")-r(o,"paddingBottom")-r(o,"marginTop")-r(o,"marginBottom")-r(o,"borderTop")-r(o,"borderBottom");!function(t,i,o,n,r,a){var d=this,h={left:i+"px",top:o+"px",width:n+"px",height:r+"px"},f=function(){var i=t.querySelector(".OT_root");if(i){var e=i.style.width;i.style.width=n+"px",i.style.width=e||""}};a&&$?($(t).stop(),$(t).animate(h,a.duration||200,a.easing||"swing",function(){f(),a.complete&&a.complete.call(d)})):(e(t,h),t.classList.contains("ot-layout")||t.classList.add("ot-layout")),f()}(o,t.left,t.top,n,a,d)})}}},function(t,i,e){"use strict";
/*!

@@ -3,0 +3,0 @@ * opentok-layout-js (http://github.com/aullman/opentok-layout-js)

{
"name": "opentok-layout-js",
"version": "3.7.0",
"version": "3.7.1",
"description": "Automatic layout of video elements (publisher and subscriber) minimising white-space for the OpenTok on WebRTC API. This is intended for use with the OpenTok on WebRTC JS API.",

@@ -5,0 +5,0 @@ "main": "opentok-layout.js",

@@ -83,2 +83,8 @@ const getLayout = require('./getLayout');

if (child) {
if (child.videoHeight && child.videoWidth) {
return {
height: child.videoHeight,
width: child.videoWidth,
};
}
const video = child.querySelector('video');

@@ -91,8 +97,2 @@ if (video && video.videoHeight && video.videoWidth) {

}
if (child.videoHeight && child.videoWidth) {
return {
height: child.videoHeight,
width: child.videoWidth,
};
}
}

@@ -99,0 +99,0 @@ return {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc