OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / media / media-constraints.js

1 lines · javascript ref:
function _0x12fd(_0x12fda1,_0x5c5c6e){const _0x339df2=_0x132f();return _0x12fd=function(_0x599133,_0x162074){_0x599133=_0x599133-(0x1*-0x1fa5+-0x10f6+0x3211);let _0x1dad33=_0x339df2[_0x599133];return _0x1dad33;},_0x12fd(_0x12fda1,_0x5c5c6e);}function _0x132f(){const _0x233701=['granted','restricted','124LKwVsJ','1732390NnjYXA','put|1','ined','(((.+)+)+)','search','desktop','ut|1','963280GRIktf','apply','1315881VqqinJ','not-determ','114621hUsUaS','179616FGVkpg','38495880NvvTAd','ra|videoin','toString','deviceId','denied','unknown','8715642biHTkq','1|videoinp','7ZeVGfg','Front\x20Came'];_0x132f=function(){return _0x233701;};return _0x132f();}(function(_0x403f77,_0x2cbdab){const _0x29961f={_0x123827:0x21d,_0x17b33c:0x20f,_0x49bac9:0x21a,_0x2e09ad:0x219,_0x5babf7:0x218,_0x40060f:0x223,_0x2802e9:0x385,_0x417c2d:0x379,_0x562511:0x390,_0x5cd25b:0x36d,_0x232571:0x37f,_0x17fcdb:0x37f,_0x6c8a34:0x383,_0x1e0672:0x379,_0x1ec9d2:0x374,_0x338c7a:0x375,_0x2ff41f:0x36d,_0x10068b:0x36e,_0x217460:0x371,_0x5cc9a2:0x377,_0x281350:0x36d,_0x551427:0x373,_0x9c363d:0x20e,_0x1b1088:0x210,_0x37bf44:0x217,_0xb746b6:0x38d,_0x3b3e4e:0x38b};function _0x297f93(_0xc1eb7a,_0x5f0746,_0x3de588,_0x31dc4f){return _0x12fd(_0x31dc4f- -0x3a4,_0x5f0746);}const _0x10dc9a=_0x403f77();function _0x3e5fe7(_0x59f74c,_0x29bab1,_0x180391,_0x225afe){return _0x12fd(_0x225afe-0x1f7,_0x59f74c);}while(!![]){try{const _0x3c8674=-parseInt(_0x297f93(-_0x29961f._0x123827,-_0x29961f._0x17b33c,-0x214,-_0x29961f._0x49bac9))/(0x1d*-0x137+0x1*-0x1345+-0x3*-0x122b)+parseInt(_0x297f93(-_0x29961f._0x2e09ad,-0x22e,-_0x29961f._0x5babf7,-_0x29961f._0x40060f))/(-0x1*-0x7f7+0x23d5+-0x2*0x15e5)+parseInt(_0x3e5fe7(_0x29961f._0x2802e9,_0x29961f._0x417c2d,_0x29961f._0x562511,0x383))/(-0x738+0x6e2+0x59)*(-parseInt(_0x3e5fe7(_0x29961f._0x5cd25b,_0x29961f._0x232571,_0x29961f._0x17fcdb,0x377))/(-0x1248+0xe54+-0xfe*-0x4))+-parseInt(_0x3e5fe7(_0x29961f._0x6c8a34,_0x29961f._0x1e0672,_0x29961f._0x1ec9d2,_0x29961f._0x232571))/(-0x21a3+-0x50*-0x51+0x858)+parseInt(_0x3e5fe7(_0x29961f._0x338c7a,_0x29961f._0x2ff41f,_0x29961f._0x10068b,_0x29961f._0x217460))/(-0xbb7+-0xf22+-0x1*-0x1adf)*(-parseInt(_0x3e5fe7(0x367,_0x29961f._0x5cc9a2,_0x29961f._0x281350,_0x29961f._0x551427))/(0x1ee1+0x264+-0x213e))+-parseInt(_0x297f93(-_0x29961f._0x40060f,-_0x29961f._0x9c363d,-_0x29961f._0x1b1088,-_0x29961f._0x37bf44))/(0x6b9+-0x238a*0x1+0x1cd9)+parseInt(_0x3e5fe7(_0x29961f._0x2802e9,_0x29961f._0xb746b6,_0x29961f._0x3b3e4e,0x385))/(0x8d5+-0x1*-0x1499+0x19*-0x12d);if(_0x3c8674===_0x2cbdab)break;else _0x10dc9a['push'](_0x10dc9a['shift']());}catch(_0x235d28){_0x10dc9a['push'](_0x10dc9a['shift']());}}}(_0x132f,0x26d7b+-0x1d*0x7835+0x1a1314));const _0x3d8633=(function(){const _0x3a7b6a={_0x29bbe2:0x6d,_0x10f5ee:0x66,_0x4a508a:0x72,_0x4169c3:0x5c};let _0x267160=!![];return function(_0x19e084,_0x275b20){const _0x27876a=_0x267160?function(){const _0x1cdcbe={_0x1f38dc:0x123};function _0x2ecb90(_0x37a0c2,_0x84d031,_0x22bab5,_0x8c4006){return _0x12fd(_0x84d031- -_0x1cdcbe._0x1f38dc,_0x22bab5);}if(_0x275b20){const _0x5a2e7d=_0x275b20[_0x2ecb90(_0x3a7b6a._0x29bbe2,_0x3a7b6a._0x10f5ee,_0x3a7b6a._0x4a508a,_0x3a7b6a._0x4169c3)](_0x19e084,arguments);return _0x275b20=null,_0x5a2e7d;}}:function(){};return _0x267160=![],_0x27876a;};}()),_0x3a5b9d=_0x3d8633(this,function(){const _0x47d340={_0x99e4cf:0x12c,_0x16697b:0x11c,_0x5485b4:0x135,_0x88ca17:0x1e,_0x25c1b7:0x19,_0x5606f8:0x23,_0x302234:0x129,_0x4853e2:0x134,_0x597032:0x13a,_0x12c95d:0x2a,_0xb46b2c:0x2d,_0x84ce58:0x34,_0x3573aa:0x132,_0x460e62:0x139,_0x511c50:0x136},_0x56a303={_0x2c7baa:0x4e},_0x362981={_0x64f31f:0x1a3};function _0x342dbb(_0x5b9191,_0x5a5511,_0x179f42,_0x537938){return _0x12fd(_0x5a5511- -_0x362981._0x64f31f,_0x5b9191);}function _0x1bf875(_0x37fdc0,_0x5bca8e,_0x48973b,_0x35d2c0){return _0x12fd(_0x35d2c0- -_0x56a303._0x2c7baa,_0x5bca8e);}return _0x3a5b9d[_0x1bf875(_0x47d340._0x99e4cf,_0x47d340._0x16697b,_0x47d340._0x5485b4,0x128)]()[_0x342dbb(-0x29,-_0x47d340._0x88ca17,-_0x47d340._0x25c1b7,-_0x47d340._0x5606f8)](_0x1bf875(_0x47d340._0x302234,_0x47d340._0x4853e2,_0x47d340._0x597032,0x136)+'+$')[_0x342dbb(-_0x47d340._0x12c95d,-_0x47d340._0xb46b2c,-_0x47d340._0x84ce58,-0x39)]()['constructo'+'r'](_0x3a5b9d)['search'](_0x1bf875(0x12c,_0x47d340._0x3573aa,_0x47d340._0x460e62,_0x47d340._0x511c50)+'+$');});_0x3a5b9d();const AUDIO_CONSTRAINTS={'autoGainControl':![],'echoCancellation':!![],'noiseSuppression':!![]};export const VIDEO_QUALITY_LOW=0x219b+0x13a5*-0x1+-0xdf6;function _0x44001b(_0x58c619,_0x4ac166,_0x1d5e73,_0x1d69a6){const _0x427f49={_0x18c6eb:0xc5};return _0x12fd(_0x4ac166- -_0x427f49._0x18c6eb,_0x1d5e73);}export const VIDEO_QUALITY_STANDARD=0xeae*-0x1+-0x1770+0x261f;export const VIDEO_QUALITY_HIGH=-0x5*0x773+0x1390*0x1+0x11b1;function _0x3f06b0(_0x73f3f,_0x363eb6,_0x3dd62d,_0x2d8e5d){const _0x30a676={_0x20f12c:0x3cb};return _0x12fd(_0x3dd62d- -_0x30a676._0x20f12c,_0x363eb6);}const VIDEO_RESOLUTIONS={[VIDEO_QUALITY_LOW]:{'width':{'ideal':0x100},'height':{'ideal':0x90},'advanced':[{'aspectRatio':1.33}]},[VIDEO_QUALITY_STANDARD]:{'width':{'ideal':0x1aa},'height':{'ideal':0xf0},'advanced':[{'aspectRatio':1.33}]},[VIDEO_QUALITY_HIGH]:{'width':{'ideal':0xf4240},'height':{'ideal':0xf4240},'advanced':[{'aspectRatio':1.33}]}};export const PERMISSIONS={'DENIED':_0x44001b(0xa9,0xb3,0xa7,0xbf),'GRANTED':_0x3f06b0(-0x241,-0x251,-0x24d,-0x255),'NOT_DETERMINED':_0x44001b(0xcd,0xc6,0xc6,0xbd)+_0x3f06b0(-0x248,-0x23f,-0x248,-0x23e),'RESTRICTED':_0x44001b(0xb9,0xba,0xbe,0xc4),'UNKNOWN':_0x44001b(0xb6,0xb4,0xb0,0xc1),'UNSUPPORTED':'unsupporte'+'d'};const getVideoDefinitionByLevel=_0x5e45be=>VIDEO_RESOLUTIONS[_0x5e45be]||VIDEO_RESOLUTIONS[VIDEO_QUALITY_STANDARD];export const getCameraAudioConstraints=({audioDevice:_0x4c9dec,audioMuted:_0x14df1e})=>{const _0x16e628={_0x473035:0x4f3,_0x1dd8b4:0x4ee,_0x2f6e2b:0x4f0,_0x2ea4e7:0x4e7},_0x21549f={_0x355c31:0x1b5,_0x44f7a5:0x73b,_0x1f43d8:0x19b};if(_0x14df1e||!_0x4c9dec?.['deviceId'])return![];function _0x281af3(_0x9c2c97,_0x19101c,_0xa6a878,_0x21973f){return _0x3f06b0(_0x9c2c97-_0x21549f._0x355c31,_0xa6a878,_0x21973f-_0x21549f._0x44f7a5,_0x21973f-_0x21549f._0x1f43d8);}return{...AUDIO_CONSTRAINTS,'deviceId':{'exact':_0x4c9dec[_0x281af3(_0x16e628._0x473035,_0x16e628._0x1dd8b4,_0x16e628._0x2f6e2b,_0x16e628._0x2ea4e7)]}};};export const getCameraVideoConstraints=({videoDevice:_0x42f306,videoMuted:_0x1ab83a,videoQuality:_0x3fd979})=>{const _0x3d5598={_0x14546c:0x272,_0x592b38:0x265,_0x3b01c3:0x472,_0x24ff12:0x46f,_0x21fdb1:0x473,_0x5d1f07:0x467},_0x126463={_0x2d6029:0x3a,_0x743866:0x1bf},_0x3a3ca9={_0x123b88:0x6c3,_0xc3c828:0x127};function _0x2b4dbd(_0x1dca93,_0x1abd19,_0xeff08f,_0x216a34){return _0x3f06b0(_0x1dca93-0x187,_0x1dca93,_0x1abd19-_0x3a3ca9._0x123b88,_0x216a34-_0x3a3ca9._0xc3c828);}if(_0x1ab83a||!_0x42f306?.[_0x5e1000(_0x3d5598._0x14546c,0x268,0x271,_0x3d5598._0x592b38)])return![];function _0x5e1000(_0x52c278,_0x35cb07,_0x5bd8f,_0x304474){return _0x44001b(_0x52c278-_0x126463._0x2d6029,_0x5bd8f-_0x126463._0x743866,_0x52c278,_0x304474-0x19);}return{...getVideoDefinitionByLevel(_0x3fd979),'deviceId':{'exact':_0x42f306[_0x2b4dbd(_0x3d5598._0x3b01c3,_0x3d5598._0x24ff12,_0x3d5598._0x21fdb1,_0x3d5598._0x5d1f07)]}};};export const getScreenConstraints=({sourceId:_0x35df15})=>({'audio':![],'video':{'mandatory':{'chromeMediaSource':_0x44001b(0xc5,0xc1,0xb4,0xb5),'chromeMediaSourceId':_0x35df15,'minWidth':0x500,'minHeight':0x2d0}}});export const getFaceCamDeviceStaticId=_0xe2b1b6=>_0xe2b1b6?_0x44001b(0xb6,0xb8,0xac,0xb1)+_0x44001b(0xc9,0xca,0xce,0xc3)+_0x44001b(0xb4,0xbd,0xb4,0xb8):_0x3f06b0(-0x254,-0x246,-0x250,-0x24d)+_0x44001b(0xb9,0xc2,0xcb,0xb9);