@flashphoner/websdk 2.0.212 → 2.0.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docTemplate/README.md +1 -1
- package/examples/demo/streaming/conference/conference.html +4 -0
- package/examples/demo/streaming/conference/conference.js +203 -62
- package/examples/demo/streaming/video-chat/video-chat.html +5 -0
- package/flashphoner-no-flash.js +1128 -818
- package/flashphoner-no-flash.min.js +2 -2
- package/flashphoner-no-webrtc.js +1122 -812
- package/flashphoner-no-webrtc.min.js +2 -2
- package/flashphoner-no-wsplayer.js +1128 -818
- package/flashphoner-no-wsplayer.min.js +2 -2
- package/flashphoner-room-api.js +1112 -908
- package/flashphoner-room-api.min.js +2 -2
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +1129 -814
- package/flashphoner-temasys-flash-websocket.js +1127 -812
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +1122 -817
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +1134 -819
- package/flashphoner.min.js +2 -2
- package/package.json +1 -1
- package/src/constants.d.ts +792 -1
- package/src/constants.js +790 -704
- package/src/flash-media-provider.js +5 -0
- package/src/flashphoner-core.d.ts +359 -209
- package/src/flashphoner-core.js +98 -29
- package/src/room-module.d.ts +2 -2
- package/src/room-module.js +9 -2
- package/src/temasys-media-provider.js +5 -0
- package/src/util.js +207 -185
- package/src/webrtc-media-provider.js +12 -7
- package/src/websocket-media-provider.js +5 -0
package/flashphoner-room-api.js
CHANGED
|
@@ -8293,738 +8293,824 @@ function filterStats(result, track, outbound) {
|
|
|
8293
8293
|
var _0x8674=['feedDecoder','postMessage','now','getBufferTimeLength','Unknown\x20request','bind','audioChunkLength','context','sampleRate','videoWidth','videoHeight','token','dropDelayMultiplier','Failed\x20to\x20init\x20stream\x20receiver\x20','videoDecoder','decoderPath','onmessage','No\x20timestamp\x20available\x20for\x20decoded\x20picture,\x20discarding','shift','STOPPED','audioBuffer','sync','start','setVolume','requestVideoFrameCallback','Failed\x20to\x20init\x20video\x20decoder\x20','fps','framesRendered','noDataSince','prototype','receivedIframe','lastPlayedVideoTime','kframe','decode','payload','play','stream','STARTUP','playFirstSound','createBuffer','getChannelData','random','createBufferSource','buffer','connect','destination','mute','PAUSED','unmute','resume','getVolume','lastFpsTime','lastPlayedVideoTimestamp','log','trace','requestVideoFrameCallback,\x20audio\x20player\x20time\x20','\x20callback\x20timestamp\x20','render','playing','dispatchEvent','riseApiEvent','lastEventRised','PLAYBACK_PROBLEM','logToCanvas','ctx2D','height','fillStyle','black','font','textAlign','center','width','40pt','fillText','initLogger','verbosity','console','apply','warn','wsLogger','debug','renderFunction','force2D','YTexture','CBTexture','CRTexture','RGBTexture','rgbaBuffer','mbWidth','codedWidth','halfWidth','precision\x20mediump\x20float;','uniform\x20sampler2D\x20CBTexture;','void\x20main()\x20{','float\x20y\x20=\x20texture2D(YTexture,\x20texCoord).r;','float\x20cb\x20=\x20texture2D(CBTexture,\x20texCoord).r\x20-\x200.5;','gl_FragColor\x20=\x20vec4(','y\x20+\x20-0.343\x20*\x20cb\x20-\x200.711\x20*\x20cr,','1.0','join','attribute\x20vec2\x20vertex;','varying\x20vec2\x20texCoord;','texCoord\x20=\x20vertex;','gl_Position\x20=\x20vec4((vertex\x20*\x202.0\x20-\x201.0)\x20*\x20vec2(1,\x20-1),\x200.0,\x201.0);','SHADER_VERTEX_IDENTITY_RGBA','varying\x20vec2\x20tc;','void\x20main(){','gl_Position\x20=\x20vertex;','SHADER_FRAGMENT_RGBA','uniform\x20sampler2D\x20RGBTexture;','gl_FragColor\x20=\x20texture2D(RGBTexture,\x20tc);','getContext','experimental-webgl','inputFormat','rgba','initWebGLRGB','initWebGLYUV','renderFrame2D','bindBuffer','ARRAY_BUFFER','bufferData','STATIC_DRAW','program','attachShader','compileShader','SHADER_VERTEX_IDENTITY_YUV','FRAGMENT_SHADER','SHADER_FRAGMENT_YCBCRTORGBA','linkProgram','getProgramParameter','Failed\x20to\x20init\x20WebGL!\x20Message\x20','getProgramInfoLog','useProgram','createTexture','getAttribLocation','vertex','enableVertexAttribArray','vertexAttribPointer','createProgram','bindAttribLocation','FLOAT','renderFrameGLRGB','undefined','createImageData','putImageData','clear','COLOR_BUFFER_BIT','DEPTH_BUFFER_BIT','TEXTURE_2D','texParameteri','TEXTURE_MAG_FILTER','LINEAR','TEXTURE_MIN_FILTER','CLAMP_TO_EDGE','TEXTURE_WRAP_T','getUniformLocation','createShader','getShaderParameter','COMPILE_STATUS','getShaderInfoLog','isUsingWebGL','activeTexture','bindTexture','texImage2D','LUMINANCE','UNSIGNED_BYTE','TEXTURE1','TEXTURE2','drawArrays','TRIANGLE_STRIP','TEXTURE0','RGBA','TRIANGLES','type','YCbCrToRGBA','set','Changing\x20canvas\x20resolution\x20from\x20','\x20to\x20','lastTimeRendered','getLastTimeRendered','nodeConnected','gainNode','createGain','abs','Audio\x20node\x20buffer\x20size\x20','internalBufferSize','createScriptProcessor','audioJSNode','previousSync','lastSync','lastSyncTime','playbackTime','value','disconnect','resetBuffers','playAudio','getBufferLength','currentTime','audioChunkTimeLength','No\x20audio!\x20','previousSyncTime','Audio\x20player\x20mute','gain','Audio\x20player\x20resume','setTimeout','state','initialized','init','canvas','api','configuration','initBuffers','initialVolume','audioPlayer','error','Failed\x20to\x20init\x20audio\x20player\x20','yuv','videoRenderer','Failed\x20to\x20init\x20video\x20renderer\x20','receiver','terminate','receiverPath','addEventListener','message','data','status','failed','closed','stop','AVData','audioLength','audioReceived','audio','length','videoLength','Received\x20video,\x20frames:','videoReceived','video','videoBuffer','push','videoFrameTimeLength','getCurrentSync','PLAYING','muted','decodedVideoBuffer','tsVideoWaitingList'];(function(_0x56e2ba,_0x54ffbb){var _0x53abc2=function(_0x5bd6fa){while(--_0x5bd6fa){_0x56e2ba['push'](_0x56e2ba['shift']());}};_0x53abc2(++_0x54ffbb);}(_0x8674,0x1c2));var _0x162a=function(_0x289e5c,_0x18e4c1){_0x289e5c=_0x289e5c-0x0;var _0x1d4b0e=_0x8674[_0x289e5c];return _0x1d4b0e;};var requestAnimFrame=function(){return function(_0x452c50){window[_0x162a('0x0')](_0x452c50,0x3e8/0x1e);};}();function WSPlayer(){this[_0x162a('0x1')]=WSPlayerState['STOPPED'];this[_0x162a('0x2')]=![];}WSPlayer['prototype'][_0x162a('0x3')]=function(_0x566b31,_0x2633b5,_0x439354){this['canvas']=_0x566b31[_0x162a('0x4')];this[_0x162a('0x5')]=_0x566b31[_0x162a('0x5')];this[_0x162a('0x6')]=_0x566b31;this[_0x162a('0x7')]();this[_0x162a('0x8')]=-0x1;try{this[_0x162a('0x9')]=new AudioPlayer(_0x2633b5);}catch(_0x388ad2){wsLogger[_0x162a('0xa')](_0x162a('0xb')+_0x388ad2);return;}try{this['videoRenderer']=new VideoRenderer(this[_0x162a('0x4')],![],_0x162a('0xc'));this[_0x162a('0xd')]['init']();}catch(_0x4a3ba3){wsLogger['error'](_0x162a('0xe')+_0x4a3ba3);return;}if(!_0x439354){try{if(this[_0x162a('0xf')]){this[_0x162a('0xf')][_0x162a('0x10')]();}this[_0x162a('0xf')]=new Worker(_0x566b31[_0x162a('0x11')]);this['receiver'][_0x162a('0x12')](_0x162a('0x13'),function(_0xd32be3){switch(_0xd32be3[_0x162a('0x14')][_0x162a('0x13')]){case'connection':if(_0xd32be3[_0x162a('0x14')][_0x162a('0x15')]==_0x162a('0x16')||_0xd32be3[_0x162a('0x14')][_0x162a('0x15')]==_0x162a('0x17')){this[_0x162a('0x18')]();this[_0x162a('0x2')]=![];}break;case _0x162a('0x19'):var _0x223990;if(_0xd32be3[_0x162a('0x14')][_0x162a('0x1a')]>0x0){this[_0x162a('0x1b')]=!![];for(_0x223990=0x0;_0x223990<_0xd32be3[_0x162a('0x14')][_0x162a('0x1c')][_0x162a('0x1d')];_0x223990++){this[_0x162a('0x9')]['playAudio'](_0xd32be3['data']['audio'][_0x223990]);}}if(_0xd32be3[_0x162a('0x14')][_0x162a('0x1e')]>0x0){wsLogger['debug'](_0x162a('0x1f')+_0xd32be3[_0x162a('0x14')]['videoLength']);this[_0x162a('0x20')]=!![];for(_0x223990=0x0;_0x223990<_0xd32be3[_0x162a('0x14')][_0x162a('0x21')][_0x162a('0x1d')];_0x223990++){this[_0x162a('0x22')][_0x162a('0x23')](_0xd32be3[_0x162a('0x14')]['video'][_0x223990]);}this[_0x162a('0x24')]=_0xd32be3[_0x162a('0x14')][_0x162a('0x1e')]/_0xd32be3['data']['video'][_0x162a('0x1d')];}var _0x3677b1=this[_0x162a('0x9')][_0x162a('0x25')]();if(this[_0x162a('0x22')][_0x162a('0x1d')]>0x0){if(this[_0x162a('0x1')]==WSPlayerState[_0x162a('0x26')]){if(this[_0x162a('0xd')][_0x162a('0x27')]){this[_0x162a('0x28')][_0x162a('0x1d')]=0x0;this[_0x162a('0x29')][_0x162a('0x1d')]=0x0;while(this[_0x162a('0x22')][_0x162a('0x1d')]>0x0){if(this['videoBuffer'][0x0]['ts']<_0x3677b1+0x32){this['feedDecoder']();}else{break;}}}else if(this[_0x162a('0x29')][_0x162a('0x1d')]<0x2){this['feedDecoder']();}}else{while(this[_0x162a('0x2a')]()){}}}this['receiver'][_0x162a('0x2b')]({'message':'ack','data':{'seq':_0xd32be3[_0x162a('0x14')]['seq'],'time':Date[_0x162a('0x2c')](),'audioReceivedLength':_0xd32be3[_0x162a('0x14')][_0x162a('0x1a')],'videoReceivedLength':_0xd32be3[_0x162a('0x14')][_0x162a('0x1e')],'audioCurrentTime':_0x3677b1,'audioBufferTimeLength':this['audioPlayer'][_0x162a('0x2d')](),'videoBufferTimeLength':(this[_0x162a('0x22')]['length']+this[_0x162a('0x29')][_0x162a('0x1d')]+this[_0x162a('0x28')]['length'])*this[_0x162a('0x24')]}});break;default:wsLogger[_0x162a('0xa')](_0x162a('0x2e'));}}[_0x162a('0x2f')](this),![]);var _0x56370c={};_0x56370c[_0x162a('0x30')]=this[_0x162a('0x9')]['internalBufferSize'];_0x56370c['audioContextSampleRate']=this[_0x162a('0x9')][_0x162a('0x31')][_0x162a('0x32')];_0x56370c[_0x162a('0x33')]=_0x566b31[_0x162a('0x33')];_0x56370c[_0x162a('0x34')]=_0x566b31[_0x162a('0x34')];_0x56370c['urlWsServer']=_0x566b31['urlWsServer'];_0x56370c[_0x162a('0x35')]=_0x566b31[_0x162a('0x35')];_0x56370c['audioBufferWaitFor']=_0x566b31['audioBufferWaitFor'];_0x56370c['videoBufferWaitFor']=_0x566b31['videoBufferWaitFor'];_0x56370c['dropDelayMultiplier']=_0x566b31[_0x162a('0x36')];this[_0x162a('0xf')][_0x162a('0x2b')]({'message':_0x162a('0x3'),'data':_0x56370c});}catch(_0x2e5046){wsLogger[_0x162a('0xa')](_0x162a('0x37')+_0x2e5046);return;}}try{if(this[_0x162a('0x38')]){this[_0x162a('0x38')][_0x162a('0x10')]();}this[_0x162a('0x38')]=new Worker(_0x566b31[_0x162a('0x39')]);this['videoDecoder'][_0x162a('0x3a')]=function(_0x67846e){if(this[_0x162a('0x29')][_0x162a('0x1d')]==0x0){wsLogger['warn'](_0x162a('0x3b'));return;}_0x67846e['data']['sync']=this[_0x162a('0x29')][_0x162a('0x3c')]();this['decodedVideoBuffer']['push'](_0x67846e[_0x162a('0x14')]);if(this['state']!=WSPlayerState['PLAYING']&&this[_0x162a('0x1')]!=WSPlayerState[_0x162a('0x3d')]){if(this[_0x162a('0x28')][_0x162a('0x1d')]<0x5){if(this[_0x162a('0x28')]['length']>0x1&&this[_0x162a('0x9')][_0x162a('0x3e')][_0x162a('0x1d')]>0x0){if(this[_0x162a('0x9')][_0x162a('0x3e')][0x0][_0x162a('0x3f')]>this['decodedVideoBuffer'][0x0]['sync']){this[_0x162a('0x28')][0x0]=null;this[_0x162a('0x28')]['shift']();}}this[_0x162a('0x2a')]();}else{this[_0x162a('0x1')]=WSPlayerState['PLAYING'];this['audioPlayer'][_0x162a('0x40')]();if(this[_0x162a('0x8')]!=-0x1){this[_0x162a('0x41')](this[_0x162a('0x8')]);this[_0x162a('0x8')]=-0x1;}requestAnimFrame(this[_0x162a('0x42')]['bind'](this));}}else{if(this[_0x162a('0x29')][_0x162a('0x1d')]<0x2){this['feedDecoder']();}}}[_0x162a('0x2f')](this);this[_0x162a('0x38')][_0x162a('0x2b')]({'message':'init','width':_0x566b31[_0x162a('0x33')],'height':_0x566b31[_0x162a('0x34')],'outputGl':!![]});}catch(_0x5236ab){wsLogger[_0x162a('0xa')](_0x162a('0x43')+_0x5236ab);return;}this[_0x162a('0x44')]=0x0;this['lastFpsTime']=0x0;this[_0x162a('0x45')]=0x0;this['noDataFlag']=![];this[_0x162a('0x46')]=0x0;this['initialized']=!![];};WSPlayer[_0x162a('0x47')][_0x162a('0x7')]=function(){this[_0x162a('0x1b')]=![];this[_0x162a('0x20')]=![];if(this[_0x162a('0x22')]){this[_0x162a('0x22')][_0x162a('0x1d')]=0x0;}else{this[_0x162a('0x22')]=[];}if(this['tsVideoWaitingList']){this[_0x162a('0x29')][_0x162a('0x1d')]=0x0;}else{this[_0x162a('0x29')]=[];}if(this['decodedVideoBuffer']){this[_0x162a('0x28')]['length']=0x0;}else{this[_0x162a('0x28')]=[];}this[_0x162a('0x48')]=![];this[_0x162a('0x49')]=0x0;this['lastPlayedVideoTimestamp']=0x0;};WSPlayer['prototype'][_0x162a('0x2a')]=function(){if(this[_0x162a('0x22')][_0x162a('0x1d')]>0x0){if(this[_0x162a('0x48')]||this[_0x162a('0x22')][0x0][_0x162a('0x4a')]){this[_0x162a('0x48')]=!![];if(!this['videoRenderer'][_0x162a('0x27')]){this['tsVideoWaitingList'][_0x162a('0x23')](this[_0x162a('0x22')][0x0]['ts']);}this['videoDecoder'][_0x162a('0x2b')]({'message':_0x162a('0x4b'),'skip':this[_0x162a('0xd')][_0x162a('0x27')],'data':this[_0x162a('0x22')][0x0][_0x162a('0x4c')]},[this['videoBuffer'][0x0][_0x162a('0x4c')]['buffer']]);this[_0x162a('0x22')][0x0]=null;this[_0x162a('0x22')][_0x162a('0x3c')]();return!![];}this[_0x162a('0x22')][0x0]=null;this['videoBuffer'][_0x162a('0x3c')]();}};WSPlayer['prototype'][_0x162a('0x4d')]=function(_0x394048){if(!this['initialized']){wsLogger['error']('Can\x27t\x20play\x20stream,\x20player\x20not\x20initialized!');return;}this[_0x162a('0x7')]();this['receiver'][_0x162a('0x2b')]({'message':_0x162a('0x4d')});this[_0x162a('0x4e')]=_0x394048;this['unmute']();this[_0x162a('0x1')]=WSPlayerState[_0x162a('0x4f')];};WSPlayer[_0x162a('0x47')][_0x162a('0x50')]=function(){var _0x17a93a=this[_0x162a('0x9')][_0x162a('0x31')][_0x162a('0x51')](0x1,0x1b9,0xac44);var _0x311ab3=_0x17a93a[_0x162a('0x52')](0x0);for(var _0x455a72=0x0;_0x455a72<_0x311ab3['length'];_0x455a72++){_0x311ab3[_0x455a72]=Math[_0x162a('0x53')]()*0x2-0x1;}var _0x2b7b90=this[_0x162a('0x9')][_0x162a('0x31')][_0x162a('0x54')]();_0x2b7b90[_0x162a('0x55')]=_0x17a93a;_0x2b7b90[_0x162a('0x56')](this['audioPlayer'][_0x162a('0x31')][_0x162a('0x57')]);_0x2b7b90[_0x162a('0x40')](0x0);};WSPlayer[_0x162a('0x47')]['pause']=function(){this[_0x162a('0x58')]();this[_0x162a('0xf')][_0x162a('0x2b')]({'message':'pause'});this[_0x162a('0x1')]=WSPlayerState[_0x162a('0x59')];};WSPlayer['prototype'][_0x162a('0x58')]=function(){if(this[_0x162a('0x9')]){this[_0x162a('0x9')][_0x162a('0x58')](!![]);}if(this[_0x162a('0xd')]){this[_0x162a('0xd')][_0x162a('0x58')](!![]);}};WSPlayer[_0x162a('0x47')][_0x162a('0x5a')]=function(){if(this['audioPlayer']){this[_0x162a('0x9')]['mute'](![]);}if(this['videoRenderer']){this[_0x162a('0xd')][_0x162a('0x58')](![]);}};WSPlayer[_0x162a('0x47')][_0x162a('0x5b')]=function(){this[_0x162a('0x7')]();this[_0x162a('0x1')]=WSPlayerState[_0x162a('0x4f')];this[_0x162a('0xf')][_0x162a('0x2b')]({'message':_0x162a('0x5b')});this['unmute']();};WSPlayer['prototype']['setVolume']=function(_0x5a1f09){if(this[_0x162a('0x1')]==WSPlayerState[_0x162a('0x26')]){this[_0x162a('0x9')][_0x162a('0x41')](_0x5a1f09);}else{this[_0x162a('0x8')]=_0x5a1f09;}};WSPlayer[_0x162a('0x47')][_0x162a('0x5c')]=function(){return this[_0x162a('0x9')]['getVolume']();};WSPlayer[_0x162a('0x47')][_0x162a('0x18')]=function(){this['state']=WSPlayerState[_0x162a('0x3d')];if(this[_0x162a('0xf')]){this[_0x162a('0xf')][_0x162a('0x2b')]({'message':_0x162a('0x18')});}if(this[_0x162a('0x9')]){this[_0x162a('0x9')]['stop']();}if(this[_0x162a('0xd')]){this[_0x162a('0xd')][_0x162a('0x18')]();}this['fps']=0x0;this[_0x162a('0x5d')]=0x0;this[_0x162a('0x45')]=0x0;};WSPlayer[_0x162a('0x47')][_0x162a('0x42')]=function(_0x253d91){if(this[_0x162a('0x1')]!=WSPlayerState[_0x162a('0x26')]){return;}if(this[_0x162a('0x28')][_0x162a('0x1d')]>0x0){var _0x813081=this[_0x162a('0x9')][_0x162a('0x25')]();if(_0x813081==-0x1){var _0x44a14e=Date[_0x162a('0x2c')]();if(this[_0x162a('0x49')]==0x0){_0x813081=this[_0x162a('0x28')][0x0]['sync'];this[_0x162a('0x49')]=_0x44a14e;this[_0x162a('0x5e')]=_0x813081;wsLogger[_0x162a('0x5f')]('Init\x20Video\x20playout\x20without\x20sync,\x20currentTime\x20'+_0x44a14e+',\x20timestamp\x20'+this['lastPlayedVideoTimestamp']);}else{var _0x393d46=_0x44a14e-this[_0x162a('0x49')];var _0x160d46=this['decodedVideoBuffer'][0x0][_0x162a('0x3f')]-this['lastPlayedVideoTimestamp'];if(_0x393d46>=_0x160d46){_0x813081=this[_0x162a('0x28')][0x0]['sync'];this[_0x162a('0x49')]+=_0x160d46;this[_0x162a('0x5e')]=_0x813081;}else{_0x813081=this[_0x162a('0x28')][0x0][_0x162a('0x3f')]-0x1;}}}wsLogger[_0x162a('0x60')](_0x162a('0x61')+_0x813081+_0x162a('0x62')+_0x253d91);if(_0x813081-this[_0x162a('0x28')][0x0][_0x162a('0x3f')]>0x64&&this[_0x162a('0x28')]['length']>0x1){this[_0x162a('0x28')][_0x162a('0x3c')]();}if(this[_0x162a('0x28')][0x0][_0x162a('0x3f')]<=_0x813081){this['videoRenderer'][_0x162a('0x63')](this[_0x162a('0x28')]['shift']());this['framesRendered']++;if(this[_0x162a('0x45')]==0x1){var _0x2e90ca=this[_0x162a('0x4')];setTimeout(function(){var _0x1e1c6f=new CustomEvent(_0x162a('0x64'));_0x2e90ca[_0x162a('0x65')](_0x1e1c6f);},0xa);}}}if(this[_0x162a('0x29')][_0x162a('0x1d')]<0x3){this['feedDecoder']();}requestAnimFrame(this[_0x162a('0x42')]['bind'](this));};WSPlayer[_0x162a('0x47')][_0x162a('0x66')]=function(_0x35dabe){if(this[_0x162a('0x67')]){if(Date[_0x162a('0x2c')]()-this['lastEventRised']<0x3e8){return;}}var _0x54b410={'status':_0x162a('0x68'),'info':_0x35dabe};this[_0x162a('0x5')](_0x54b410);this[_0x162a('0x67')]=Date['now']();};WSPlayer[_0x162a('0x47')][_0x162a('0x69')]=function(_0x3c7c23){var _0x248bc3=this[_0x162a('0xd')][_0x162a('0x6a')];if(_0x248bc3){var _0x2635b7=_0x248bc3['measureText'](_0x3c7c23);_0x248bc3['fillStyle']='white';var _0x4db686=0x1e;_0x248bc3['fillRect'](0x0,this['canvas'][_0x162a('0x6b')]/0x2-_0x4db686/0x2,this[_0x162a('0x4')]['width'],_0x4db686);_0x248bc3[_0x162a('0x6c')]=_0x162a('0x6d');_0x248bc3[_0x162a('0x6e')]='30pt';_0x248bc3[_0x162a('0x6f')]=_0x162a('0x70');_0x248bc3['fillText'](_0x3c7c23,this[_0x162a('0x4')][_0x162a('0x71')]/0x2,this[_0x162a('0x4')][_0x162a('0x6b')]/0x2);}else{}};WSPlayer[_0x162a('0x47')]['fpsToCanvas']=function(_0x48eb03){var _0x4b03da=this[_0x162a('0xd')][_0x162a('0x6a')];if(_0x4b03da){_0x4b03da[_0x162a('0x6c')]='red';_0x4b03da[_0x162a('0x6e')]=_0x162a('0x72');_0x4b03da[_0x162a('0x73')](_0x48eb03,0x14,this['canvas'][_0x162a('0x6b')]-0x14);}else{}};WSPlayer['prototype'][_0x162a('0x74')]=function(_0x43edeb){this[_0x162a('0x75')]=_0x43edeb||0x2;var _0x556035=this;if(window['wsLogger']==undefined){window['wsLogger']={'log':function(){if(_0x556035[_0x162a('0x75')]>=0x2){window[_0x162a('0x76')][_0x162a('0x5f')][_0x162a('0x77')](window[_0x162a('0x76')],arguments);}},'warn':function(){if(_0x556035[_0x162a('0x75')]>=0x1){window[_0x162a('0x76')][_0x162a('0x78')][_0x162a('0x77')](window[_0x162a('0x76')],arguments);}},'error':function(){if(_0x556035[_0x162a('0x75')]>=0x0){window[_0x162a('0x76')][_0x162a('0xa')][_0x162a('0x77')](window[_0x162a('0x76')],arguments);}},'debug':function(){if(_0x556035[_0x162a('0x75')]>=0x3){window['console'][_0x162a('0x5f')][_0x162a('0x77')](window['console'],arguments);}},'trace':function(){if(_0x556035[_0x162a('0x75')]>=0x4){window['console'][_0x162a('0x5f')]['apply'](window[_0x162a('0x76')],arguments);}}};}if(window[_0x162a('0x79')][_0x162a('0x7a')]==undefined){window['wsLogger']['debug']=function(){if(_0x556035[_0x162a('0x75')]>=0x3){window[_0x162a('0x76')][_0x162a('0x5f')][_0x162a('0x77')](window[_0x162a('0x76')],arguments);}};}if(window['wsLogger'][_0x162a('0x60')]==undefined){window['wsLogger'][_0x162a('0x60')]=function(){if(_0x556035[_0x162a('0x75')]>=0x4){window[_0x162a('0x76')][_0x162a('0x5f')]['apply'](window[_0x162a('0x76')],arguments);}};}};WSPlayer[_0x162a('0x47')]['getStreamStatistics']=function(_0x351dd5){if(_0x351dd5==_0x162a('0x1c')){return this['audioReceived'];}else if(_0x351dd5==_0x162a('0x21')){return this[_0x162a('0x20')];}};var VideoRenderer=function(_0x2008fb,_0x328799,_0x5c39da){this[_0x162a('0x4')]=_0x2008fb;this[_0x162a('0x71')]=_0x2008fb[_0x162a('0x71')];this['height']=_0x2008fb['height'];this[_0x162a('0x7b')]=null;this[_0x162a('0x6a')]=null;this[_0x162a('0x7c')]=_0x328799;this['inputFormat']=_0x5c39da;this['gl']=null;this['program']=null;this[_0x162a('0x55')]=null;this[_0x162a('0x7d')]=null;this[_0x162a('0x7e')]=null;this[_0x162a('0x7f')]=null;this[_0x162a('0x80')]=null;this[_0x162a('0x81')]=null;this[_0x162a('0x82')]=null;this[_0x162a('0x83')]=null;this[_0x162a('0x84')]=null;this['muted']=![];this['SHADER_FRAGMENT_YCBCRTORGBA']=[_0x162a('0x85'),'uniform\x20sampler2D\x20YTexture;',_0x162a('0x86'),'uniform\x20sampler2D\x20CRTexture;','varying\x20vec2\x20texCoord;',_0x162a('0x87'),_0x162a('0x88'),'float\x20cr\x20=\x20texture2D(CRTexture,\x20texCoord).r\x20-\x200.5;',_0x162a('0x89'),_0x162a('0x8a'),'y\x20+\x201.4\x20*\x20cr,',_0x162a('0x8b'),'y\x20+\x201.765\x20*\x20cb,',_0x162a('0x8c'),');','}'][_0x162a('0x8d')]('\x0a');this['SHADER_VERTEX_IDENTITY_YUV']=[_0x162a('0x8e'),_0x162a('0x8f'),'void\x20main()\x20{',_0x162a('0x90'),_0x162a('0x91'),'}'][_0x162a('0x8d')]('\x0a');this[_0x162a('0x92')]=['attribute\x20vec4\x20vertex;',_0x162a('0x93'),_0x162a('0x94'),_0x162a('0x95'),'tc\x20=\x20vertex.xy*0.5+0.5;','}'][_0x162a('0x8d')]('\x0a');this[_0x162a('0x96')]=['precision\x20mediump\x20float;',_0x162a('0x97'),'varying\x20vec2\x20tc;','void\x20main(){',_0x162a('0x98'),'}'][_0x162a('0x8d')]('\x0a');};VideoRenderer[_0x162a('0x47')]['init']=function(){if(!this[_0x162a('0x7c')]){try{var _0x1a7035=this['gl']=this[_0x162a('0x4')][_0x162a('0x99')]('webgl')||this[_0x162a('0x4')][_0x162a('0x99')](_0x162a('0x9a'));}catch(_0x1fa2db){wsLogger[_0x162a('0xa')]('Failed\x20to\x20get\x20webgl\x20context,\x20error\x20'+_0x1fa2db);}}if(_0x1a7035){if(this[_0x162a('0x9b')]==_0x162a('0x9c')){this[_0x162a('0x9d')](_0x1a7035);}else{this[_0x162a('0x9e')](_0x1a7035);}}else{this[_0x162a('0x6a')]=this[_0x162a('0x4')][_0x162a('0x99')]('2d');this['renderFunction']=this[_0x162a('0x9f')];}this[_0x162a('0x7')]();};VideoRenderer[_0x162a('0x47')][_0x162a('0x9e')]=function(_0x4f5fef){this[_0x162a('0x55')]=_0x4f5fef[_0x162a('0x51')]();_0x4f5fef[_0x162a('0xa0')](_0x4f5fef[_0x162a('0xa1')],this['buffer']);_0x4f5fef[_0x162a('0xa2')](_0x4f5fef[_0x162a('0xa1')],new Float32Array([0x0,0x0,0x0,0x1,0x1,0x0,0x1,0x1]),_0x4f5fef[_0x162a('0xa3')]);this[_0x162a('0xa4')]=_0x4f5fef['createProgram']();_0x4f5fef[_0x162a('0xa5')](this['program'],this[_0x162a('0xa6')](_0x4f5fef['VERTEX_SHADER'],this[_0x162a('0xa7')]));_0x4f5fef[_0x162a('0xa5')](this[_0x162a('0xa4')],this[_0x162a('0xa6')](_0x4f5fef[_0x162a('0xa8')],this[_0x162a('0xa9')]));_0x4f5fef[_0x162a('0xaa')](this[_0x162a('0xa4')]);if(!_0x4f5fef[_0x162a('0xab')](this['program'],_0x4f5fef['LINK_STATUS'])){wsLogger[_0x162a('0xa')](_0x162a('0xac')+_0x4f5fef[_0x162a('0xad')](this[_0x162a('0xa4')]));this['ctx2D']=this[_0x162a('0x4')][_0x162a('0x99')]('2d');this['renderFunction']=this[_0x162a('0x9f')];return;}_0x4f5fef[_0x162a('0xae')](this[_0x162a('0xa4')]);this['YTexture']=this['createTexture'](0x0,_0x162a('0x7d'));this[_0x162a('0x7f')]=this[_0x162a('0xaf')](0x1,_0x162a('0x7f'));this[_0x162a('0x7e')]=this['createTexture'](0x2,'CBTexture');var _0x441c07=_0x4f5fef[_0x162a('0xb0')](this[_0x162a('0xa4')],_0x162a('0xb1'));_0x4f5fef[_0x162a('0xb2')](_0x441c07);_0x4f5fef[_0x162a('0xb3')](_0x441c07,0x2,_0x4f5fef['FLOAT'],![],0x0,0x0);this[_0x162a('0x7b')]=this['renderFrameGLYUV'];};VideoRenderer[_0x162a('0x47')][_0x162a('0x9d')]=function(_0x45a8b0){this[_0x162a('0x55')]=_0x45a8b0[_0x162a('0x51')]();_0x45a8b0['bindBuffer'](_0x45a8b0[_0x162a('0xa1')],this[_0x162a('0x55')]);_0x45a8b0[_0x162a('0xa2')](_0x45a8b0[_0x162a('0xa1')],new Float32Array([-0x1,-0x1,0x1,-0x1,0x1,0x1,0x1,0x1,-0x1,0x1,-0x1,-0x1]),_0x45a8b0[_0x162a('0xa3')]);this[_0x162a('0xa4')]=_0x45a8b0[_0x162a('0xb4')]();_0x45a8b0['attachShader'](this[_0x162a('0xa4')],this[_0x162a('0xa6')](_0x45a8b0['VERTEX_SHADER'],this[_0x162a('0x92')]));_0x45a8b0['attachShader'](this[_0x162a('0xa4')],this['compileShader'](_0x45a8b0[_0x162a('0xa8')],this['SHADER_FRAGMENT_RGBA']));_0x45a8b0[_0x162a('0xb5')](this[_0x162a('0xa4')],0x0,_0x162a('0xb1'));_0x45a8b0[_0x162a('0xaa')](this['program']);if(!_0x45a8b0['getProgramParameter'](this[_0x162a('0xa4')],_0x45a8b0['LINK_STATUS'])){wsLogger['error'](_0x162a('0xac')+_0x45a8b0[_0x162a('0xad')](this[_0x162a('0xa4')]));this[_0x162a('0x6a')]=this[_0x162a('0x4')][_0x162a('0x99')]('2d');this[_0x162a('0x7b')]=this[_0x162a('0x9f')];return;}_0x45a8b0[_0x162a('0xae')](this[_0x162a('0xa4')]);_0x45a8b0[_0x162a('0xb2')](0x0);_0x45a8b0[_0x162a('0xb3')](0x0,0x2,_0x45a8b0[_0x162a('0xb6')],![],0x0,0x0);this['RGBTexture']=this[_0x162a('0xaf')](0x0,'RGBTexture');this['renderFunction']=this[_0x162a('0xb7')];};VideoRenderer[_0x162a('0x47')][_0x162a('0x7')]=function(){this[_0x162a('0x71')]=this[_0x162a('0x4')]['width'];this[_0x162a('0x6b')]=this[_0x162a('0x4')][_0x162a('0x6b')];this[_0x162a('0x82')]=parseInt(this[_0x162a('0x71')])+0xf>>0x4;this[_0x162a('0x83')]=this['mbWidth']<<0x4;this[_0x162a('0x84')]=this[_0x162a('0x82')]<<0x3;var _0xe37a89;if(typeof Uint8ClampedArray!==_0x162a('0xb8')){_0xe37a89=Uint8ClampedArray;}else{_0xe37a89=Uint8Array;}if(this['ctx2D']){this[_0x162a('0x81')]=new _0xe37a89(this['canvas']['width']*this['canvas']['height']*0x4);for(var _0x46edaf=0x0,_0x9090eb=this[_0x162a('0x81')][_0x162a('0x1d')];_0x46edaf<_0x9090eb;_0x46edaf++){this[_0x162a('0x81')][_0x46edaf]=0xff;}}else if(this['gl']){this['gl']['viewport'](0x0,0x0,this[_0x162a('0x71')],this['height']);}};VideoRenderer[_0x162a('0x47')][_0x162a('0x18')]=function(){if(this[_0x162a('0x6a')]){var _0x2083e7=this[_0x162a('0x6a')][_0x162a('0xb9')](this[_0x162a('0x71')],this[_0x162a('0x6b')]);this['ctx2D'][_0x162a('0xba')](_0x2083e7,0x0,0x0);}else if(this['gl']){this['gl'][_0x162a('0xbb')](this['gl'][_0x162a('0xbc')]|this['gl'][_0x162a('0xbd')]);}};VideoRenderer[_0x162a('0x47')][_0x162a('0xaf')]=function(_0x10fdad,_0x34889c){var _0x6b3e76=this['gl'];var _0x18fcea=_0x6b3e76[_0x162a('0xaf')]();_0x6b3e76['bindTexture'](_0x6b3e76[_0x162a('0xbe')],_0x18fcea);_0x6b3e76[_0x162a('0xbf')](_0x6b3e76[_0x162a('0xbe')],_0x6b3e76[_0x162a('0xc0')],_0x6b3e76[_0x162a('0xc1')]);_0x6b3e76['texParameteri'](_0x6b3e76[_0x162a('0xbe')],_0x6b3e76[_0x162a('0xc2')],_0x6b3e76[_0x162a('0xc1')]);_0x6b3e76[_0x162a('0xbf')](_0x6b3e76[_0x162a('0xbe')],_0x6b3e76['TEXTURE_WRAP_S'],_0x6b3e76[_0x162a('0xc3')]);_0x6b3e76[_0x162a('0xbf')](_0x6b3e76['TEXTURE_2D'],_0x6b3e76[_0x162a('0xc4')],_0x6b3e76[_0x162a('0xc3')]);_0x6b3e76['uniform1i'](_0x6b3e76[_0x162a('0xc5')](this['program'],_0x34889c),_0x10fdad);return _0x18fcea;};VideoRenderer['prototype']['compileShader']=function(_0x41c03b,_0x5f4578){var _0x4f8efd=this['gl'];var _0x57e0eb=_0x4f8efd[_0x162a('0xc6')](_0x41c03b);_0x4f8efd['shaderSource'](_0x57e0eb,_0x5f4578);_0x4f8efd[_0x162a('0xa6')](_0x57e0eb);if(!_0x4f8efd[_0x162a('0xc7')](_0x57e0eb,_0x4f8efd[_0x162a('0xc8')])){throw new Error(_0x4f8efd[_0x162a('0xc9')](_0x57e0eb));}return _0x57e0eb;};VideoRenderer[_0x162a('0x47')][_0x162a('0xca')]=function(){return(this['gl']!==null||this['gl']!==undefined)&&(this['ctx2D']==null||this[_0x162a('0x6a')]==undefined);};VideoRenderer[_0x162a('0x47')]['renderFrameGLYUV']=function(_0x24528e){var _0x5c538d=this['gl'];_0x5c538d[_0x162a('0xcb')](_0x5c538d['TEXTURE0']);_0x5c538d[_0x162a('0xcc')](_0x5c538d[_0x162a('0xbe')],this[_0x162a('0x7d')]);_0x5c538d[_0x162a('0xcd')](_0x5c538d[_0x162a('0xbe')],0x0,_0x5c538d[_0x162a('0xce')],this[_0x162a('0x83')],this[_0x162a('0x6b')],0x0,_0x5c538d[_0x162a('0xce')],_0x5c538d[_0x162a('0xcf')],_0x24528e['y']);_0x5c538d[_0x162a('0xcb')](_0x5c538d[_0x162a('0xd0')]);_0x5c538d['bindTexture'](_0x5c538d[_0x162a('0xbe')],this['CRTexture']);_0x5c538d[_0x162a('0xcd')](_0x5c538d['TEXTURE_2D'],0x0,_0x5c538d[_0x162a('0xce')],this[_0x162a('0x84')],this[_0x162a('0x6b')]/0x2,0x0,_0x5c538d[_0x162a('0xce')],_0x5c538d[_0x162a('0xcf')],_0x24528e['cr']);_0x5c538d[_0x162a('0xcb')](_0x5c538d[_0x162a('0xd1')]);_0x5c538d[_0x162a('0xcc')](_0x5c538d['TEXTURE_2D'],this[_0x162a('0x7e')]);_0x5c538d[_0x162a('0xcd')](_0x5c538d[_0x162a('0xbe')],0x0,_0x5c538d['LUMINANCE'],this[_0x162a('0x84')],this['height']/0x2,0x0,_0x5c538d[_0x162a('0xce')],_0x5c538d[_0x162a('0xcf')],_0x24528e['cb']);_0x5c538d[_0x162a('0xd2')](_0x5c538d[_0x162a('0xd3')],0x0,0x4);};VideoRenderer['prototype'][_0x162a('0xb7')]=function(_0x5982ea){var _0x36021f=this['gl'];_0x36021f[_0x162a('0xcb')](_0x36021f[_0x162a('0xd4')]);_0x36021f['bindTexture'](_0x36021f[_0x162a('0xbe')],this['RGBTexture']);_0x36021f[_0x162a('0xcd')](_0x36021f['TEXTURE_2D'],0x0,_0x36021f[_0x162a('0xd5')],_0x5982ea[_0x162a('0x71')],_0x5982ea['height'],0x0,_0x36021f[_0x162a('0xd5')],_0x36021f['UNSIGNED_BYTE'],_0x5982ea[_0x162a('0x14')]);_0x36021f[_0x162a('0xd2')](_0x36021f[_0x162a('0xd6')],0x0,0x6);};VideoRenderer[_0x162a('0x47')]['renderFrame2D']=function(_0x4d5a01){var _0x84c411=this[_0x162a('0x6a')][_0x162a('0xb9')](_0x4d5a01['width'],_0x4d5a01[_0x162a('0x6b')]);if(_0x4d5a01[_0x162a('0xd7')]==_0x162a('0xc')){this[_0x162a('0xd8')](_0x4d5a01);_0x84c411['data'][_0x162a('0xd9')](this[_0x162a('0x81')]);}else{_0x84c411[_0x162a('0x14')]['set'](_0x4d5a01[_0x162a('0x14')]);}this[_0x162a('0x6a')][_0x162a('0xba')](_0x84c411,0x0,0x0);};VideoRenderer[_0x162a('0x47')]['render']=function(_0x467dad){if(!this[_0x162a('0x27')]){if(this[_0x162a('0x4')][_0x162a('0x71')]!=_0x467dad['width']||this[_0x162a('0x4')][_0x162a('0x6b')]!=_0x467dad[_0x162a('0x6b')]){wsLogger[_0x162a('0x5f')](_0x162a('0xda')+this[_0x162a('0x4')][_0x162a('0x71')]+'x'+this[_0x162a('0x4')]['height']+_0x162a('0xdb')+_0x467dad[_0x162a('0x71')]+'x'+_0x467dad[_0x162a('0x6b')]);this[_0x162a('0x4')]['width']=_0x467dad[_0x162a('0x71')];this[_0x162a('0x4')][_0x162a('0x6b')]=_0x467dad[_0x162a('0x6b')];var _0x44e234=new Event('resize');this[_0x162a('0x4')][_0x162a('0x65')](_0x44e234);this[_0x162a('0x7')]();}this[_0x162a('0x7b')](_0x467dad);}this[_0x162a('0xdc')]=Date[_0x162a('0x2c')]();};VideoRenderer[_0x162a('0x47')]['YCbCrToRGBA']=function(_0x3a6afc){var _0x2d188b=_0x3a6afc['y'];var _0x31895c=_0x3a6afc['cb'];var _0x1a9970=_0x3a6afc['cr'];var _0x410b7d=this[_0x162a('0x81')];var _0x599197=0x0;var _0x7186b7=this[_0x162a('0x83')];var _0xfec764=this['codedWidth']+(this[_0x162a('0x83')]-_0x3a6afc[_0x162a('0x71')]);var _0x48cdb2=0x0;var _0x5adcf1=this[_0x162a('0x84')]-(_0x3a6afc['width']>>0x1);var _0x1efcdf=0x0;var _0x306a15=_0x3a6afc[_0x162a('0x71')]*0x4;var _0x5b89c9=_0x3a6afc[_0x162a('0x71')]*0x4;var _0x83a94e=_0x3a6afc[_0x162a('0x71')]>>0x1;var _0x46e569=_0x3a6afc[_0x162a('0x6b')]>>0x1;var _0x170074,_0x356f54,_0x42843a,_0x402f62,_0x1fe8a6,_0xb3c8fd;for(var _0x4574e3=0x0;_0x4574e3<_0x46e569;_0x4574e3++){for(var _0x33b5b4=0x0;_0x33b5b4<_0x83a94e;_0x33b5b4++){_0x356f54=_0x31895c[_0x48cdb2];_0x42843a=_0x1a9970[_0x48cdb2];_0x48cdb2++;_0x402f62=_0x42843a+(_0x42843a*0x67>>0x8)-0xb3;_0x1fe8a6=(_0x356f54*0x58>>0x8)-0x2c+(_0x42843a*0xb7>>0x8)-0x5b;_0xb3c8fd=_0x356f54+(_0x356f54*0xc6>>0x8)-0xe3;var _0xba7424=_0x2d188b[_0x599197++];var _0x5ab42c=_0x2d188b[_0x599197++];_0x410b7d[_0x1efcdf]=_0xba7424+_0x402f62;_0x410b7d[_0x1efcdf+0x1]=_0xba7424-_0x1fe8a6;_0x410b7d[_0x1efcdf+0x2]=_0xba7424+_0xb3c8fd;_0x410b7d[_0x1efcdf+0x4]=_0x5ab42c+_0x402f62;_0x410b7d[_0x1efcdf+0x5]=_0x5ab42c-_0x1fe8a6;_0x410b7d[_0x1efcdf+0x6]=_0x5ab42c+_0xb3c8fd;_0x1efcdf+=0x8;var _0x2dbbbe=_0x2d188b[_0x7186b7++];var _0x1e85ab=_0x2d188b[_0x7186b7++];_0x410b7d[_0x306a15]=_0x2dbbbe+_0x402f62;_0x410b7d[_0x306a15+0x1]=_0x2dbbbe-_0x1fe8a6;_0x410b7d[_0x306a15+0x2]=_0x2dbbbe+_0xb3c8fd;_0x410b7d[_0x306a15+0x4]=_0x1e85ab+_0x402f62;_0x410b7d[_0x306a15+0x5]=_0x1e85ab-_0x1fe8a6;_0x410b7d[_0x306a15+0x6]=_0x1e85ab+_0xb3c8fd;_0x306a15+=0x8;}_0x599197+=_0xfec764;_0x7186b7+=_0xfec764;_0x1efcdf+=_0x5b89c9;_0x306a15+=_0x5b89c9;_0x48cdb2+=_0x5adcf1;}};VideoRenderer['prototype'][_0x162a('0xdd')]=function(){return this['lastTimeRendered'];};VideoRenderer[_0x162a('0x47')][_0x162a('0x58')]=function(_0x282d57){if(_0x282d57){this['muted']=!![];}else{this[_0x162a('0x27')]=![];}};function AudioPlayer(_0x21395c){var _0xfdbf8=this;this[_0x162a('0x7')]();this[_0x162a('0xde')]=![];this[_0x162a('0x31')]=_0x21395c;this[_0x162a('0xdf')]=_0x21395c[_0x162a('0xe0')]();this[_0x162a('0xdf')][_0x162a('0x56')](_0x21395c['destination']);this[_0x162a('0x58')](!![]);wsLogger[_0x162a('0x5f')]('Sample\x20rate\x20'+this[_0x162a('0x31')][_0x162a('0x32')]);var _0x363810=[];var _0x4a5353;for(_0x4a5353=0x100;_0x4a5353<=0x4000;_0x4a5353=_0x4a5353*0x2){_0x363810[_0x162a('0x23')](_0x4a5353);}var _0x4d6dd9=this[_0x162a('0x31')][_0x162a('0x32')]/0x1;var _0x3b65d4=_0x363810[0x0];var _0x4e4e5e=Math[_0x162a('0xe1')](_0x4d6dd9-_0x3b65d4);for(_0x4a5353=0x0;_0x4a5353<_0x363810['length'];_0x4a5353++){var _0xec6c77=Math[_0x162a('0xe1')](_0x4d6dd9-_0x363810[_0x4a5353]);if(_0xec6c77<_0x4e4e5e){_0x4e4e5e=_0xec6c77;_0x3b65d4=_0x363810[_0x4a5353];}}wsLogger[_0x162a('0x5f')](_0x162a('0xe2')+_0x3b65d4);this[_0x162a('0xe3')]=_0x3b65d4;this['audioChunkTimeLength']=this['internalBufferSize']/this[_0x162a('0x31')][_0x162a('0x32')]*0x3e8;try{this[_0x162a('0x31')][_0x162a('0xe4')]=this[_0x162a('0x31')]['createScriptProcessor']||this['context']['createJavaScriptNode'];this['audioJSNode']=this[_0x162a('0x31')]['createScriptProcessor'](this[_0x162a('0xe3')],0x1,0x1);}catch(_0x5e2288){wsLogger[_0x162a('0xa')]('JS\x20Audio\x20Node\x20is\x20not\x20supported\x20in\x20this\x20browser'+_0x5e2288);}this[_0x162a('0xe5')]['onaudioprocess']=function(_0x26db61){var _0x163877=_0x26db61['outputBuffer'][_0x162a('0x52')](0x0);var _0x4a5353;if(_0xfdbf8[_0x162a('0x3e')][_0x162a('0x1d')]>0x0){var _0x1d8762=_0xfdbf8[_0x162a('0x3e')][_0x162a('0x3c')]();for(_0x4a5353=0x0;_0x4a5353<_0x163877['length'];_0x4a5353++){_0x163877[_0x4a5353]=_0x1d8762[_0x162a('0x4c')][_0x4a5353];}if(!_0xfdbf8['lastSync']){_0xfdbf8['previousSync']=_0x1d8762[_0x162a('0x3f')];}else{_0xfdbf8[_0x162a('0xe6')]=_0xfdbf8[_0x162a('0xe7')];}_0xfdbf8['lastSync']=_0x1d8762[_0x162a('0x3f')];if(!_0xfdbf8[_0x162a('0xe8')]){_0xfdbf8['previousSyncTime']=_0x26db61[_0x162a('0xe9')]*0x3e8;}else{_0xfdbf8['previousSyncTime']=_0xfdbf8[_0x162a('0xe8')];}_0xfdbf8['lastSyncTime']=_0x26db61[_0x162a('0xe9')]*0x3e8;_0xfdbf8['bufferExhausted']=![];}else{for(_0x4a5353=0x0;_0x4a5353<_0x163877['length'];_0x4a5353++){_0x163877[_0x4a5353]=0x0;}_0xfdbf8['bufferExhausted']=!![];if(_0xfdbf8[_0x162a('0xdf')]['gain'][_0x162a('0xea')]!=0x0){wsLogger[_0x162a('0x7a')]('No\x20audio\x20in\x20audio\x20buffer!');}}};}AudioPlayer[_0x162a('0x47')][_0x162a('0x40')]=function(){if(!this[_0x162a('0xde')]){this['audioJSNode'][_0x162a('0x56')](this['gainNode']);this[_0x162a('0xde')]=!![];}this[_0x162a('0x58')](![]);};AudioPlayer[_0x162a('0x47')]['stop']=function(){this['audioJSNode'][_0x162a('0xeb')]();this[_0x162a('0xde')]=![];this[_0x162a('0xe7')]=undefined;this[_0x162a('0xe8')]=undefined;this[_0x162a('0x3e')]=[];this['mute'](!![]);};AudioPlayer[_0x162a('0x47')][_0x162a('0x7')]=function(){if(this[_0x162a('0x3e')]){this[_0x162a('0x3e')]['length']=0x0;}else{this[_0x162a('0x3e')]=[];}};AudioPlayer[_0x162a('0x47')][_0x162a('0xec')]=function(){this['initBuffers']();};AudioPlayer[_0x162a('0x47')][_0x162a('0xed')]=function(_0x554ebf){this['audioBuffer'][_0x162a('0x23')](_0x554ebf);};AudioPlayer[_0x162a('0x47')][_0x162a('0xee')]=function(){return this[_0x162a('0x3e')]['length'];};AudioPlayer[_0x162a('0x47')][_0x162a('0x25')]=function(){if(this[_0x162a('0xe7')]&&this['lastSyncTime']){var _0x21f724=this[_0x162a('0x31')][_0x162a('0xef')]*0x3e8;if(_0x21f724>=this[_0x162a('0xe8')]){if(_0x21f724-this[_0x162a('0xe8')]>this[_0x162a('0xf0')]){wsLogger[_0x162a('0x7a')](_0x162a('0xf1')+(_0x21f724-this[_0x162a('0xf0')]-this[_0x162a('0xe8')]));return this['lastSync']+this[_0x162a('0xf0')];}return _0x21f724-this[_0x162a('0xe8')]+this['lastSync'];}else{return _0x21f724-this[_0x162a('0xf2')]+this[_0x162a('0xe6')];}}return-0x1;};AudioPlayer[_0x162a('0x47')][_0x162a('0x2d')]=function(){var _0x4d5368=this[_0x162a('0x31')][_0x162a('0xef')]*0x3e8-this[_0x162a('0xe8')];var _0xd6ff56=this[_0x162a('0xf0')]-_0x4d5368;return _0xd6ff56>0x0?this['audioChunkTimeLength']*this[_0x162a('0x3e')]['length']+_0xd6ff56:this[_0x162a('0xf0')]*this['audioBuffer'][_0x162a('0x1d')];};AudioPlayer[_0x162a('0x47')]['getLastTimePlayed']=function(){return this[_0x162a('0xe8')];};AudioPlayer['prototype'][_0x162a('0x58')]=function(_0x197c70){if(_0x197c70){wsLogger[_0x162a('0x5f')](_0x162a('0xf3'));this['gainNode'][_0x162a('0xf4')]['value']=0x0;}else{wsLogger['log'](_0x162a('0xf5'));this[_0x162a('0xdf')][_0x162a('0xf4')][_0x162a('0xea')]=0x1;}};AudioPlayer['prototype'][_0x162a('0x41')]=function(_0x36b36f){this[_0x162a('0xdf')][_0x162a('0xf4')][_0x162a('0xea')]=_0x36b36f/0x64;};AudioPlayer['prototype'][_0x162a('0x5c')]=function(){return this['gainNode'][_0x162a('0xf4')][_0x162a('0xea')]*0x64;};var WSPlayerState=function(){};WSPlayerState[_0x162a('0x3d')]=_0x162a('0x3d');WSPlayerState[_0x162a('0x26')]='PLAYING';WSPlayerState[_0x162a('0x59')]='PAUSED';WSPlayerState['STARTUP']='STARTUP';exports['WSPlayer']=WSPlayer;
|
|
8294
8294
|
},{}],40:[function(require,module,exports){
|
|
8295
8295
|
'use strict';
|
|
8296
|
-
|
|
8297
8296
|
/**
|
|
8298
8297
|
* @namespace Flashphoner.constants.SESSION_STATUS
|
|
8299
8298
|
* @see Session
|
|
8300
8299
|
*/
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
/**
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
/**
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8300
|
+
const SESSION_STATUS = Object.freeze({
|
|
8301
|
+
/**
|
|
8302
|
+
* Fires when {@link Session} ws socket opens.
|
|
8303
|
+
* @event CONNECTED
|
|
8304
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8305
|
+
*/
|
|
8306
|
+
CONNECTED: 'CONNECTED',
|
|
8307
|
+
/**
|
|
8308
|
+
* Fires when {@link Session} receives connect ack from REST App.
|
|
8309
|
+
* @event ESTABLISHED
|
|
8310
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8311
|
+
*/
|
|
8312
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
8313
|
+
/**
|
|
8314
|
+
* Fires when {@link Session} disconnects.
|
|
8315
|
+
* @event DISCONNECTED
|
|
8316
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8317
|
+
*/
|
|
8318
|
+
DISCONNECTED: 'DISCONNECTED',
|
|
8319
|
+
/**
|
|
8320
|
+
* Fires if {@link Session} call of rest method error.
|
|
8321
|
+
* @event WARN
|
|
8322
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8323
|
+
*/
|
|
8324
|
+
WARN: 'WARN',
|
|
8325
|
+
/**
|
|
8326
|
+
* Fires if {@link Session} connection failed.
|
|
8327
|
+
* Some of the reasons can be network connection failed, REST App failed
|
|
8328
|
+
* @event FAILED
|
|
8329
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8330
|
+
*/
|
|
8331
|
+
FAILED: 'FAILED',
|
|
8332
|
+
/**
|
|
8333
|
+
* Fires wneh {@link Session} receives debug event
|
|
8334
|
+
* @event DEBUG
|
|
8335
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8336
|
+
*/
|
|
8337
|
+
DEBUG: 'DEBUG',
|
|
8338
|
+
/**
|
|
8339
|
+
* Fires when {@link Session} receives custom REST App message.
|
|
8340
|
+
*
|
|
8341
|
+
* @event APP_DATA
|
|
8342
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8343
|
+
*/
|
|
8344
|
+
APP_DATA: 'APP_DATA',
|
|
8345
|
+
/**
|
|
8346
|
+
* Fires when {@link Session} receives status of sendData operation.
|
|
8347
|
+
*
|
|
8348
|
+
* @event SEND_DATA_STATUS
|
|
8349
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8350
|
+
*/
|
|
8351
|
+
SEND_DATA_STATUS: 'SEND_DATA_STATUS',
|
|
8352
|
+
/**
|
|
8353
|
+
* State of newly created {@link Session}.
|
|
8354
|
+
*
|
|
8355
|
+
* @event PENDING
|
|
8356
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8357
|
+
*/
|
|
8358
|
+
PENDING: 'PENDING',
|
|
8359
|
+
/**
|
|
8360
|
+
* Fires when {@link Session} registers as sip client.
|
|
8361
|
+
*
|
|
8362
|
+
* @event REGISTERED
|
|
8363
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8364
|
+
*/
|
|
8365
|
+
REGISTERED: 'REGISTERED',
|
|
8366
|
+
/**
|
|
8367
|
+
* Fires when {@link Session} unregisters as sip client.
|
|
8368
|
+
*
|
|
8369
|
+
* @event UNREGISTERED
|
|
8370
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8371
|
+
*/
|
|
8372
|
+
UNREGISTERED: 'UNREGISTERED',
|
|
8373
|
+
/**
|
|
8374
|
+
* Fires when {@link Session} receives an incoming call.
|
|
8375
|
+
*
|
|
8376
|
+
* @event INCOMING_CALL
|
|
8377
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
8378
|
+
*/
|
|
8379
|
+
INCOMING_CALL: 'INCOMING_CALL'
|
|
8380
|
+
});
|
|
8382
8381
|
|
|
8383
8382
|
/**
|
|
8384
8383
|
* @namespace Flashphoner.constants.STREAM_STATUS
|
|
8385
8384
|
* @see Stream
|
|
8386
8385
|
*/
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
/**
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
/**
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8386
|
+
const STREAM_STATUS = Object.freeze({
|
|
8387
|
+
/**
|
|
8388
|
+
* State of newly created {@link Stream}.
|
|
8389
|
+
*
|
|
8390
|
+
* @event NEW
|
|
8391
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8392
|
+
*/
|
|
8393
|
+
NEW: 'NEW',
|
|
8394
|
+
/**
|
|
8395
|
+
* State before {@link Stream} publishing/playing.
|
|
8396
|
+
*
|
|
8397
|
+
* @event PENDING
|
|
8398
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8399
|
+
*/
|
|
8400
|
+
PENDING: 'PENDING',
|
|
8401
|
+
/**
|
|
8402
|
+
* Fires when {@link Stream} starts publishing.
|
|
8403
|
+
* @event PUBLISHING
|
|
8404
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8405
|
+
*/
|
|
8406
|
+
PUBLISHING: 'PUBLISHING',
|
|
8407
|
+
/**
|
|
8408
|
+
* Fires when {@link Stream} starts playing.
|
|
8409
|
+
* @event PLAYING
|
|
8410
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8411
|
+
*/
|
|
8412
|
+
PLAYING: 'PLAYING',
|
|
8413
|
+
/**
|
|
8414
|
+
* Fires if {@link Stream} paused.
|
|
8415
|
+
* @event PAUSED
|
|
8416
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8417
|
+
*/
|
|
8418
|
+
PAUSED: 'PAUSED',
|
|
8419
|
+
/**
|
|
8420
|
+
* Fires if {@link Stream} was unpublished.
|
|
8421
|
+
* @event UNPUBLISHED
|
|
8422
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8423
|
+
*/
|
|
8424
|
+
UNPUBLISHED: 'UNPUBLISHED',
|
|
8425
|
+
/**
|
|
8426
|
+
* Fires if playing {@link Stream} was stopped.
|
|
8427
|
+
* @event STOPPED
|
|
8428
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8429
|
+
*/
|
|
8430
|
+
STOPPED: 'STOPPED',
|
|
8431
|
+
/**
|
|
8432
|
+
* Fires if {@link Stream} failed.
|
|
8433
|
+
* @event FAILED
|
|
8434
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8435
|
+
*/
|
|
8436
|
+
FAILED: 'FAILED',
|
|
8437
|
+
/**
|
|
8438
|
+
* Fires if {@link Stream} playback problem.
|
|
8439
|
+
* @event PLAYBACK_PROBLEM
|
|
8440
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8441
|
+
*/
|
|
8442
|
+
PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
|
|
8443
|
+
/**
|
|
8444
|
+
* Fires if playing {@link Stream} picture resizing.
|
|
8445
|
+
* @event RESIZE
|
|
8446
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8447
|
+
*/
|
|
8448
|
+
RESIZE: 'RESIZE',
|
|
8449
|
+
/**
|
|
8450
|
+
* Fires when {@link Stream} snapshot becomes available.
|
|
8451
|
+
* Snapshot is base64 encoded png available through {@link Stream.getInfo}
|
|
8452
|
+
* @event SNAPSHOT_COMPLETE
|
|
8453
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
8454
|
+
*/
|
|
8455
|
+
SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
|
|
8456
|
+
/**
|
|
8457
|
+
* Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
|
|
8458
|
+
* @event NOT_ENOUGH_BANDWIDTH
|
|
8459
|
+
* @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
|
|
8460
|
+
*/
|
|
8461
|
+
NOT_ENOUGH_BANDWIDTH: 'NOT_ENOUGH_BANDWIDTH'
|
|
8462
|
+
});
|
|
8463
8463
|
|
|
8464
8464
|
/**
|
|
8465
8465
|
* @namespace Flashphoner.constants.CALL_STATUS
|
|
8466
8466
|
* @see Call
|
|
8467
8467
|
*/
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8468
|
+
const CALL_STATUS = Object.freeze({
|
|
8469
|
+
/**
|
|
8470
|
+
* State of newly created {@link Call}
|
|
8471
|
+
* @event NEW
|
|
8472
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8473
|
+
*/
|
|
8474
|
+
NEW: 'NEW',
|
|
8475
|
+
/**
|
|
8476
|
+
* The server is ringing to the callee
|
|
8477
|
+
* @event RING
|
|
8478
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8479
|
+
*/
|
|
8480
|
+
RING: 'RING',
|
|
8481
|
+
RING_MEDIA: 'RING_MEDIA',
|
|
8482
|
+
/**
|
|
8483
|
+
* The {@link Call} was put on hold
|
|
8484
|
+
* @event HOLD
|
|
8485
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8486
|
+
*/
|
|
8487
|
+
HOLD: 'HOLD',
|
|
8488
|
+
/**
|
|
8489
|
+
* The {@link Call} is established
|
|
8490
|
+
* @event ESTABLISHED
|
|
8491
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8492
|
+
*/
|
|
8493
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
8494
|
+
/**
|
|
8495
|
+
* The {@link Call} is finished
|
|
8496
|
+
* @event FINISH
|
|
8497
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8498
|
+
*/
|
|
8499
|
+
FINISH: 'FINISH',
|
|
8500
|
+
/**
|
|
8501
|
+
* Callee is busy
|
|
8502
|
+
* @event BUSY
|
|
8503
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8504
|
+
*/
|
|
8505
|
+
BUSY: 'BUSY',
|
|
8506
|
+
/**
|
|
8507
|
+
* SIP session is in progress
|
|
8508
|
+
* @event SESSION_PROGRESS
|
|
8509
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8510
|
+
*/
|
|
8511
|
+
SESSION_PROGRESS: 'SESSION_PROGRESS',
|
|
8512
|
+
/**
|
|
8513
|
+
* The {@link Call} is failed
|
|
8514
|
+
* @event FAILED
|
|
8515
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8516
|
+
*/
|
|
8517
|
+
FAILED: 'FAILED',
|
|
8518
|
+
/**
|
|
8519
|
+
* The {@link Call} state before ringing
|
|
8520
|
+
* @event PENDING
|
|
8521
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8522
|
+
*/
|
|
8523
|
+
PENDING: 'PENDING',
|
|
8524
|
+
/**
|
|
8525
|
+
* The server trying to establish {@link Call}
|
|
8526
|
+
* @event TRYING
|
|
8527
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
8528
|
+
*/
|
|
8529
|
+
TRYING: 'TRYING'
|
|
8530
|
+
});
|
|
8481
8531
|
|
|
8482
8532
|
/**
|
|
8483
8533
|
* @namespace Flashphoner.constants.STREAM_STATUS_INFO
|
|
8484
8534
|
* @see Stream
|
|
8485
8535
|
*/
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
/**
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
/**
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
/**
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
/**
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
/**
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
* Valid: vod://file.mp4
|
|
8743
|
-
* Invalid: dov://file.mp4
|
|
8744
|
-
* @event FAILED_TO_GET_AGENT_STORAGE
|
|
8745
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8746
|
-
*/
|
|
8747
|
-
define(streamStatusInfo, 'FAILED_TO_GET_AGENT_STORAGE', 'Failed to get agent storage');
|
|
8748
|
-
|
|
8749
|
-
/**
|
|
8750
|
-
* Shutdown agent servicing origin stream.
|
|
8751
|
-
* @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
|
|
8752
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8753
|
-
*/
|
|
8754
|
-
define(streamStatusInfo, 'AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN', 'Agent servicing origin stream is shutting down');
|
|
8755
|
-
|
|
8756
|
-
/**
|
|
8757
|
-
* Terminated by keep-alive on walk through subscribers.
|
|
8758
|
-
* @event TERMINATED_BY_KEEP_ALIVE
|
|
8759
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8760
|
-
*/
|
|
8761
|
-
define(streamStatusInfo, 'TERMINATED_BY_KEEP_ALIVE', 'Terminated by keep-alive');
|
|
8762
|
-
|
|
8763
|
-
/**
|
|
8764
|
-
* Transcoding required, but disabled in settings
|
|
8765
|
-
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
8766
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8767
|
-
*/
|
|
8768
|
-
define(streamStatusInfo, 'TRANSCODING_REQUIRED_BUT_DISABLED', 'Transcoding required, but disabled');
|
|
8769
|
-
|
|
8770
|
-
/**
|
|
8771
|
-
* Access restricted by access list
|
|
8772
|
-
* @event RESTRICTED_ACCESS
|
|
8773
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8774
|
-
*/
|
|
8775
|
-
define(streamStatusInfo, 'RESTRICTED_ACCESS', 'Restricted access');
|
|
8776
|
-
|
|
8777
|
-
/**
|
|
8778
|
-
* No available transcoders for stream
|
|
8779
|
-
* @event RESTRICTED_ACCESS
|
|
8780
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8781
|
-
*/
|
|
8782
|
-
define(streamStatusInfo, 'NO_AVAILABLE_TRANSCODERS', 'No available transcoders');
|
|
8536
|
+
const STREAM_STATUS_INFO = Object.freeze({
|
|
8537
|
+
/**
|
|
8538
|
+
* Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
|
|
8539
|
+
* @event FAILED_BY_ICE_ERROR
|
|
8540
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8541
|
+
*/
|
|
8542
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
8543
|
+
/**
|
|
8544
|
+
* Timeout has been reached during ICE establishment.
|
|
8545
|
+
* @event FAILED_BY_ICE_TIMEOUT
|
|
8546
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8547
|
+
*/
|
|
8548
|
+
FAILED_BY_ICE_TIMEOUT: 'Failed by ICE timeout',
|
|
8549
|
+
/**
|
|
8550
|
+
* ICE refresh failed on session.
|
|
8551
|
+
* @event FAILED_BY_KEEP_ALIVE
|
|
8552
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8553
|
+
*/
|
|
8554
|
+
FAILED_BY_KEEP_ALIVE: 'Failed by ICE keep alive',
|
|
8555
|
+
/**
|
|
8556
|
+
* DTLS has wrong fingerprint.
|
|
8557
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
8558
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8559
|
+
*/
|
|
8560
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
8561
|
+
/**
|
|
8562
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
8563
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
8564
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8565
|
+
*/
|
|
8566
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
8567
|
+
/**
|
|
8568
|
+
* Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
|
|
8569
|
+
* @event FAILED_BY_HLS_WRITER_ERROR
|
|
8570
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8571
|
+
*/
|
|
8572
|
+
FAILED_BY_HLS_WRITER_ERROR: 'Failed by HLS writer error',
|
|
8573
|
+
/**
|
|
8574
|
+
* Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
|
|
8575
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
8576
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8577
|
+
*/
|
|
8578
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
8579
|
+
/**
|
|
8580
|
+
* RTP session failed by RTP activity timer.
|
|
8581
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
8582
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8583
|
+
*/
|
|
8584
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
8585
|
+
/**
|
|
8586
|
+
* Related session was disconnected.
|
|
8587
|
+
* @event STOPPED_BY_SESSION_DISCONNECT
|
|
8588
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8589
|
+
*/
|
|
8590
|
+
STOPPED_BY_SESSION_DISCONNECT: 'Stopped by session disconnect',
|
|
8591
|
+
/**
|
|
8592
|
+
* Stream was stopped by rest terminate request.
|
|
8593
|
+
* @event STOPPED_BY_REST_TERMINATE
|
|
8594
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8595
|
+
*/
|
|
8596
|
+
STOPPED_BY_REST_TERMINATE: 'Stopped by rest /terminate',
|
|
8597
|
+
/**
|
|
8598
|
+
* Related publisher stopped its stream or lost connection.
|
|
8599
|
+
* @event STOPPED_BY_PUBLISHER_STOP
|
|
8600
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8601
|
+
*/
|
|
8602
|
+
STOPPED_BY_PUBLISHER_STOP: 'Stopped by publisher stop',
|
|
8603
|
+
/**
|
|
8604
|
+
* Stop the media session by user after call was finished or unpublish stream.
|
|
8605
|
+
* @event STOPPED_BY_USER
|
|
8606
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8607
|
+
*/
|
|
8608
|
+
STOPPED_BY_USER: 'Stopped by user',
|
|
8609
|
+
/**
|
|
8610
|
+
* Error occurred on the stream.
|
|
8611
|
+
* @event FAILED_BY_ERROR
|
|
8612
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8613
|
+
*/
|
|
8614
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
8615
|
+
/**
|
|
8616
|
+
* Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
|
|
8617
|
+
* @event FAILED_TO_ADD_STREAM_TO_PROXY
|
|
8618
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8619
|
+
*/
|
|
8620
|
+
FAILED_TO_ADD_STREAM_TO_PROXY: 'Failed to add stream to proxy',
|
|
8621
|
+
/**
|
|
8622
|
+
* Stopped shapshot distributor.
|
|
8623
|
+
* @event DISTRIBUTOR_STOPPED
|
|
8624
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8625
|
+
*/
|
|
8626
|
+
DISTRIBUTOR_STOPPED: 'Distributor stopped',
|
|
8627
|
+
/**
|
|
8628
|
+
* Publish stream is not ready, try again later.
|
|
8629
|
+
* @event PUBLISH_STREAM_IS_NOT_READY
|
|
8630
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8631
|
+
*/
|
|
8632
|
+
PUBLISH_STREAM_IS_NOT_READY: 'Publish stream is not ready',
|
|
8633
|
+
/**
|
|
8634
|
+
* Stream with this name is not found, check the correct of the name.
|
|
8635
|
+
* @event STREAM_NOT_FOUND
|
|
8636
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8637
|
+
*/
|
|
8638
|
+
STREAM_NOT_FOUND: 'Stream not found',
|
|
8639
|
+
/**
|
|
8640
|
+
* Server already has a publish stream with the same name, try using different one.
|
|
8641
|
+
* @event STREAM_NAME_ALREADY_IN_USE
|
|
8642
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8643
|
+
*/
|
|
8644
|
+
STREAM_NAME_ALREADY_IN_USE: 'Stream name is already in use',
|
|
8645
|
+
/**
|
|
8646
|
+
* Error indicates that stream object received by server has empty mediaSessionId field.
|
|
8647
|
+
* @event MEDIASESSION_ID_NULL
|
|
8648
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8649
|
+
*/
|
|
8650
|
+
MEDIASESSION_ID_NULL: 'MediaSessionId is null',
|
|
8651
|
+
/**
|
|
8652
|
+
* Published or subscribed sessions used this MediaSessionId.
|
|
8653
|
+
* @event MEDIASESSION_ID_ALREADY_IN_USE
|
|
8654
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8655
|
+
*/
|
|
8656
|
+
MEDIASESSION_ID_ALREADY_IN_USE: 'MediaSessionId is already in use',
|
|
8657
|
+
/**
|
|
8658
|
+
* Session is not initialized or terminated on play ordinary stream.
|
|
8659
|
+
* @event SESSION_NOT_READY
|
|
8660
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8661
|
+
*/
|
|
8662
|
+
SESSION_NOT_READY: 'Session not ready',
|
|
8663
|
+
/**
|
|
8664
|
+
* Actual session does not exist.
|
|
8665
|
+
* @event SESSION_DOES_NOT_EXIST
|
|
8666
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8667
|
+
*/
|
|
8668
|
+
SESSION_DOES_NOT_EXIST: 'Session does not exist',
|
|
8669
|
+
/**
|
|
8670
|
+
* RTSP has wrong format on play stream, check the RTSP url validity.
|
|
8671
|
+
* @event RTSP_HAS_WRONG_FORMAT
|
|
8672
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8673
|
+
*/
|
|
8674
|
+
RTSP_HAS_WRONG_FORMAT: 'Rtsp has wrong format',
|
|
8675
|
+
/**
|
|
8676
|
+
* Failed to play vod stream, this format is not supported.
|
|
8677
|
+
* @event FILE_HAS_WRONG_FORMAT
|
|
8678
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8679
|
+
*/
|
|
8680
|
+
FILE_HAS_WRONG_FORMAT: 'File has wrong format',
|
|
8681
|
+
/**
|
|
8682
|
+
* Failed to connect to rtsp stream.
|
|
8683
|
+
* @event FAILED_TO_CONNECT_TO_RTSP_STREAM
|
|
8684
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8685
|
+
*/
|
|
8686
|
+
FAILED_TO_CONNECT_TO_RTSP_STREAM: 'Failed to connect to rtsp stream',
|
|
8687
|
+
/**
|
|
8688
|
+
* Rtsp stream is not found, agent received "404-Not Found".
|
|
8689
|
+
* @event RTSP_STREAM_NOT_FOUND
|
|
8690
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8691
|
+
*/
|
|
8692
|
+
RTSP_STREAM_NOT_FOUND: 'Rtsp stream not found',
|
|
8693
|
+
/**
|
|
8694
|
+
* On shutdown RTSP agent.
|
|
8695
|
+
* @event RTSPAGENT_SHUTDOWN
|
|
8696
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8697
|
+
*/
|
|
8698
|
+
RTSPAGENT_SHUTDOWN: 'RtspAgent shutdown',
|
|
8699
|
+
/**
|
|
8700
|
+
* Stream failed
|
|
8701
|
+
* @event STREAM_FAILED
|
|
8702
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8703
|
+
*/
|
|
8704
|
+
STREAM_FAILED: 'Stream failed',
|
|
8705
|
+
/**
|
|
8706
|
+
* No common codecs on setup track, did not found corresponding trackId->mediaPort.
|
|
8707
|
+
* @event NO_COMMON_CODECS
|
|
8708
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8709
|
+
*/
|
|
8710
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
8711
|
+
/**
|
|
8712
|
+
* Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
|
|
8713
|
+
* @event BAD_URI
|
|
8714
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8715
|
+
*/
|
|
8716
|
+
BAD_URI: 'Bad URI',
|
|
8717
|
+
/**
|
|
8718
|
+
* General VOD error, indicates that Exception occurred while reading/processing media file.
|
|
8719
|
+
* @event GOT_EXCEPTION_WHILE_STREAMING_FILE
|
|
8720
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8721
|
+
*/
|
|
8722
|
+
GOT_EXCEPTION_WHILE_STREAMING_FILE: 'Got exception while streaming file',
|
|
8723
|
+
/**
|
|
8724
|
+
* Requested stream shutdown.
|
|
8725
|
+
* @event REQUESTED_STREAM_SHUTDOWN
|
|
8726
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8727
|
+
*/
|
|
8728
|
+
REQUESTED_STREAM_SHUTDOWN: 'Requested stream shutdown',
|
|
8729
|
+
/**
|
|
8730
|
+
* Failed to create movie, file can not be read.
|
|
8731
|
+
* @event FAILED_TO_READ_FILE
|
|
8732
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8733
|
+
*/
|
|
8734
|
+
FAILED_TO_READ_FILE: 'Failed to read file',
|
|
8735
|
+
/**
|
|
8736
|
+
* File does not exist, check filename.
|
|
8737
|
+
* @event FILE_NOT_FOUND
|
|
8738
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8739
|
+
*/
|
|
8740
|
+
FILE_NOT_FOUND: 'File not found',
|
|
8741
|
+
/**
|
|
8742
|
+
* Server failed to establish websocket connection with origin server.
|
|
8743
|
+
* @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
|
|
8744
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8745
|
+
*/
|
|
8746
|
+
FAILED_TO_CONNECT_TO_ORIGIN_STREAM: 'Failed to connect to origin stream',
|
|
8747
|
+
/**
|
|
8748
|
+
* CDN stream not found.
|
|
8749
|
+
* @event CDN_STREAM_NOT_FOUND
|
|
8750
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8751
|
+
*/
|
|
8752
|
+
CDN_STREAM_NOT_FOUND: 'CDN stream not found',
|
|
8753
|
+
/**
|
|
8754
|
+
* Indicates that provided URL protocol in stream name is invalid.
|
|
8755
|
+
* Valid: vod://file.mp4
|
|
8756
|
+
* Invalid: dov://file.mp4
|
|
8757
|
+
* @event FAILED_TO_GET_AGENT_STORAGE
|
|
8758
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8759
|
+
*/
|
|
8760
|
+
FAILED_TO_GET_AGENT_STORAGE: 'Failed to get agent storage',
|
|
8761
|
+
/**
|
|
8762
|
+
* Shutdown agent servicing origin stream.
|
|
8763
|
+
* @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
|
|
8764
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8765
|
+
*/
|
|
8766
|
+
AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN: 'Agent servicing origin stream is shutting down',
|
|
8767
|
+
/**
|
|
8768
|
+
* Terminated by keep-alive on walk through subscribers.
|
|
8769
|
+
* @event TERMINATED_BY_KEEP_ALIVE
|
|
8770
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8771
|
+
*/
|
|
8772
|
+
TERMINATED_BY_KEEP_ALIVE: 'Terminated by keep-alive',
|
|
8773
|
+
/**
|
|
8774
|
+
* Transcoding required, but disabled in server settings
|
|
8775
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
8776
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8777
|
+
*/
|
|
8778
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled',
|
|
8779
|
+
/**
|
|
8780
|
+
* Access restricted by access list
|
|
8781
|
+
* @event RESTRICTED_ACCESS
|
|
8782
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8783
|
+
*/
|
|
8784
|
+
RESTRICTED_ACCESS: 'Restricted access',
|
|
8785
|
+
/**
|
|
8786
|
+
* No available transcoders for stream
|
|
8787
|
+
* @event NO_AVAILABLE_TRANSCODERS
|
|
8788
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
8789
|
+
*/
|
|
8790
|
+
NO_AVAILABLE_TRANSCODERS: 'No available transcoders'
|
|
8791
|
+
});
|
|
8783
8792
|
|
|
8784
8793
|
/**
|
|
8785
8794
|
* @namespace Flashphoner.constants.CALL_STATUS_INFO
|
|
8786
8795
|
* @see Call
|
|
8787
8796
|
*/
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
/**
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8857
|
-
*/
|
|
8858
|
-
define(callStatusInfo, 'FAILED_BY_REQUEST_TIMEOUT', 'Failed by request timeout');
|
|
8859
|
-
|
|
8860
|
-
/**
|
|
8861
|
-
* Transcoding required, but disabled in settings
|
|
8862
|
-
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
8863
|
-
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8864
|
-
*/
|
|
8865
|
-
define(callStatusInfo, 'TRANSCODING_REQUIRED_BUT_DISABLED', 'Transcoding required, but disabled');
|
|
8797
|
+
const CALL_STATUS_INFO = Object.freeze({
|
|
8798
|
+
/**
|
|
8799
|
+
* Normal call hangup.
|
|
8800
|
+
* @event NORMAL_CALL_CLEARING
|
|
8801
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8802
|
+
*/
|
|
8803
|
+
NORMAL_CALL_CLEARING: 'Normal call clearing',
|
|
8804
|
+
/**
|
|
8805
|
+
* Error occurred while creating a session
|
|
8806
|
+
* @event FAILED_BY_SESSION_CREATION
|
|
8807
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8808
|
+
*/
|
|
8809
|
+
FAILED_BY_SESSION_CREATION: 'Failed by session creation',
|
|
8810
|
+
/**
|
|
8811
|
+
* Failed by error during ICE establishment.
|
|
8812
|
+
* @event FAILED_BY_ICE_ERROR
|
|
8813
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8814
|
+
*/
|
|
8815
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
8816
|
+
/**
|
|
8817
|
+
* RTP session failed by RTP activity timer.
|
|
8818
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
8819
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8820
|
+
*/
|
|
8821
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
8822
|
+
/**
|
|
8823
|
+
* FF writer was failed on RTMP.
|
|
8824
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
8825
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8826
|
+
*/
|
|
8827
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
8828
|
+
/**
|
|
8829
|
+
* DTLS wrong fingerprint.
|
|
8830
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
8831
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8832
|
+
*/
|
|
8833
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
8834
|
+
/**
|
|
8835
|
+
* No common codecs in sdp
|
|
8836
|
+
* @event NO_COMMON_CODECS
|
|
8837
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8838
|
+
*/
|
|
8839
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
8840
|
+
/**
|
|
8841
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
8842
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
8843
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8844
|
+
*/
|
|
8845
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
8846
|
+
/**
|
|
8847
|
+
* Error occurred during the call
|
|
8848
|
+
* @event FAILED_BY_ERROR
|
|
8849
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8850
|
+
*/
|
|
8851
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
8852
|
+
/**
|
|
8853
|
+
* Call failed by request timeout
|
|
8854
|
+
* @event FAILED_BY_REQUEST_TIMEOUT
|
|
8855
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8856
|
+
*/
|
|
8857
|
+
FAILED_BY_REQUEST_TIMEOUT: 'Failed by request timeout',
|
|
8858
|
+
/**
|
|
8859
|
+
* Transcoding required, but disabled in settings
|
|
8860
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
8861
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
8862
|
+
*/
|
|
8863
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled'
|
|
8864
|
+
});
|
|
8866
8865
|
|
|
8867
8866
|
/**
|
|
8868
8867
|
* @namespace Flashphoner.constants.ERROR_INFO
|
|
8869
8868
|
*/
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
/**
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8869
|
+
const ERROR_INFO = Object.freeze({
|
|
8870
|
+
/**
|
|
8871
|
+
* Error if none of MediaProviders available
|
|
8872
|
+
* @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
|
|
8873
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8874
|
+
*/
|
|
8875
|
+
NONE_OF_MEDIAPROVIDERS_AVAILABLE: 'None of MediaProviders available',
|
|
8876
|
+
/**
|
|
8877
|
+
* Error if none of preferred MediaProviders available
|
|
8878
|
+
* @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
|
|
8879
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8880
|
+
*/
|
|
8881
|
+
NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE: 'None of preferred MediaProviders available',
|
|
8882
|
+
/**
|
|
8883
|
+
* Error if API is not initialized
|
|
8884
|
+
* @event FLASHPHONER_API_NOT_INITIALIZED
|
|
8885
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8886
|
+
*/
|
|
8887
|
+
FLASHPHONER_API_NOT_INITIALIZED: 'Flashphoner API is not initialized',
|
|
8888
|
+
/**
|
|
8889
|
+
* Error if options.urlServer is not specified
|
|
8890
|
+
* @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
|
|
8891
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8892
|
+
*/
|
|
8893
|
+
OPTIONS_URLSERVER_MUST_BE_PROVIDED: 'options.urlServer must be provided',
|
|
8894
|
+
/**
|
|
8895
|
+
* Error if session state is not valid
|
|
8896
|
+
* @event INVALID_SESSION_STATE
|
|
8897
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8898
|
+
*/
|
|
8899
|
+
INVALID_SESSION_STATE: 'Invalid session state',
|
|
8900
|
+
/**
|
|
8901
|
+
* Error if no options provided
|
|
8902
|
+
* @event OPTIONS_MUST_BE_PROVIDED
|
|
8903
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8904
|
+
*/
|
|
8905
|
+
OPTIONS_MUST_BE_PROVIDED: 'options must be provided',
|
|
8906
|
+
/**
|
|
8907
|
+
* Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
|
|
8908
|
+
* @event INVALID_CALL_STATE
|
|
8909
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8910
|
+
*/
|
|
8911
|
+
INVALID_CALL_STATE: 'Invalid call state',
|
|
8912
|
+
/**
|
|
8913
|
+
* Error if event is not specified
|
|
8914
|
+
* @event EVENT_CANT_BE_NULL
|
|
8915
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8916
|
+
*/
|
|
8917
|
+
EVENT_CANT_BE_NULL: 'Event can\'t be null',
|
|
8918
|
+
/**
|
|
8919
|
+
* Error if callback is not a valid function
|
|
8920
|
+
* @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
|
|
8921
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8922
|
+
*/
|
|
8923
|
+
CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION: 'Callback needs to be a valid function',
|
|
8924
|
+
/**
|
|
8925
|
+
* Error if options.name is not specified
|
|
8926
|
+
* @event OPTIONS_NAME_MUST_BE_PROVIDED
|
|
8927
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8928
|
+
*/
|
|
8929
|
+
OPTIONS_NAME_MUST_BE_PROVIDED: 'options.name must be provided',
|
|
8930
|
+
/**
|
|
8931
|
+
* Error if number of cams is less than 2 or camera is already used by other application
|
|
8932
|
+
* @event CAN_NOT_SWITCH_CAM
|
|
8933
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
8934
|
+
*/
|
|
8935
|
+
CAN_NOT_SWITCH_CAM: 'Number of cams is less than 2 or camera is already used by other application',
|
|
8936
|
+
/**
|
|
8937
|
+
* Error if number of mics is less than 2 or microphone is already used by other application
|
|
8938
|
+
* @event CAN_NOT_SWITCH_MIC
|
|
8939
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
8940
|
+
*/
|
|
8941
|
+
CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
|
|
8942
|
+
/**
|
|
8943
|
+
* Local browser error detected
|
|
8944
|
+
* @event LOCAL_ERROR
|
|
8945
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
8946
|
+
*/
|
|
8947
|
+
LOCAL_ERROR: 'Local error'
|
|
8948
|
+
});
|
|
8927
8949
|
|
|
8928
8950
|
/**
|
|
8929
|
-
*
|
|
8930
|
-
* @
|
|
8931
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8951
|
+
* Local media devices type
|
|
8952
|
+
* @namespace Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
8932
8953
|
*/
|
|
8933
|
-
|
|
8954
|
+
const MEDIA_DEVICE_KIND = Object.freeze({
|
|
8955
|
+
/**
|
|
8956
|
+
* List local media output devices
|
|
8957
|
+
* @see Flashphoner.getMediaDevices
|
|
8958
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
8959
|
+
*/
|
|
8960
|
+
OUTPUT: 'output',
|
|
8961
|
+
/**
|
|
8962
|
+
* List local media input devices
|
|
8963
|
+
* @see Flashphoner.getMediaDevices
|
|
8964
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
8965
|
+
*/
|
|
8966
|
+
INPUT: 'input',
|
|
8967
|
+
/**
|
|
8968
|
+
* List local media devices
|
|
8969
|
+
* @see Flashphoner.getMediaDevices
|
|
8970
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
8971
|
+
*/
|
|
8972
|
+
ALL: 'all'
|
|
8973
|
+
});
|
|
8934
8974
|
|
|
8935
8975
|
/**
|
|
8936
|
-
*
|
|
8937
|
-
* @
|
|
8938
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8976
|
+
* WebRTC transport type
|
|
8977
|
+
* @namespace Flashphoner.constants.TRANSPORT_TYPE
|
|
8939
8978
|
*/
|
|
8940
|
-
|
|
8979
|
+
const TRANSPORT_TYPE = Object.freeze({
|
|
8980
|
+
/**
|
|
8981
|
+
* WebRTC RTP traffic goes over UDP (default)
|
|
8982
|
+
* @see Stream
|
|
8983
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
8984
|
+
*/
|
|
8985
|
+
UDP: 'UDP',
|
|
8986
|
+
/**
|
|
8987
|
+
* WebRTC RTP traffic goes over TCP
|
|
8988
|
+
* @see Stream
|
|
8989
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
8990
|
+
*/
|
|
8991
|
+
TCP: 'TCP'
|
|
8992
|
+
});
|
|
8941
8993
|
|
|
8942
8994
|
/**
|
|
8943
|
-
*
|
|
8944
|
-
* @
|
|
8945
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
8995
|
+
* WebRTC connection quality type
|
|
8996
|
+
* @namespace Flashphoner.constants.CONNECTION_QUALITY
|
|
8946
8997
|
*/
|
|
8947
|
-
|
|
8998
|
+
const CONNECTION_QUALITY = Object.freeze({
|
|
8999
|
+
/**
|
|
9000
|
+
* Channel bandwidth is perfect
|
|
9001
|
+
* @see Stream
|
|
9002
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
9003
|
+
*/
|
|
9004
|
+
PERFECT: 'PERFECT',
|
|
9005
|
+
/**
|
|
9006
|
+
* Channel bandwidth is good
|
|
9007
|
+
* @see Stream
|
|
9008
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
9009
|
+
*/
|
|
9010
|
+
GOOD: 'GOOD',
|
|
9011
|
+
/**
|
|
9012
|
+
* Channel bandwidth is bad
|
|
9013
|
+
* @see Stream
|
|
9014
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
9015
|
+
*/
|
|
9016
|
+
BAD: 'BAD',
|
|
9017
|
+
/**
|
|
9018
|
+
* Channel bandwidth is unknown (initial state)
|
|
9019
|
+
* @see Stream
|
|
9020
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
9021
|
+
*/
|
|
9022
|
+
UNKNOWN: 'UNKNOWN',
|
|
9023
|
+
/**
|
|
9024
|
+
* Channel bandwidth is updating
|
|
9025
|
+
* @see Stream
|
|
9026
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
9027
|
+
*/
|
|
9028
|
+
UPDATE: 'UPDATE'
|
|
9029
|
+
});
|
|
8948
9030
|
|
|
8949
9031
|
/**
|
|
8950
|
-
*
|
|
8951
|
-
* @
|
|
8952
|
-
* @memberOf Flashphoner.constants
|
|
9032
|
+
* Websocket signaling stream event
|
|
9033
|
+
* @see Stream
|
|
9034
|
+
* @memberOf Flashphoner.constants
|
|
8953
9035
|
*/
|
|
8954
|
-
|
|
9036
|
+
const STREAM_EVENT = 'STREAM_EVENT';
|
|
8955
9037
|
|
|
8956
9038
|
/**
|
|
8957
|
-
*
|
|
8958
|
-
* @
|
|
8959
|
-
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
9039
|
+
* Websocket signaling stream event type
|
|
9040
|
+
* @namespace Flashphoner.constants.STREAM_EVENT_TYPE
|
|
8960
9041
|
*/
|
|
8961
|
-
|
|
9042
|
+
const STREAM_EVENT_TYPE = Object.freeze({
|
|
9043
|
+
/**
|
|
9044
|
+
* Stream audio is muted
|
|
9045
|
+
* @see Stream
|
|
9046
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
9047
|
+
*/
|
|
9048
|
+
AUDIO_MUTED: 'audioMuted',
|
|
9049
|
+
/**
|
|
9050
|
+
* Stream audio is unmuted
|
|
9051
|
+
* @see Stream
|
|
9052
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
9053
|
+
*/
|
|
9054
|
+
AUDIO_UNMUTED: 'audioUnmuted',
|
|
9055
|
+
/**
|
|
9056
|
+
* Stream video is muted
|
|
9057
|
+
* @see Stream
|
|
9058
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
9059
|
+
*/
|
|
9060
|
+
VIDEO_MUTED: 'videoMuted',
|
|
9061
|
+
/**
|
|
9062
|
+
* Stream videoo is unmuted
|
|
9063
|
+
* @see Stream
|
|
9064
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
9065
|
+
*/
|
|
9066
|
+
VIDEO_UNMUTED: 'videoUnmuted',
|
|
9067
|
+
/**
|
|
9068
|
+
* Data bound to the stream are received
|
|
9069
|
+
* @see Stream
|
|
9070
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
9071
|
+
*/
|
|
9072
|
+
DATA: 'data'
|
|
9073
|
+
});
|
|
8962
9074
|
|
|
8963
9075
|
/**
|
|
8964
|
-
*
|
|
8965
|
-
* @
|
|
8966
|
-
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
9076
|
+
* WebRTC video content hint type
|
|
9077
|
+
* @namespace Flashphoner.constants.CONTENT_HINT_TYPE
|
|
8967
9078
|
*/
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
define(connectionQuality, 'BAD', 'BAD');
|
|
8989
|
-
define(connectionQuality, 'UNKNOWN', 'UNKNOWN');
|
|
8990
|
-
define(connectionQuality, 'UPDATE', 'UPDATE');
|
|
8991
|
-
|
|
8992
|
-
var streamEventType = {};
|
|
8993
|
-
|
|
8994
|
-
define(streamEventType, 'AUDIO_MUTED', 'audioMuted');
|
|
8995
|
-
define(streamEventType, 'AUDIO_UNMUTED', 'audioUnmuted');
|
|
8996
|
-
define(streamEventType, 'VIDEO_MUTED', 'videoMuted');
|
|
8997
|
-
define(streamEventType, 'VIDEO_UNMUTED', 'videoUnmuted');
|
|
8998
|
-
define(streamEventType, 'DATA', 'data');
|
|
8999
|
-
|
|
9000
|
-
var contentHintType = {};
|
|
9001
|
-
define(contentHintType, 'MOTION', 'motion');
|
|
9002
|
-
define(contentHintType, 'DETAIL', 'detail');
|
|
9003
|
-
define(contentHintType, 'TEXT', 'text');
|
|
9004
|
-
|
|
9005
|
-
var constants = {};
|
|
9006
|
-
define(constants, 'SESSION_STATUS', sessionStatus);
|
|
9007
|
-
define(constants, 'STREAM_EVENT_TYPE', streamEventType);
|
|
9008
|
-
define(constants, 'STREAM_EVENT', 'STREAM_EVENT');
|
|
9009
|
-
define(constants, 'STREAM_STATUS', streamStatus);
|
|
9010
|
-
define(constants, 'CALL_STATUS', callStatus);
|
|
9011
|
-
define(constants, 'STREAM_STATUS_INFO', streamStatusInfo);
|
|
9012
|
-
define(constants, 'CALL_STATUS_INFO', callStatusInfo);
|
|
9013
|
-
define(constants, 'ERROR_INFO', errorInfo);
|
|
9014
|
-
define(constants, 'MEDIA_DEVICE_KIND', mediaDeviceKind);
|
|
9015
|
-
define(constants, 'TRANSPORT_TYPE', transportType);
|
|
9016
|
-
define(constants, 'CONNECTION_QUALITY', connectionQuality);
|
|
9017
|
-
define(constants, 'CONTENT_HINT_TYPE', contentHintType);
|
|
9018
|
-
|
|
9019
|
-
//define helper
|
|
9020
|
-
function define(obj, name, value) {
|
|
9021
|
-
Object.defineProperty(obj, name, {
|
|
9022
|
-
value: value,
|
|
9023
|
-
enumerable: true
|
|
9024
|
-
});
|
|
9025
|
-
}
|
|
9079
|
+
const CONTENT_HINT_TYPE = Object.freeze({
|
|
9080
|
+
/**
|
|
9081
|
+
* Video content is motion (webcam case): keep FPS, resolution and bitrate may change
|
|
9082
|
+
* @see Stream
|
|
9083
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
9084
|
+
*/
|
|
9085
|
+
MOTION: 'motion',
|
|
9086
|
+
/**
|
|
9087
|
+
* Video content is detail (sreen sharing case): keep resolution, bitrate may change, FPS may drop
|
|
9088
|
+
* @see Stream
|
|
9089
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
9090
|
+
*/
|
|
9091
|
+
DETAIL: 'detail',
|
|
9092
|
+
/**
|
|
9093
|
+
* Video content is text (sreen sharing case): keep resolution and bitrate, FPS may drop
|
|
9094
|
+
* @see Stream
|
|
9095
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
9096
|
+
*/
|
|
9097
|
+
TEXT: 'text'
|
|
9098
|
+
});
|
|
9026
9099
|
|
|
9027
|
-
module.exports =
|
|
9100
|
+
module.exports = {
|
|
9101
|
+
SESSION_STATUS,
|
|
9102
|
+
STREAM_STATUS,
|
|
9103
|
+
CALL_STATUS,
|
|
9104
|
+
STREAM_STATUS_INFO,
|
|
9105
|
+
CALL_STATUS_INFO,
|
|
9106
|
+
ERROR_INFO,
|
|
9107
|
+
MEDIA_DEVICE_KIND,
|
|
9108
|
+
TRANSPORT_TYPE,
|
|
9109
|
+
CONNECTION_QUALITY,
|
|
9110
|
+
STREAM_EVENT,
|
|
9111
|
+
STREAM_EVENT_TYPE,
|
|
9112
|
+
CONTENT_HINT_TYPE
|
|
9113
|
+
};
|
|
9028
9114
|
|
|
9029
9115
|
},{}],41:[function(require,module,exports){
|
|
9030
9116
|
'use strict';
|
|
@@ -9071,6 +9157,11 @@ var createConnection = function(options) {
|
|
|
9071
9157
|
var display = options.display || options.localDisplay;
|
|
9072
9158
|
var flashBufferTime = options.flashBufferTime || 0;
|
|
9073
9159
|
|
|
9160
|
+
// Set connection logger #WCS-2434
|
|
9161
|
+
if (options.logger) {
|
|
9162
|
+
logger = options.logger;
|
|
9163
|
+
}
|
|
9164
|
+
|
|
9074
9165
|
var url = getConnectionUrl(options.mainUrl, options.flashProto, options.flashPort);
|
|
9075
9166
|
|
|
9076
9167
|
//todo state from flash instance
|
|
@@ -9635,7 +9726,8 @@ module.exports = {
|
|
|
9635
9726
|
const { v1: uuid_v1 } = require('uuid');
|
|
9636
9727
|
var constants = require("./constants");
|
|
9637
9728
|
var util = require('./util');
|
|
9638
|
-
var
|
|
9729
|
+
var LoggerObject = require('./util').logger;
|
|
9730
|
+
var coreLogger;
|
|
9639
9731
|
var loggerConf = {push: false, severity: "INFO"};
|
|
9640
9732
|
var Promise = require('promise-polyfill');
|
|
9641
9733
|
var KalmanFilter = require('kalmanjs');
|
|
@@ -9678,7 +9770,7 @@ var disableConnectionQualityCalculation;
|
|
|
9678
9770
|
* @param {String=} options.decoderLocation Location of video-worker2.js file
|
|
9679
9771
|
* @param {String=} options.screenSharingExtensionId Chrome screen sharing extension id
|
|
9680
9772
|
* @param {Object=} options.constraints Default local media constraints
|
|
9681
|
-
* @param {Object=} options.logger
|
|
9773
|
+
* @param {Object=} options.logger Core logger options
|
|
9682
9774
|
* @throws {Error} Error if none of MediaProviders available
|
|
9683
9775
|
* @memberof Flashphoner
|
|
9684
9776
|
*/
|
|
@@ -9687,12 +9779,8 @@ var init = function (options) {
|
|
|
9687
9779
|
if (!options) {
|
|
9688
9780
|
options = {};
|
|
9689
9781
|
}
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
loggerConf.enableLogs = true;
|
|
9693
|
-
}
|
|
9694
|
-
// init logger
|
|
9695
|
-
logger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
9782
|
+
// init global logger
|
|
9783
|
+
coreLogger = createLogger(options.logger);
|
|
9696
9784
|
var waitingTemasys = false;
|
|
9697
9785
|
try {
|
|
9698
9786
|
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
|
@@ -9709,7 +9797,7 @@ var init = function (options) {
|
|
|
9709
9797
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
9710
9798
|
extensionId: options.screenSharingExtensionId,
|
|
9711
9799
|
audioContext: audioContext,
|
|
9712
|
-
logger:
|
|
9800
|
+
logger: coreLogger,
|
|
9713
9801
|
createMicGainNode: enableGainNode
|
|
9714
9802
|
};
|
|
9715
9803
|
webRtcProvider.configure(webRtcConf);
|
|
@@ -9724,7 +9812,7 @@ var init = function (options) {
|
|
|
9724
9812
|
var webRtcConf = {
|
|
9725
9813
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
9726
9814
|
extensionId: options.screenSharingExtensionId,
|
|
9727
|
-
logger:
|
|
9815
|
+
logger: coreLogger
|
|
9728
9816
|
};
|
|
9729
9817
|
webRtcProvider.configure(webRtcConf);
|
|
9730
9818
|
|
|
@@ -9750,7 +9838,7 @@ var init = function (options) {
|
|
|
9750
9838
|
var flashConf = {
|
|
9751
9839
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
9752
9840
|
flashMediaProviderSwfLocation: options.flashMediaProviderSwfLocation,
|
|
9753
|
-
logger:
|
|
9841
|
+
logger: coreLogger
|
|
9754
9842
|
};
|
|
9755
9843
|
flashProvider.configure(flashConf);
|
|
9756
9844
|
}
|
|
@@ -9770,7 +9858,7 @@ var init = function (options) {
|
|
|
9770
9858
|
receiverLocation: options.receiverLocation,
|
|
9771
9859
|
decoderLocation: options.decoderLocation,
|
|
9772
9860
|
audioContext: audioContext,
|
|
9773
|
-
logger:
|
|
9861
|
+
logger: coreLogger
|
|
9774
9862
|
};
|
|
9775
9863
|
websocketProvider.configure(wsConf);
|
|
9776
9864
|
}
|
|
@@ -9790,7 +9878,7 @@ var init = function (options) {
|
|
|
9790
9878
|
MediaProvider = _MediaProvider;
|
|
9791
9879
|
}
|
|
9792
9880
|
} else {
|
|
9793
|
-
|
|
9881
|
+
corelogger.warn(LOG_PREFIX, "Preferred media provider is not available.");
|
|
9794
9882
|
}
|
|
9795
9883
|
}
|
|
9796
9884
|
if (options.preferredMediaProviders && options.preferredMediaProviders.length > 0) {
|
|
@@ -9813,7 +9901,7 @@ var init = function (options) {
|
|
|
9813
9901
|
if (!waitingTemasys && options.mediaProvidersReadyCallback) {
|
|
9814
9902
|
options.mediaProvidersReadyCallback(Object.keys(MediaProvider));
|
|
9815
9903
|
}
|
|
9816
|
-
|
|
9904
|
+
coreLogger.info(LOG_PREFIX, "Initialized");
|
|
9817
9905
|
initialized = true;
|
|
9818
9906
|
}
|
|
9819
9907
|
};
|
|
@@ -9851,17 +9939,16 @@ var playFirstVideo = function (display, isLocal, src) {
|
|
|
9851
9939
|
};
|
|
9852
9940
|
|
|
9853
9941
|
/**
|
|
9854
|
-
* Get logger
|
|
9942
|
+
* Get core logger
|
|
9855
9943
|
*
|
|
9856
9944
|
* @returns {Object} Logger
|
|
9857
9945
|
* @memberof Flashphoner
|
|
9858
9946
|
*/
|
|
9859
|
-
|
|
9860
9947
|
var getLogger = function () {
|
|
9861
9948
|
if (!initialized) {
|
|
9862
9949
|
console.warn("Initialize API first.");
|
|
9863
9950
|
} else {
|
|
9864
|
-
return
|
|
9951
|
+
return coreLogger;
|
|
9865
9952
|
}
|
|
9866
9953
|
}
|
|
9867
9954
|
|
|
@@ -10020,6 +10107,26 @@ var getSession = function (id) {
|
|
|
10020
10107
|
return sessions[id];
|
|
10021
10108
|
};
|
|
10022
10109
|
|
|
10110
|
+
// Get logger configuration from options
|
|
10111
|
+
var getLoggerConf = function(loggerOptions) {
|
|
10112
|
+
var conf = loggerOptions || loggerConf;
|
|
10113
|
+
if (loggerOptions !== null) {
|
|
10114
|
+
conf.enableLogs = true;
|
|
10115
|
+
}
|
|
10116
|
+
return conf;
|
|
10117
|
+
}
|
|
10118
|
+
|
|
10119
|
+
// Create a new logger object
|
|
10120
|
+
var createLogger = function(loggerOptions, parentLogger = coreLogger) {
|
|
10121
|
+
var newLogger = parentLogger;
|
|
10122
|
+
if (newLogger === undefined || loggerOptions != undefined) {
|
|
10123
|
+
var loggerConf = getLoggerConf(loggerOptions);
|
|
10124
|
+
newLogger = new LoggerObject;
|
|
10125
|
+
newLogger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
10126
|
+
}
|
|
10127
|
+
return newLogger;
|
|
10128
|
+
}
|
|
10129
|
+
|
|
10023
10130
|
/**
|
|
10024
10131
|
* Create new session and connect to server.
|
|
10025
10132
|
*
|
|
@@ -10038,6 +10145,7 @@ var getSession = function (id) {
|
|
|
10038
10145
|
* @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
|
|
10039
10146
|
* @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
|
|
10040
10147
|
* @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
|
|
10148
|
+
* @param {Object=} options.logger Session logger options
|
|
10041
10149
|
* @returns {Session} Created session
|
|
10042
10150
|
* @throws {Error} Error if API is not initialized
|
|
10043
10151
|
* @throws {TypeError} Error if options.urlServer is not specified
|
|
@@ -10052,6 +10160,11 @@ var createSession = function (options) {
|
|
|
10052
10160
|
throw new TypeError("options.urlServer must be provided");
|
|
10053
10161
|
}
|
|
10054
10162
|
|
|
10163
|
+
// Set session logger #WCS-2434
|
|
10164
|
+
var sessionLogger = createLogger(options.logger)
|
|
10165
|
+
// Override logger for all low level operations
|
|
10166
|
+
var logger = sessionLogger;
|
|
10167
|
+
|
|
10055
10168
|
var id_ = uuid_v1();
|
|
10056
10169
|
var sessionStatus = SESSION_STATUS.PENDING;
|
|
10057
10170
|
var urlServer = options.urlServer;
|
|
@@ -10150,7 +10263,7 @@ var createSession = function (options) {
|
|
|
10150
10263
|
if (timeout != undefined && timeout > 0) {
|
|
10151
10264
|
connectionTimeout = setTimeout(function() {
|
|
10152
10265
|
if (wsConnection.readyState == 0) {
|
|
10153
|
-
|
|
10266
|
+
logger.warn(LOG_PREFIX, "WS connection timeout");
|
|
10154
10267
|
wsConnection.close();
|
|
10155
10268
|
}
|
|
10156
10269
|
}, timeout);
|
|
@@ -10171,7 +10284,7 @@ var createSession = function (options) {
|
|
|
10171
10284
|
mediaProviders: Object.keys(MediaProvider),
|
|
10172
10285
|
keepAlive: keepAlive,
|
|
10173
10286
|
authToken:authToken,
|
|
10174
|
-
clientVersion: "2.0.
|
|
10287
|
+
clientVersion: "2.0.217",
|
|
10175
10288
|
clientOSVersion: window.navigator.appVersion,
|
|
10176
10289
|
clientBrowserVersion: window.navigator.userAgent,
|
|
10177
10290
|
msePacketizationVersion: 2,
|
|
@@ -10428,6 +10541,7 @@ var createSession = function (options) {
|
|
|
10428
10541
|
* @param {Array<string>=} options.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
10429
10542
|
* @param {Array<string>=} options.sipHeaders Array of custom SIP headers
|
|
10430
10543
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
10544
|
+
* @param {Object=} options.logger Call logger options
|
|
10431
10545
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
10432
10546
|
* @returns {Call} Call
|
|
10433
10547
|
* @throws {TypeError} Error if no options provided
|
|
@@ -10438,14 +10552,19 @@ var createSession = function (options) {
|
|
|
10438
10552
|
var createCall = function (options) {
|
|
10439
10553
|
//check session state
|
|
10440
10554
|
if (sessionStatus !== SESSION_STATUS.REGISTERED && sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
10441
|
-
|
|
10442
|
-
throw new Error('Invalid session state');
|
|
10555
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
10443
10556
|
}
|
|
10444
10557
|
|
|
10445
10558
|
//check options
|
|
10446
10559
|
if (!options) {
|
|
10447
10560
|
throw new TypeError("options must be provided");
|
|
10448
10561
|
}
|
|
10562
|
+
|
|
10563
|
+
// Set call logger #WCS-2434
|
|
10564
|
+
var callLogger = createLogger(options.logger, sessionLogger);
|
|
10565
|
+
// Override logger for all low level operations
|
|
10566
|
+
var logger = callLogger;
|
|
10567
|
+
|
|
10449
10568
|
var login = (appKey == 'clickToCallApp') ? '' : cConfig.sipLogin;
|
|
10450
10569
|
var caller_ = (options.incoming) ? options.caller : login;
|
|
10451
10570
|
var callee_ = options.callee;
|
|
@@ -10581,7 +10700,8 @@ var createSession = function (options) {
|
|
|
10581
10700
|
constraints: constraints,
|
|
10582
10701
|
connectionConfig: mediaOptions,
|
|
10583
10702
|
audioOutputId: audioOutputId,
|
|
10584
|
-
videoContentHint: videoContentHint
|
|
10703
|
+
videoContentHint: videoContentHint,
|
|
10704
|
+
logger: logger
|
|
10585
10705
|
}).then(function (newConnection) {
|
|
10586
10706
|
mediaConnection = newConnection;
|
|
10587
10707
|
return mediaConnection.createOffer({
|
|
@@ -11092,7 +11212,7 @@ var createSession = function (options) {
|
|
|
11092
11212
|
/**
|
|
11093
11213
|
* Get call info
|
|
11094
11214
|
* @returns {string} Info
|
|
11095
|
-
* @memberof
|
|
11215
|
+
* @memberof Call
|
|
11096
11216
|
* @inner
|
|
11097
11217
|
*/
|
|
11098
11218
|
var getInfo = function () {
|
|
@@ -11102,13 +11222,22 @@ var createSession = function (options) {
|
|
|
11102
11222
|
/**
|
|
11103
11223
|
* Get stream error info
|
|
11104
11224
|
* @returns {string} Error info
|
|
11105
|
-
* @memberof
|
|
11225
|
+
* @memberof Call
|
|
11106
11226
|
* @inner
|
|
11107
11227
|
*/
|
|
11108
11228
|
var getErrorInfo = function () {
|
|
11109
11229
|
return errorInfo_;
|
|
11110
11230
|
};
|
|
11111
11231
|
|
|
11232
|
+
/**
|
|
11233
|
+
* Get call logger
|
|
11234
|
+
*
|
|
11235
|
+
* @returns {Object} Logger
|
|
11236
|
+
* @memberof Call
|
|
11237
|
+
*/
|
|
11238
|
+
var getLogger = function () {
|
|
11239
|
+
return callLogger;
|
|
11240
|
+
};
|
|
11112
11241
|
|
|
11113
11242
|
call.call = call_;
|
|
11114
11243
|
call.answer = answer;
|
|
@@ -11140,6 +11269,7 @@ var createSession = function (options) {
|
|
|
11140
11269
|
call.switchMic = switchMic;
|
|
11141
11270
|
call.switchToScreen = switchToScreen;
|
|
11142
11271
|
call.switchToCam = switchToCam;
|
|
11272
|
+
call.getLogger = getLogger;
|
|
11143
11273
|
calls[id_] = call;
|
|
11144
11274
|
return call;
|
|
11145
11275
|
};
|
|
@@ -11187,6 +11317,7 @@ var createSession = function (options) {
|
|
|
11187
11317
|
* @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
|
|
11188
11318
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
11189
11319
|
* @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
|
|
11320
|
+
* @param {Object=} options.logger Stream logger options
|
|
11190
11321
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
11191
11322
|
* @returns {Stream} Stream
|
|
11192
11323
|
* @throws {TypeError} Error if no options provided
|
|
@@ -11201,7 +11332,7 @@ var createSession = function (options) {
|
|
|
11201
11332
|
var availableCallbacks = [];
|
|
11202
11333
|
//check session state
|
|
11203
11334
|
if (sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
11204
|
-
throw new Error('Invalid session state');
|
|
11335
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
11205
11336
|
}
|
|
11206
11337
|
|
|
11207
11338
|
//check options
|
|
@@ -11212,6 +11343,11 @@ var createSession = function (options) {
|
|
|
11212
11343
|
throw new TypeError("options.name must be provided");
|
|
11213
11344
|
}
|
|
11214
11345
|
|
|
11346
|
+
// Set stream logger #WCS-2434
|
|
11347
|
+
var streamLogger = createLogger(options.logger, sessionLogger);
|
|
11348
|
+
// Override logger for all low level operations
|
|
11349
|
+
var logger = streamLogger;
|
|
11350
|
+
|
|
11215
11351
|
var clientKf = new KalmanFilter();
|
|
11216
11352
|
var serverKf = new KalmanFilter();
|
|
11217
11353
|
|
|
@@ -11448,7 +11584,7 @@ var createSession = function (options) {
|
|
|
11448
11584
|
var play = function () {
|
|
11449
11585
|
logger.debug(LOG_PREFIX, "Play stream " + name_);
|
|
11450
11586
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
11451
|
-
throw new Error("Invalid stream state");
|
|
11587
|
+
throw new Error("Invalid stream state " + status_);
|
|
11452
11588
|
}
|
|
11453
11589
|
status_ = STREAM_STATUS.PENDING;
|
|
11454
11590
|
//create mediaProvider connection
|
|
@@ -11466,7 +11602,8 @@ var createSession = function (options) {
|
|
|
11466
11602
|
audioOutputId: audioOutputId,
|
|
11467
11603
|
remoteVideo: remoteVideo,
|
|
11468
11604
|
playoutDelay: playoutDelay,
|
|
11469
|
-
unmutePlayOnStart: unmutePlayOnStart
|
|
11605
|
+
unmutePlayOnStart: unmutePlayOnStart,
|
|
11606
|
+
logger: logger
|
|
11470
11607
|
}, streamRefreshHandlers[id_]).then(function (newConnection) {
|
|
11471
11608
|
mediaConnection = newConnection;
|
|
11472
11609
|
try {
|
|
@@ -11523,7 +11660,7 @@ var createSession = function (options) {
|
|
|
11523
11660
|
var publish = function () {
|
|
11524
11661
|
logger.debug(LOG_PREFIX, "Publish stream " + name_);
|
|
11525
11662
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
11526
|
-
throw new Error("Invalid stream state");
|
|
11663
|
+
throw new Error("Invalid stream state " + status_);
|
|
11527
11664
|
}
|
|
11528
11665
|
status_ = STREAM_STATUS.PENDING;
|
|
11529
11666
|
published_ = true;
|
|
@@ -11554,7 +11691,8 @@ var createSession = function (options) {
|
|
|
11554
11691
|
connectionConfig: mediaOptions,
|
|
11555
11692
|
connectionConstraints: mediaConnectionConstraints,
|
|
11556
11693
|
customStream: constraints && constraints.customStream ? constraints.customStream : false,
|
|
11557
|
-
videoContentHint: videoContentHint
|
|
11694
|
+
videoContentHint: videoContentHint,
|
|
11695
|
+
logger: logger
|
|
11558
11696
|
}).then(function (newConnection) {
|
|
11559
11697
|
mediaConnection = newConnection;
|
|
11560
11698
|
return mediaConnection.createOffer({
|
|
@@ -12133,6 +12271,16 @@ var createSession = function (options) {
|
|
|
12133
12271
|
});
|
|
12134
12272
|
};
|
|
12135
12273
|
|
|
12274
|
+
/**
|
|
12275
|
+
* Get stream logger
|
|
12276
|
+
*
|
|
12277
|
+
* @returns {Object} Logger
|
|
12278
|
+
* @memberof Stream
|
|
12279
|
+
*/
|
|
12280
|
+
var getLogger = function () {
|
|
12281
|
+
return streamLogger;
|
|
12282
|
+
};
|
|
12283
|
+
|
|
12136
12284
|
stream.play = play;
|
|
12137
12285
|
stream.publish = publish;
|
|
12138
12286
|
stream.stop = stop;
|
|
@@ -12171,6 +12319,7 @@ var createSession = function (options) {
|
|
|
12171
12319
|
stream.switchToScreen = switchToScreen;
|
|
12172
12320
|
stream.switchToCam = switchToCam;
|
|
12173
12321
|
stream.sendData = sendData;
|
|
12322
|
+
stream.getLogger = getLogger;
|
|
12174
12323
|
|
|
12175
12324
|
streams[id_] = stream;
|
|
12176
12325
|
return stream;
|
|
@@ -12361,6 +12510,16 @@ var createSession = function (options) {
|
|
|
12361
12510
|
return sdp;
|
|
12362
12511
|
}
|
|
12363
12512
|
|
|
12513
|
+
/**
|
|
12514
|
+
* Get session logger
|
|
12515
|
+
*
|
|
12516
|
+
* @returns {Object} Logger
|
|
12517
|
+
* @memberof Session
|
|
12518
|
+
*/
|
|
12519
|
+
var getLogger = function () {
|
|
12520
|
+
return sessionLogger;
|
|
12521
|
+
};
|
|
12522
|
+
|
|
12364
12523
|
//export Session
|
|
12365
12524
|
session.id = id;
|
|
12366
12525
|
session.status = status;
|
|
@@ -12375,6 +12534,7 @@ var createSession = function (options) {
|
|
|
12375
12534
|
session.startDebug = startDebug;
|
|
12376
12535
|
session.stopDebug = stopDebug;
|
|
12377
12536
|
session.on = on;
|
|
12537
|
+
session.getLogger = getLogger;
|
|
12378
12538
|
|
|
12379
12539
|
//save interface to global map
|
|
12380
12540
|
sessions[id_] = session;
|
|
@@ -12877,8 +13037,15 @@ var appSession = function (options) {
|
|
|
12877
13037
|
|
|
12878
13038
|
//participant helpers
|
|
12879
13039
|
function play(streamName) {
|
|
12880
|
-
|
|
12881
|
-
|
|
13040
|
+
// Pass stream options to play #WCS-3445
|
|
13041
|
+
return function (display, options = {}) {
|
|
13042
|
+
var streamOptions = {
|
|
13043
|
+
...options,
|
|
13044
|
+
name: streamName,
|
|
13045
|
+
display: display,
|
|
13046
|
+
custom: {name: name_}
|
|
13047
|
+
};
|
|
13048
|
+
var stream = session.createStream(streamOptions);
|
|
12882
13049
|
stream.play();
|
|
12883
13050
|
return stream;
|
|
12884
13051
|
}
|
|
@@ -12992,6 +13159,11 @@ var Promise = require('es6-promise').Promise;
|
|
|
12992
13159
|
|
|
12993
13160
|
var createConnection = function (options) {
|
|
12994
13161
|
return new Promise(function (resolve, reject) {
|
|
13162
|
+
// Set connection logger #WCS-2434
|
|
13163
|
+
if (options.logger) {
|
|
13164
|
+
logger = options.logger;
|
|
13165
|
+
}
|
|
13166
|
+
|
|
12995
13167
|
var id = options.id;
|
|
12996
13168
|
var connectionConfig = options.connectionConfig || {"iceServers": []};
|
|
12997
13169
|
var connection = new RTCPeerConnection(connectionConfig, {
|
|
@@ -13547,148 +13719,157 @@ module.exports = {
|
|
|
13547
13719
|
},{"./util":46,"es6-promise":1,"uuid":9,"webrtc-adapter":24}],46:[function(require,module,exports){
|
|
13548
13720
|
'use strict';
|
|
13549
13721
|
|
|
13550
|
-
|
|
13722
|
+
const isEmptyObject = function( obj ) {
|
|
13723
|
+
for ( var name in obj ) {
|
|
13724
|
+
return false;
|
|
13725
|
+
}
|
|
13726
|
+
return true;
|
|
13727
|
+
};
|
|
13551
13728
|
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13729
|
+
/**
|
|
13730
|
+
* Copy values of object own properties to array.
|
|
13731
|
+
*
|
|
13732
|
+
* @param obj
|
|
13733
|
+
* @returns {Array}
|
|
13734
|
+
*/
|
|
13735
|
+
const copyObjectToArray = function(obj) {
|
|
13736
|
+
var ret = [];
|
|
13737
|
+
for (var prop in obj) {
|
|
13738
|
+
if(obj.hasOwnProperty(prop)) {
|
|
13739
|
+
ret.push(obj[prop]);
|
|
13555
13740
|
}
|
|
13556
|
-
|
|
13557
|
-
|
|
13741
|
+
}
|
|
13742
|
+
return ret;
|
|
13743
|
+
};
|
|
13558
13744
|
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
for (var prop in obj) {
|
|
13568
|
-
if(obj.hasOwnProperty(prop)) {
|
|
13569
|
-
ret.push(obj[prop]);
|
|
13570
|
-
}
|
|
13571
|
-
}
|
|
13572
|
-
return ret;
|
|
13573
|
-
},
|
|
13574
|
-
/**
|
|
13575
|
-
* Copy src properties to dst object.
|
|
13576
|
-
* Will overwrite dst prop with src prop in case of dst prop exist.
|
|
13577
|
-
*/
|
|
13578
|
-
copyObjectPropsToAnotherObject: function(src, dst) {
|
|
13579
|
-
for (var prop in src) {
|
|
13580
|
-
if(src.hasOwnProperty(prop)) {
|
|
13581
|
-
dst[prop] = src[prop];
|
|
13582
|
-
}
|
|
13745
|
+
/**
|
|
13746
|
+
* Copy src properties to dst object.
|
|
13747
|
+
* Will overwrite dst prop with src prop in case of dst prop exist.
|
|
13748
|
+
*/
|
|
13749
|
+
const copyObjectPropsToAnotherObject = function(src, dst) {
|
|
13750
|
+
for (var prop in src) {
|
|
13751
|
+
if(src.hasOwnProperty(prop)) {
|
|
13752
|
+
dst[prop] = src[prop];
|
|
13583
13753
|
}
|
|
13584
|
-
}
|
|
13585
|
-
|
|
13586
|
-
var result = {};
|
|
13587
|
-
if (browser == "chrome") {
|
|
13588
|
-
/**
|
|
13589
|
-
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
13590
|
-
*/
|
|
13591
|
-
var gotResult = false;
|
|
13592
|
-
if (report.type && report.type == "googCandidatePair") {
|
|
13593
|
-
//check if this is active pair
|
|
13594
|
-
if (report.googActiveConnection == "true") {
|
|
13595
|
-
gotResult = true;
|
|
13596
|
-
}
|
|
13597
|
-
}
|
|
13754
|
+
}
|
|
13755
|
+
};
|
|
13598
13756
|
|
|
13599
|
-
|
|
13757
|
+
const processRtcStatsReport = function(browser, report) {
|
|
13758
|
+
var result = {};
|
|
13759
|
+
if (browser == "chrome") {
|
|
13760
|
+
/**
|
|
13761
|
+
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
13762
|
+
*/
|
|
13763
|
+
var gotResult = false;
|
|
13764
|
+
if (report.type && report.type == "googCandidatePair") {
|
|
13765
|
+
//check if this is active pair
|
|
13766
|
+
if (report.googActiveConnection == "true") {
|
|
13600
13767
|
gotResult = true;
|
|
13601
13768
|
}
|
|
13769
|
+
}
|
|
13602
13770
|
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13771
|
+
if (report.type && report.type == "ssrc") {
|
|
13772
|
+
gotResult = true;
|
|
13773
|
+
}
|
|
13774
|
+
|
|
13775
|
+
if (gotResult) {
|
|
13776
|
+
for (var k in report) {
|
|
13777
|
+
if (report.hasOwnProperty(k)) {
|
|
13778
|
+
result[k] = report[k];
|
|
13608
13779
|
}
|
|
13609
13780
|
}
|
|
13610
|
-
|
|
13611
|
-
|
|
13612
|
-
|
|
13613
|
-
|
|
13614
|
-
|
|
13781
|
+
}
|
|
13782
|
+
return result;
|
|
13783
|
+
} else if (browser == "firefox") {
|
|
13784
|
+
/**
|
|
13785
|
+
* RTCStatsReport http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl
|
|
13786
|
+
*/
|
|
13615
13787
|
|
|
13616
|
-
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
}
|
|
13788
|
+
if (report.type && (report.type == "outboundrtp" || report.type == "inboundrtp") && report.id.indexOf("rtcp") == -1) {
|
|
13789
|
+
result = {};
|
|
13790
|
+
for (var k in report) {
|
|
13791
|
+
if (report.hasOwnProperty(k)) {
|
|
13792
|
+
result[k] = report[k];
|
|
13622
13793
|
}
|
|
13623
13794
|
}
|
|
13795
|
+
}
|
|
13796
|
+
|
|
13797
|
+
return result;
|
|
13798
|
+
} else {
|
|
13799
|
+
return result
|
|
13800
|
+
}
|
|
13801
|
+
};
|
|
13624
13802
|
|
|
13625
|
-
|
|
13626
|
-
|
|
13803
|
+
const Browser = {
|
|
13804
|
+
isIE: function () {
|
|
13805
|
+
return /*@cc_on!@*/false || !!document.documentMode;
|
|
13627
13806
|
},
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
return /*@cc_on!@*/false || !!document.documentMode;
|
|
13631
|
-
},
|
|
13632
|
-
isFirefox: function () {
|
|
13633
|
-
return typeof InstallTrigger !== 'undefined';
|
|
13634
|
-
},
|
|
13635
|
-
isChrome: function () {
|
|
13636
|
-
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
13637
|
-
},
|
|
13638
|
-
isEdge: function () {
|
|
13639
|
-
return !isIE && !!window.StyleMedia;
|
|
13640
|
-
},
|
|
13641
|
-
isOpera: function () {
|
|
13642
|
-
return (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
13643
|
-
},
|
|
13644
|
-
isiOS: function () {
|
|
13645
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
13646
|
-
},
|
|
13647
|
-
isSafari: function () {
|
|
13648
|
-
var userAgent = navigator.userAgent.toLowerCase();
|
|
13649
|
-
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
13650
|
-
},
|
|
13651
|
-
isAndroid: function () {
|
|
13652
|
-
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
13653
|
-
},
|
|
13654
|
-
isSafariWebRTC: function () {
|
|
13655
|
-
return navigator.mediaDevices && this.isSafari();
|
|
13656
|
-
},
|
|
13657
|
-
isSamsungBrowser: function() {
|
|
13658
|
-
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
13659
|
-
},
|
|
13660
|
-
isAndroidFirefox: function () {
|
|
13661
|
-
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
13662
|
-
}
|
|
13807
|
+
isFirefox: function () {
|
|
13808
|
+
return typeof InstallTrigger !== 'undefined';
|
|
13663
13809
|
},
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13810
|
+
isChrome: function () {
|
|
13811
|
+
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
13812
|
+
},
|
|
13813
|
+
isEdge: function () {
|
|
13814
|
+
return !isIE && !!window.StyleMedia;
|
|
13815
|
+
},
|
|
13816
|
+
isOpera: function () {
|
|
13817
|
+
return (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
13818
|
+
},
|
|
13819
|
+
isiOS: function () {
|
|
13820
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
13821
|
+
},
|
|
13822
|
+
isSafari: function () {
|
|
13823
|
+
var userAgent = navigator.userAgent.toLowerCase();
|
|
13824
|
+
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
13825
|
+
},
|
|
13826
|
+
isAndroid: function () {
|
|
13827
|
+
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
13828
|
+
},
|
|
13829
|
+
isSafariWebRTC: function () {
|
|
13830
|
+
return navigator.mediaDevices && this.isSafari();
|
|
13831
|
+
},
|
|
13832
|
+
isSamsungBrowser: function() {
|
|
13833
|
+
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
13834
|
+
},
|
|
13835
|
+
isAndroidFirefox: function () {
|
|
13836
|
+
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
13837
|
+
},
|
|
13838
|
+
isChromiumEdge: function () {
|
|
13839
|
+
return /Chrome/i.test(navigator.userAgent) && /Edg/i.test(navigator.userAgent);
|
|
13840
|
+
}
|
|
13841
|
+
};
|
|
13842
|
+
|
|
13843
|
+
const SDP = {
|
|
13844
|
+
matchPrefix: function(sdp,prefix) {
|
|
13845
|
+
var parts = sdp.trim().split('\n').map(function(line) {
|
|
13846
|
+
return line.trim();
|
|
13847
|
+
});
|
|
13848
|
+
return parts.filter(function(line) {
|
|
13849
|
+
return line.indexOf(prefix) === 0;
|
|
13850
|
+
});
|
|
13851
|
+
},
|
|
13852
|
+
writeFmtp: function (sdp, param, codec) {
|
|
13853
|
+
var sdpArray = sdp.split("\n");
|
|
13854
|
+
var i;
|
|
13855
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
13856
|
+
if (sdpArray[i].search(codec) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
13857
|
+
sdpArray[i] += "\na=fmtp:" + sdpArray[i].match(/[0-9]+/)[0] + " " + param + "\r";
|
|
13680
13858
|
}
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13859
|
+
}
|
|
13860
|
+
//normalize sdp after modifications
|
|
13861
|
+
var result = "";
|
|
13862
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
13863
|
+
if (sdpArray[i] != "") {
|
|
13864
|
+
result += sdpArray[i] + "\n";
|
|
13687
13865
|
}
|
|
13688
|
-
return result;
|
|
13689
13866
|
}
|
|
13690
|
-
|
|
13691
|
-
|
|
13867
|
+
return result;
|
|
13868
|
+
}
|
|
13869
|
+
};
|
|
13870
|
+
|
|
13871
|
+
const logger = function() {
|
|
13872
|
+
return {
|
|
13692
13873
|
init: function (verbosity, enablePushLogs, customLogger, enableLogs) {
|
|
13693
13874
|
switch (verbosity.toUpperCase()) {
|
|
13694
13875
|
case "DEBUG":
|
|
@@ -13725,7 +13906,6 @@ module.exports = {
|
|
|
13725
13906
|
data: [{logs: delayedLogs[i]}]
|
|
13726
13907
|
}));
|
|
13727
13908
|
}
|
|
13728
|
-
|
|
13729
13909
|
}
|
|
13730
13910
|
delayedLogs = [];
|
|
13731
13911
|
this.wsConnection.send(JSON.stringify({
|
|
@@ -13749,7 +13929,7 @@ module.exports = {
|
|
|
13749
13929
|
this.customLogger.info(text);
|
|
13750
13930
|
} else {
|
|
13751
13931
|
console.log(prefix,text);
|
|
13752
|
-
|
|
13932
|
+
}
|
|
13753
13933
|
}
|
|
13754
13934
|
},
|
|
13755
13935
|
debug: function (src, text) {
|
|
@@ -13770,7 +13950,7 @@ module.exports = {
|
|
|
13770
13950
|
if (!this.enableLogs){
|
|
13771
13951
|
return;
|
|
13772
13952
|
}
|
|
13773
|
-
|
|
13953
|
+
var prefix = this.date() + " TRACE " + src + " - ";
|
|
13774
13954
|
this.pushLogs(prefix + JSON.stringify(text) + '\n');
|
|
13775
13955
|
if (this.verbosity >= 4) {
|
|
13776
13956
|
if (this.customLogger != null) {
|
|
@@ -13784,7 +13964,7 @@ module.exports = {
|
|
|
13784
13964
|
if (!this.enableLogs){
|
|
13785
13965
|
return;
|
|
13786
13966
|
}
|
|
13787
|
-
|
|
13967
|
+
var prefix = this.date() + " WARN " + src + " - ";
|
|
13788
13968
|
this.pushLogs(prefix + JSON.stringify(text) + '\n');
|
|
13789
13969
|
if (this.verbosity >= 1) {
|
|
13790
13970
|
if (this.customLogger != null) {
|
|
@@ -13798,7 +13978,7 @@ module.exports = {
|
|
|
13798
13978
|
if (!this.enableLogs){
|
|
13799
13979
|
return;
|
|
13800
13980
|
}
|
|
13801
|
-
|
|
13981
|
+
var prefix = this.date() + " ERROR " + src + " - ";
|
|
13802
13982
|
this.pushLogs(prefix + JSON.stringify(text) + '\n');
|
|
13803
13983
|
if (this.verbosity >= 0) {
|
|
13804
13984
|
if (this.customLogger != null) {
|
|
@@ -13840,82 +14020,96 @@ module.exports = {
|
|
|
13840
14020
|
break;
|
|
13841
14021
|
default :
|
|
13842
14022
|
this.verbosity = 2;
|
|
13843
|
-
}
|
|
14023
|
+
}
|
|
13844
14024
|
}
|
|
13845
|
-
}
|
|
13846
|
-
|
|
13847
|
-
if (!codecs.length) return sdp;
|
|
14025
|
+
}
|
|
14026
|
+
};
|
|
13848
14027
|
|
|
13849
|
-
|
|
13850
|
-
|
|
14028
|
+
const stripCodecs = function(sdp, codecs) {
|
|
14029
|
+
if (!codecs.length) return sdp;
|
|
13851
14030
|
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
14031
|
+
var sdpArray = sdp.split("\n");
|
|
14032
|
+
var codecsArray = codecs.split(",");
|
|
14033
|
+
|
|
14034
|
+
//search and delete codecs line
|
|
14035
|
+
var pt = [];
|
|
14036
|
+
var i;
|
|
14037
|
+
for (var p = 0; p < codecsArray.length; p++) {
|
|
14038
|
+
console.log("Searching for codec " + codecsArray[p]);
|
|
14039
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14040
|
+
if (sdpArray[i].search(new RegExp(codecsArray[p],'i')) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
14041
|
+
console.log(codecsArray[p] + " detected");
|
|
14042
|
+
pt.push(sdpArray[i].match(/[0-9]+/)[0]);
|
|
14043
|
+
sdpArray[i] = "";
|
|
14044
|
+
}
|
|
14045
|
+
}
|
|
14046
|
+
}
|
|
14047
|
+
if (pt.length) {
|
|
14048
|
+
//searching for fmtp
|
|
14049
|
+
for (p = 0; p < pt.length; p++) {
|
|
13857
14050
|
for (i = 0; i < sdpArray.length; i++) {
|
|
13858
|
-
if (sdpArray[i].search(
|
|
13859
|
-
console.log(codecsArray[p] + " detected");
|
|
13860
|
-
pt.push(sdpArray[i].match(/[0-9]+/)[0]);
|
|
14051
|
+
if (sdpArray[i].search("a=fmtp:" + pt[p]) != -1 || sdpArray[i].search("a=rtcp-fb:" + pt[p]) != -1) {
|
|
13861
14052
|
sdpArray[i] = "";
|
|
13862
14053
|
}
|
|
13863
14054
|
}
|
|
13864
14055
|
}
|
|
13865
|
-
if (pt.length) {
|
|
13866
|
-
//searching for fmtp
|
|
13867
|
-
for (p = 0; p < pt.length; p++) {
|
|
13868
|
-
for (i = 0; i < sdpArray.length; i++) {
|
|
13869
|
-
if (sdpArray[i].search("a=fmtp:" + pt[p]) != -1 || sdpArray[i].search("a=rtcp-fb:" + pt[p]) != -1) {
|
|
13870
|
-
sdpArray[i] = "";
|
|
13871
|
-
}
|
|
13872
|
-
}
|
|
13873
|
-
}
|
|
13874
14056
|
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
|
|
13879
|
-
|
|
13880
|
-
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
}
|
|
14057
|
+
//delete entries from m= line
|
|
14058
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14059
|
+
if (sdpArray[i].search("m=audio") != -1 || sdpArray[i].search("m=video") != -1) {
|
|
14060
|
+
var mLineSplitted = sdpArray[i].split(" ");
|
|
14061
|
+
var newMLine = "";
|
|
14062
|
+
for (var m = 0; m < mLineSplitted.length; m++) {
|
|
14063
|
+
if (pt.indexOf(mLineSplitted[m].trim()) == -1 || m <= 2) {
|
|
14064
|
+
newMLine += mLineSplitted[m];
|
|
14065
|
+
if (m < mLineSplitted.length - 1) {
|
|
14066
|
+
newMLine = newMLine + " ";
|
|
13886
14067
|
}
|
|
13887
14068
|
}
|
|
13888
|
-
sdpArray[i] = newMLine;
|
|
13889
14069
|
}
|
|
14070
|
+
sdpArray[i] = newMLine;
|
|
13890
14071
|
}
|
|
13891
14072
|
}
|
|
14073
|
+
}
|
|
13892
14074
|
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
}
|
|
14075
|
+
//normalize sdp after modifications
|
|
14076
|
+
var result = "";
|
|
14077
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14078
|
+
if (sdpArray[i] != "") {
|
|
14079
|
+
result += sdpArray[i] + "\n";
|
|
13899
14080
|
}
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
14081
|
+
}
|
|
14082
|
+
return result;
|
|
14083
|
+
};
|
|
14084
|
+
|
|
14085
|
+
const getCurrentCodecAndSampleRate = function(sdp, mediaType) {
|
|
14086
|
+
var rows = sdp.split("\n");
|
|
14087
|
+
var codecPt;
|
|
14088
|
+
for (var i = 0; i < rows.length ; i++) {
|
|
14089
|
+
if (codecPt && rows[i].indexOf("a=rtpmap:" + codecPt) != -1) {
|
|
14090
|
+
var ret = {};
|
|
14091
|
+
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
14092
|
+
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
14093
|
+
return ret;
|
|
14094
|
+
}
|
|
14095
|
+
//WCS-2136. WebRTC statistics doesn't work for VP8
|
|
14096
|
+
if (rows[i].indexOf("m=" + mediaType) != -1) {
|
|
14097
|
+
codecPt = rows[i].split(" ")[3].trim();
|
|
13916
14098
|
}
|
|
13917
14099
|
}
|
|
14100
|
+
};
|
|
13918
14101
|
|
|
14102
|
+
|
|
14103
|
+
module.exports = {
|
|
14104
|
+
isEmptyObject,
|
|
14105
|
+
copyObjectToArray,
|
|
14106
|
+
copyObjectPropsToAnotherObject,
|
|
14107
|
+
processRtcStatsReport,
|
|
14108
|
+
Browser,
|
|
14109
|
+
SDP,
|
|
14110
|
+
logger,
|
|
14111
|
+
stripCodecs,
|
|
14112
|
+
getCurrentCodecAndSampleRate
|
|
13919
14113
|
};
|
|
13920
14114
|
|
|
13921
14115
|
},{}],47:[function(require,module,exports){
|
|
@@ -13944,6 +14138,11 @@ var mics = [];
|
|
|
13944
14138
|
var createConnection = function (options) {
|
|
13945
14139
|
return new Promise(function (resolve, reject) {
|
|
13946
14140
|
|
|
14141
|
+
// Set connection logger #WCS-2434
|
|
14142
|
+
if (options.logger) {
|
|
14143
|
+
logger = options.logger;
|
|
14144
|
+
}
|
|
14145
|
+
|
|
13947
14146
|
var id = options.id;
|
|
13948
14147
|
var connectionConfig = options.connectionConfig || {"iceServers": []};
|
|
13949
14148
|
var connectionConstraints = options.connectionConstraints || {};
|
|
@@ -14052,9 +14251,9 @@ var createConnection = function (options) {
|
|
|
14052
14251
|
function setContentHint(stream, hint) {
|
|
14053
14252
|
stream.getVideoTracks().forEach(function(track) {
|
|
14054
14253
|
if(track.contentHint === undefined) {
|
|
14055
|
-
logger.warn("contentHint unsupported");
|
|
14254
|
+
logger.warn(LOG_PREFIX, "Track contentHint unsupported");
|
|
14056
14255
|
} else {
|
|
14057
|
-
logger.info("Set video track contentHint to " + hint);
|
|
14256
|
+
logger.info(LOG_PREFIX, "Set video track contentHint to " + hint);
|
|
14058
14257
|
track.contentHint = hint;
|
|
14059
14258
|
}
|
|
14060
14259
|
});
|
|
@@ -14089,7 +14288,7 @@ var createConnection = function (options) {
|
|
|
14089
14288
|
//WCS-2771 add playback delay
|
|
14090
14289
|
connection.getReceivers().forEach((track) => {
|
|
14091
14290
|
if (track.playoutDelayHint === undefined) {
|
|
14092
|
-
logger.warn("
|
|
14291
|
+
logger.warn(LOG_PREFIX, "Playout delay unsupported");
|
|
14093
14292
|
}
|
|
14094
14293
|
track.playoutDelayHint = playoutDelay;
|
|
14095
14294
|
});
|
|
@@ -14439,7 +14638,7 @@ var createConnection = function (options) {
|
|
|
14439
14638
|
if (localVideo.srcObject.getAudioTracks().length == 0 && audioTrack) {
|
|
14440
14639
|
localVideo.srcObject.addTrack(audioTrack);
|
|
14441
14640
|
}
|
|
14442
|
-
logger.info("Switch camera to " + cam);
|
|
14641
|
+
logger.info(LOG_PREFIX, "Switch camera to " + cam);
|
|
14443
14642
|
resolve(cam);
|
|
14444
14643
|
}).catch(function (reason) {
|
|
14445
14644
|
logger.error(LOG_PREFIX, reason);
|
|
@@ -14490,7 +14689,7 @@ var createConnection = function (options) {
|
|
|
14490
14689
|
if (videoTrack) {
|
|
14491
14690
|
localVideo.srcObject.addTrack(videoTrack);
|
|
14492
14691
|
}
|
|
14493
|
-
logger.info("Switch mic to " + mic);
|
|
14692
|
+
logger.info(LOG_PREFIX, "Switch mic to " + mic);
|
|
14494
14693
|
resolve(mic);
|
|
14495
14694
|
}).catch(function (reason) {
|
|
14496
14695
|
logger.error(LOG_PREFIX, reason);
|
|
@@ -14578,7 +14777,7 @@ var createConnection = function (options) {
|
|
|
14578
14777
|
localVideo.srcObject.addTrack(currentAudioTrack);
|
|
14579
14778
|
}
|
|
14580
14779
|
});
|
|
14581
|
-
logger.info("Switch to screen");
|
|
14780
|
+
logger.info(LOG_PREFIX, "Switch to screen");
|
|
14582
14781
|
screenShare = true;
|
|
14583
14782
|
resolve();
|
|
14584
14783
|
};
|
|
@@ -14606,7 +14805,7 @@ var createConnection = function (options) {
|
|
|
14606
14805
|
}
|
|
14607
14806
|
});
|
|
14608
14807
|
}
|
|
14609
|
-
logger.info("Switch to cam");
|
|
14808
|
+
logger.info(LOG_PREFIX, "Switch to cam");
|
|
14610
14809
|
screenShare = false;
|
|
14611
14810
|
};
|
|
14612
14811
|
|
|
@@ -15402,6 +15601,11 @@ var createConnection = function(options, handlers) {
|
|
|
15402
15601
|
var id = options.id;
|
|
15403
15602
|
var display = options.display;
|
|
15404
15603
|
|
|
15604
|
+
// Set connection logger #WCS-2434
|
|
15605
|
+
if (options.logger) {
|
|
15606
|
+
logger = options.logger;
|
|
15607
|
+
}
|
|
15608
|
+
|
|
15405
15609
|
var canvas = document.createElement("canvas");
|
|
15406
15610
|
display.appendChild(canvas);
|
|
15407
15611
|
canvas.id = id;
|