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 0.4.1 to 0.5.0

tests/test-node.js

2

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

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

@@ -292,2 +292,2 @@ /*!

})((window && window.hasOwnProperty('jQuery')) ? jQuery : undefined);
})((typeof window !== 'undefined' && window.hasOwnProperty('jQuery')) ? jQuery : undefined);

@@ -11,2 +11,2 @@ /*!

**/
("undefined"==typeof module||"undefined"==typeof module.exports)&&(exports=window),function(t){var i=function(i,e,o,a,r,n){var g={left:e+"px",top:o+"px",width:a+"px",height:r+"px"},d=function(){var t=i.querySelector(".OT_root");if(t){var e=t.style.width;t.style.width=a+"px",t.style.width=e||""}};n&&t?(t(i).stop(),t(i).animate(g,n.duration||200,n.easing||"swing",function(){d(),n.complete&&n.complete.call(this)})):OT.$.css(i,g),d()},e=function(t,i){var e=OT.$.css(t,i);return e?parseInt(e,10):0},o=function(){return(1e8*Math.random()).toFixed(0)},a=function(t){var i=OT.$.height(t);return i?parseInt(i,10):0},r=function(t){var i=OT.$.width(t);return i?parseInt(i,10):0},n=function(t,o,a,r,n,g,d,l,s){var h,f=t.length,u=function(t,i){for(var e,r,n,g,d,l,s,u,p=1;f>=p;p++){var b=p,c=Math.ceil(f/b);s=Math.floor(a/c),l=Math.floor(o/b),u=s/l,u>i?(u=i,s=l*u):t>u&&(u=t,l=s/u);var v=l*s*f;(void 0===e||v>e)&&(e=v,g=s,d=l,r=b,n=c)}return{maxArea:e,targetCols:r,targetRows:n,targetHeight:g,targetWidth:d,ratio:h}};if(g){var p=t.length>0&&t[0].querySelector("video");h=p&&p.videoHeight&&p.videoWidth?u(p.videoHeight/p.videoWidth,p.videoHeight/p.videoWidth):u(.75,.75)}else h=u(d,l);for(var b=h.targetRows*h.targetCols-f,c=b*h.targetWidth/2,v=(h.targetRows-1)*h.targetCols,m=(a-h.targetRows*h.targetHeight)/2,R=(o-h.targetCols*h.targetWidth)/2,x=0,y=0,w=0;w<t.length;w++){var T=t[w];w%h.targetCols===0?(x=R,w==v&&(x+=c),y+=0===w?m:h.targetHeight):x+=h.targetWidth,OT.$.css(T,"position","absolute");var M=h.targetWidth-e(T,"paddingLeft")-e(T,"paddingRight")-e(T,"marginLeft")-e(T,"marginRight")-e(T,"borderLeft")-e(T,"borderRight"),O=h.targetHeight-e(T,"paddingTop")-e(T,"paddingBottom")-e(T,"marginTop")-e(T,"marginBottom")-e(T,"borderTop")-e(T,"borderBottom");i(T,x+r,y+n,M,O,s)}},g=function(t){return"none"!==OT.$.css(t,"display")},d=function(t,i){if("none"!==OT.$.css(t,"display")){var d=t.getAttribute("id");d||(d="OT_"+o(),t.setAttribute("id",d));var l=a(t)-e(t,"borderTop")-e(t,"borderBottom"),s=r(t)-e(t,"borderLeft")-e(t,"borderRight"),h=l/s,f=0,u=0,p=0,b=0,c=0,v=Array.prototype.filter.call(t.querySelectorAll("#"+d+">."+i.bigClass),g),m=Array.prototype.filter.call(t.querySelectorAll("#"+d+">*:not(."+i.bigClass+")"),g);if(v.length>0&&m.length>0){var R=v[0].querySelector("video");c=R&&R.videoHeight&&R.videoWidth?R.videoHeight/R.videoWidth:.75;var x,y;h>c?(x=s,y=Math.min(Math.floor(l*i.bigPercentage),s*c),u=y,p=l-u):(y=l,x=Math.min(s*i.bigPercentage,Math.floor(y/c)),f=x,b=s-f),i.bigFirst?(n(v,x,y,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate),n(m,s-f,l-u,f,u,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)):(n(m,s-f,l-u,0,0,i.fixedRatio,i.minRatio,i.maxRatio,i.animate),n(v,x,y,b,p,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate))}else v.length>0&&0===m.length?n(v,s,l,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate):n(m,s-f,l-u,f,u,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)}};exports.initLayoutContainer=function(t,i){return i=OT.$.defaults(i||{},{maxRatio:1.5,minRatio:9/16,fixedRatio:!1,animate:!1,bigClass:"OT_big",bigPercentage:.8,bigFixedRatio:!1,bigMaxRatio:1.5,bigMinRatio:9/16,bigFirst:!0}),t="string"==typeof t?OT.$(t):t,OT.onLoad(function(){d(t,i)}),{layout:d.bind(null,t,i)}}}(window&&window.hasOwnProperty("jQuery")?jQuery:void 0);
("undefined"==typeof module||"undefined"==typeof module.exports)&&(exports=window),function(t){var i=function(i,e,o,a,r,n){var g={left:e+"px",top:o+"px",width:a+"px",height:r+"px"},d=function(){var t=i.querySelector(".OT_root");if(t){var e=t.style.width;t.style.width=a+"px",t.style.width=e||""}};n&&t?(t(i).stop(),t(i).animate(g,n.duration||200,n.easing||"swing",function(){d(),n.complete&&n.complete.call(this)})):OT.$.css(i,g),d()},e=function(t,i){var e=OT.$.css(t,i);return e?parseInt(e,10):0},o=function(){return(1e8*Math.random()).toFixed(0)},a=function(t){var i=OT.$.height(t);return i?parseInt(i,10):0},r=function(t){var i=OT.$.width(t);return i?parseInt(i,10):0},n=function(t,o,a,r,n,g,d,l,s){var h,f=t.length,u=function(t,i){for(var e,r,n,g,d,l,s,u,p=1;f>=p;p++){var b=p,c=Math.ceil(f/b);s=Math.floor(a/c),l=Math.floor(o/b),u=s/l,u>i?(u=i,s=l*u):t>u&&(u=t,l=s/u);var v=l*s*f;(void 0===e||v>e)&&(e=v,g=s,d=l,r=b,n=c)}return{maxArea:e,targetCols:r,targetRows:n,targetHeight:g,targetWidth:d,ratio:h}};if(g){var p=t.length>0&&t[0].querySelector("video");h=p&&p.videoHeight&&p.videoWidth?u(p.videoHeight/p.videoWidth,p.videoHeight/p.videoWidth):u(.75,.75)}else h=u(d,l);for(var b=h.targetRows*h.targetCols-f,c=b*h.targetWidth/2,v=(h.targetRows-1)*h.targetCols,m=(a-h.targetRows*h.targetHeight)/2,R=(o-h.targetCols*h.targetWidth)/2,x=0,y=0,w=0;w<t.length;w++){var T=t[w];w%h.targetCols===0?(x=R,w==v&&(x+=c),y+=0===w?m:h.targetHeight):x+=h.targetWidth,OT.$.css(T,"position","absolute");var M=h.targetWidth-e(T,"paddingLeft")-e(T,"paddingRight")-e(T,"marginLeft")-e(T,"marginRight")-e(T,"borderLeft")-e(T,"borderRight"),O=h.targetHeight-e(T,"paddingTop")-e(T,"paddingBottom")-e(T,"marginTop")-e(T,"marginBottom")-e(T,"borderTop")-e(T,"borderBottom");i(T,x+r,y+n,M,O,s)}},g=function(t){return"none"!==OT.$.css(t,"display")},d=function(t,i){if("none"!==OT.$.css(t,"display")){var d=t.getAttribute("id");d||(d="OT_"+o(),t.setAttribute("id",d));var l=a(t)-e(t,"borderTop")-e(t,"borderBottom"),s=r(t)-e(t,"borderLeft")-e(t,"borderRight"),h=l/s,f=0,u=0,p=0,b=0,c=0,v=Array.prototype.filter.call(t.querySelectorAll("#"+d+">."+i.bigClass),g),m=Array.prototype.filter.call(t.querySelectorAll("#"+d+">*:not(."+i.bigClass+")"),g);if(v.length>0&&m.length>0){var R=v[0].querySelector("video");c=R&&R.videoHeight&&R.videoWidth?R.videoHeight/R.videoWidth:.75;var x,y;h>c?(x=s,y=Math.min(Math.floor(l*i.bigPercentage),s*c),u=y,p=l-u):(y=l,x=Math.min(s*i.bigPercentage,Math.floor(y/c)),f=x,b=s-f),i.bigFirst?(n(v,x,y,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate),n(m,s-f,l-u,f,u,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)):(n(m,s-f,l-u,0,0,i.fixedRatio,i.minRatio,i.maxRatio,i.animate),n(v,x,y,b,p,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate))}else v.length>0&&0===m.length?n(v,s,l,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate):n(m,s-f,l-u,f,u,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)}};exports.initLayoutContainer=function(t,i){return i=OT.$.defaults(i||{},{maxRatio:1.5,minRatio:9/16,fixedRatio:!1,animate:!1,bigClass:"OT_big",bigPercentage:.8,bigFixedRatio:!1,bigMaxRatio:1.5,bigMinRatio:9/16,bigFirst:!0}),t="string"==typeof t?OT.$(t):t,OT.onLoad(function(){d(t,i)}),{layout:d.bind(null,t,i)}}}("undefined"!=typeof window&&window.hasOwnProperty("jQuery")?jQuery:void 0);
{
"name": "opentok-layout-js",
"version": "0.4.1",
"version": "0.5.0",
"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.",

@@ -24,3 +24,3 @@ "main": "opentok-layout.js",

"scripts": {
"test": "./node_modules/.bin/run-tests",
"test": "node ./tests/test-node.js && ./node_modules/.bin/run-tests",
"start": "http-server"

@@ -27,0 +27,0 @@ },

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