@flashphoner/websdk 2.0.206 → 2.0.210

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.
Files changed (39) hide show
  1. package/docTemplate/README.md +1 -1
  2. package/examples/demo/streaming/2players/2players.js +0 -5
  3. package/examples/demo/streaming/canvas_streaming/canvas_streaming.js +0 -12
  4. package/examples/demo/streaming/embed_player/player.js +127 -198
  5. package/examples/demo/streaming/firewall-traversal-streaming/firewall-traversal-streaming.js +0 -12
  6. package/examples/demo/streaming/mcu_client/mcu_client.js +0 -8
  7. package/examples/demo/streaming/media_devices_manager/manager.js +2 -17
  8. package/examples/demo/streaming/player/player.js +10 -9
  9. package/examples/demo/streaming/screen-sharing/screen-sharing.html +1 -1
  10. package/examples/demo/streaming/screen-sharing/screen-sharing.js +1 -1
  11. package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.css +23 -0
  12. package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.html +152 -0
  13. package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.js +744 -0
  14. package/examples/demo/streaming/stream-diagnostic/stream-diagnostic.js +0 -8
  15. package/examples/demo/streaming/stream-local-snapshot/stream-local-snapshot.js +0 -6
  16. package/examples/demo/streaming/stream-snapshot/stream-snapshot.js +0 -6
  17. package/examples/demo/streaming/stream_recording/recording.js +0 -6
  18. package/examples/demo/streaming/streamer/streamer.js +0 -8
  19. package/examples/demo/streaming/two_way_streaming/two_way_streaming.js +0 -11
  20. package/examples/demo/streaming/webrtc-as-rtmp-republishing/webrtc-as-rtmp-republishing.js +0 -6
  21. package/flashphoner-no-flash.js +131 -29
  22. package/flashphoner-no-flash.min.js +2 -2
  23. package/flashphoner-no-webrtc.js +103 -19
  24. package/flashphoner-no-webrtc.min.js +1 -1
  25. package/flashphoner-no-wsplayer.js +132 -30
  26. package/flashphoner-no-wsplayer.min.js +2 -2
  27. package/flashphoner-room-api.js +105 -12
  28. package/flashphoner-room-api.min.js +2 -2
  29. package/flashphoner-temasys-flash-websocket-without-adapterjs.js +105 -21
  30. package/flashphoner-temasys-flash-websocket.js +105 -21
  31. package/flashphoner-temasys-flash-websocket.min.js +1 -1
  32. package/flashphoner-webrtc-only.js +129 -27
  33. package/flashphoner-webrtc-only.min.js +1 -1
  34. package/flashphoner.js +132 -30
  35. package/flashphoner.min.js +2 -2
  36. package/package.json +1 -1
  37. package/src/flashphoner-core.d.ts +22 -5
  38. package/src/flashphoner-core.js +79 -3
  39. package/src/webrtc-media-provider.js +26 -9
package/flashphoner.js CHANGED
@@ -371,7 +371,7 @@ process.umask = function () {
371
371
 
372
372
  },{}],4:[function(require,module,exports){
373
373
  (function (setImmediate){(function (){
374
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
374
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
375
375
 
376
376
  (function (root) {
377
377
  // Store setTimeout reference so promise-polyfill will be unaffected by
@@ -2434,7 +2434,7 @@ module.exports = function (window, edgeVersion) {
2434
2434
  /* eslint-env node */
2435
2435
  'use strict'; // SDP helpers.
2436
2436
 
2437
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2437
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2438
2438
 
2439
2439
  var SDPUtils = {}; // Generate an alphanumeric identifier for cname or mids.
2440
2440
  // TODO: use UUIDs instead? https://gist.github.com/jed/982883
@@ -3267,7 +3267,7 @@ if ((typeof module === "undefined" ? "undefined" : _typeof(module)) === 'object'
3267
3267
  }
3268
3268
 
3269
3269
  },{}],7:[function(require,module,exports){
3270
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3270
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3271
3271
 
3272
3272
  /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
3273
3273
  is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
@@ -5318,7 +5318,7 @@ function adapterFactory() {
5318
5318
  /* eslint-env node */
5319
5319
  'use strict';
5320
5320
 
5321
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
5321
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
5322
5322
 
5323
5323
  Object.defineProperty(exports, "__esModule", {
5324
5324
  value: true
@@ -6243,7 +6243,7 @@ function shimGetDisplayMedia(window, getSourceId) {
6243
6243
  /* eslint-env node */
6244
6244
  'use strict';
6245
6245
 
6246
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
6246
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
6247
6247
 
6248
6248
  Object.defineProperty(exports, "__esModule", {
6249
6249
  value: true
@@ -6502,7 +6502,7 @@ function shimGetUserMedia(window, browserDetails) {
6502
6502
  /* eslint-env node */
6503
6503
  'use strict';
6504
6504
 
6505
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
6505
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
6506
6506
 
6507
6507
  Object.defineProperty(exports, "__esModule", {
6508
6508
  value: true
@@ -7251,7 +7251,7 @@ function shimGetUserMedia(window) {
7251
7251
  /* eslint-env node */
7252
7252
  'use strict';
7253
7253
 
7254
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
7254
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
7255
7255
 
7256
7256
  Object.defineProperty(exports, "__esModule", {
7257
7257
  value: true
@@ -7704,7 +7704,7 @@ function shimGetDisplayMedia(window, preferredMediaSource) {
7704
7704
  /* eslint-env node */
7705
7705
  'use strict';
7706
7706
 
7707
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
7707
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
7708
7708
 
7709
7709
  Object.defineProperty(exports, "__esModule", {
7710
7710
  value: true
@@ -7806,7 +7806,7 @@ function shimGetUserMedia(window, browserDetails) {
7806
7806
  */
7807
7807
  'use strict';
7808
7808
 
7809
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
7809
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
7810
7810
 
7811
7811
  Object.defineProperty(exports, "__esModule", {
7812
7812
  value: true
@@ -8257,7 +8257,7 @@ function shimAudioContext(window) {
8257
8257
  /* eslint-env node */
8258
8258
  'use strict';
8259
8259
 
8260
- function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
8260
+ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
8261
8261
 
8262
8262
  Object.defineProperty(exports, "__esModule", {
8263
8263
  value: true
@@ -8573,7 +8573,7 @@ function filterStats(result, track, outbound) {
8573
8573
  }
8574
8574
 
8575
8575
  },{}],39:[function(require,module,exports){
8576
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8576
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8577
8577
 
8578
8578
  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'];
8579
8579
 
@@ -10397,7 +10397,7 @@ module.exports = constants;
10397
10397
  },{}],41:[function(require,module,exports){
10398
10398
  'use strict';
10399
10399
 
10400
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
10400
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10401
10401
 
10402
10402
  var swfobject = require('swfobject');
10403
10403
 
@@ -11032,7 +11032,7 @@ module.exports = {
11032
11032
  },{"promise-polyfill":4,"swfobject":7,"uuid":9}],42:[function(require,module,exports){
11033
11033
  'use strict';
11034
11034
 
11035
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
11035
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
11036
11036
 
11037
11037
  var _require = require('uuid'),
11038
11038
  uuid_v1 = _require.v1;
@@ -11487,6 +11487,9 @@ var getSession = function getSession(id) {
11487
11487
  * @param {Object=} options.sipOptions Sip configuration
11488
11488
  * @param {Object=} options.mediaOptions Media connection configuration
11489
11489
  * @param {Integer=} options.timeout Connection timeout in milliseconds
11490
+ * @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
11491
+ * @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
11492
+ * @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
11490
11493
  * @returns {Session} Created session
11491
11494
  * @throws {Error} Error if API is not initialized
11492
11495
  * @throws {TypeError} Error if options.urlServer is not specified
@@ -11513,6 +11516,8 @@ var createSession = function createSession(options) {
11513
11516
  var mediaOptions = options.mediaOptions;
11514
11517
  var keepAlive = options.keepAlive;
11515
11518
  var timeout = options.timeout;
11519
+ var wsPingSender = new WSPingSender(options.pingInterval || 0);
11520
+ var wsPingReceiver = new WSPingReceiver(options.receiveProbes || 0, options.probesInterval || 0);
11516
11521
  var connectionTimeout;
11517
11522
  var cConfig; //SIP config
11518
11523
 
@@ -11630,7 +11635,7 @@ var createSession = function createSession(options) {
11630
11635
  mediaProviders: Object.keys(MediaProvider),
11631
11636
  keepAlive: keepAlive,
11632
11637
  authToken: authToken,
11633
- clientVersion: "2.0.206",
11638
+ clientVersion: "2.0.210",
11634
11639
  clientOSVersion: window.navigator.appVersion,
11635
11640
  clientBrowserVersion: window.navigator.userAgent,
11636
11641
  msePacketizationVersion: 2,
@@ -11643,7 +11648,11 @@ var createSession = function createSession(options) {
11643
11648
 
11644
11649
 
11645
11650
  send("connection", cConfig);
11646
- logger.setConnection(wsConnection);
11651
+ logger.setConnection(wsConnection); // Send ping messages to server to check if connection is still alive #WCS-3410
11652
+
11653
+ wsPingSender.start(); // Check subsequintel pings received from server to check if connection is still alive #WCS-3410
11654
+
11655
+ wsPingReceiver.start();
11647
11656
  };
11648
11657
 
11649
11658
  wsConnection.onmessage = function (event) {
@@ -11659,6 +11668,7 @@ var createSession = function createSession(options) {
11659
11668
  switch (data.message) {
11660
11669
  case 'ping':
11661
11670
  send("pong", null);
11671
+ wsPingReceiver.success();
11662
11672
  break;
11663
11673
 
11664
11674
  case 'getUserData':
@@ -11818,7 +11828,11 @@ var createSession = function createSession(options) {
11818
11828
  sessionStatus = newStatus;
11819
11829
 
11820
11830
  if (sessionStatus == SESSION_STATUS.DISCONNECTED || sessionStatus == SESSION_STATUS.FAILED) {
11821
- //remove streams
11831
+ // Stop pinging server #WCS-3410
11832
+ wsPingSender.stop(); // Stop checking pings received #WCS-3410
11833
+
11834
+ wsPingReceiver.stop(); //remove streams
11835
+
11822
11836
  for (var prop in streamRefreshHandlers) {
11823
11837
  if (streamRefreshHandlers.hasOwnProperty(prop) && typeof streamRefreshHandlers[prop] === 'function') {
11824
11838
  streamRefreshHandlers[prop]({
@@ -11834,6 +11848,73 @@ var createSession = function createSession(options) {
11834
11848
  if (callbacks[sessionStatus]) {
11835
11849
  callbacks[sessionStatus](session, obj);
11836
11850
  }
11851
+ } // Websocket periodic ping sender
11852
+
11853
+
11854
+ function WSPingSender(interval) {
11855
+ this.interval = interval || 0;
11856
+ this.intervalId = null;
11857
+
11858
+ this.start = function () {
11859
+ if (this.interval > 0) {
11860
+ this.intervalId = setInterval(function () {
11861
+ send("ping", null);
11862
+ }, this.interval);
11863
+ }
11864
+ };
11865
+
11866
+ this.stop = function () {
11867
+ if (this.intervalId) {
11868
+ clearInterval(this.intervalId);
11869
+ }
11870
+ };
11871
+
11872
+ return this;
11873
+ } // Websocket ping receive prober
11874
+
11875
+
11876
+ function WSPingReceiver(receiveProbes, probesInterval) {
11877
+ this.maxPings = receiveProbes || 0;
11878
+ this.interval = probesInterval || 0;
11879
+ this.intervalId = null;
11880
+ this.pingsMissing = 0;
11881
+
11882
+ this.start = function () {
11883
+ if (this.maxPings > 0 && this.interval > 0) {
11884
+ var receiver = this;
11885
+ this.intervalId = setInterval(function () {
11886
+ receiver.checkPingsReceived();
11887
+ }, this.interval);
11888
+ }
11889
+ };
11890
+
11891
+ this.stop = function () {
11892
+ if (this.intervalId) {
11893
+ clearInterval(this.intervalId);
11894
+ }
11895
+
11896
+ this.pingsMissing = 0;
11897
+ };
11898
+
11899
+ this.checkPingsReceived = function () {
11900
+ this.pingsMissing++;
11901
+
11902
+ if (this.pingsMissing >= this.maxPings) {
11903
+ this.failure();
11904
+ }
11905
+ };
11906
+
11907
+ this.success = function () {
11908
+ this.pingsMissing = 0;
11909
+ };
11910
+
11911
+ this.failure = function () {
11912
+ logger.info(LOG_PREFIX, "Missing " + this.pingsMissing + " pings from server, connection seems to be down");
11913
+ onSessionStatusChange(SESSION_STATUS.FAILED);
11914
+ wsConnection.close();
11915
+ };
11916
+
11917
+ return this;
11837
11918
  }
11838
11919
  /**
11839
11920
  * @callback sdpHook
@@ -12698,7 +12779,7 @@ var createSession = function createSession(options) {
12698
12779
  * @param {HTMLElement} options.display Div element stream should be displayed in
12699
12780
  * @param {Object=} options.custom User provided custom object that will be available in REST App code
12700
12781
  * @param {Integer} [options.flashBufferTime=0] Specifies how long to buffer messages before starting to display the stream (Flash-only)
12701
- * @param {String=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
12782
+ * @param {string=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
12702
12783
  * @param {string=} options.rtmpUrl Rtmp url stream should be forwarded to
12703
12784
  * @param {Object=} options.mediaConnectionConstraints Stream specific constraints for underlying RTCPeerConnection
12704
12785
  * @param {Boolean=} options.flashShowFullScreenButton Show full screen button in flash
@@ -12707,6 +12788,7 @@ var createSession = function createSession(options) {
12707
12788
  * @param {Integer=} options.playoutDelay Time delay between network reception of media and playout
12708
12789
  * @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
12709
12790
  * @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
12791
+ * @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
12710
12792
  * @param {sdpHook} sdpHook The callback that handles sdp from the server
12711
12793
  * @returns {Stream} Stream
12712
12794
  * @throws {TypeError} Error if no options provided
@@ -12818,6 +12900,7 @@ var createSession = function createSession(options) {
12818
12900
  var playoutDelay = options.playoutDelay;
12819
12901
  var useCanvasMediaStream = options.useCanvasMediaStream;
12820
12902
  var videoContentHint = options.videoContentHint;
12903
+ var unmutePlayOnStart = options.unmutePlayOnStart;
12821
12904
  var audioState_;
12822
12905
  var videoState_;
12823
12906
  var connectionQuality;
@@ -12994,7 +13077,8 @@ var createSession = function createSession(options) {
12994
13077
  connectionConstraints: mediaConnectionConstraints,
12995
13078
  audioOutputId: audioOutputId,
12996
13079
  remoteVideo: remoteVideo,
12997
- playoutDelay: playoutDelay
13080
+ playoutDelay: playoutDelay,
13081
+ unmutePlayOnStart: unmutePlayOnStart
12998
13082
  }, streamRefreshHandlers[id_]).then(function (newConnection) {
12999
13083
  mediaConnection = newConnection;
13000
13084
 
@@ -14458,7 +14542,7 @@ module.exports = {
14458
14542
  },{}],45:[function(require,module,exports){
14459
14543
  'use strict';
14460
14544
 
14461
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
14545
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14462
14546
 
14463
14547
  var browserDetails = require('webrtc-adapter')["default"].browserDetails;
14464
14548
 
@@ -14522,7 +14606,9 @@ var createConnection = function createConnection(options) {
14522
14606
  var screenShare = false;
14523
14607
  var playoutDelay = options.playoutDelay; // Set video track contentHint to `detail` by default to workaround Chromium 91 bug #WCS-3257
14524
14608
 
14525
- var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail';
14609
+ var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail'; // Pass the option to unmute automatically (true by default) #WCS-2425
14610
+
14611
+ var unmutePlayOnStart = options.unmutePlayOnStart !== undefined ? options.unmutePlayOnStart : true;
14526
14612
 
14527
14613
  if (bidirectional) {
14528
14614
  localVideo = getCacheInstance(localDisplay);
@@ -14541,7 +14627,7 @@ var createConnection = function createConnection(options) {
14541
14627
  remoteVideo = getCacheInstance(remoteDisplay);
14542
14628
 
14543
14629
  if (!remoteVideo) {
14544
- remoteVideo = document.createElement('video');
14630
+ remoteVideo = createVideoElement();
14545
14631
  remoteDisplay.appendChild(remoteVideo);
14546
14632
  }
14547
14633
 
@@ -14566,7 +14652,7 @@ var createConnection = function createConnection(options) {
14566
14652
  if (cachedVideo) {
14567
14653
  remoteVideo = cachedVideo;
14568
14654
  } else {
14569
- remoteVideo = document.createElement('video');
14655
+ remoteVideo = createVideoElement();
14570
14656
  display.appendChild(remoteVideo);
14571
14657
  }
14572
14658
 
@@ -14630,7 +14716,12 @@ var createConnection = function createConnection(options) {
14630
14716
 
14631
14717
  remoteVideo.onloadedmetadata = function (e) {
14632
14718
  if (remoteVideo) {
14633
- remoteVideo.play()["catch"](function (e) {
14719
+ remoteVideo.play().then(function () {
14720
+ // Automatically unmute video if needed #WCS-2425
14721
+ if (unmutePlayOnStart) {
14722
+ remoteVideo.muted = false;
14723
+ }
14724
+ })["catch"](function (e) {
14634
14725
  if (validBrowsers.includes(browserDetails.browser)) {
14635
14726
  //WCS-1698. fixed autoplay in chromium based browsers
14636
14727
  //WCS-2375. fixed autoplay in ios safari
@@ -14945,7 +15036,7 @@ var createConnection = function createConnection(options) {
14945
15036
  if (report.type == 'outbound-rtp') {
14946
15037
  fillStatObject(result.outboundStream, report);
14947
15038
 
14948
- if (report.mediaType == 'video') {
15039
+ if (report.mediaType == 'video' && localVideo != undefined && localVideo != null) {
14949
15040
  var vSettings = localVideo.srcObject.getVideoTracks()[0].getSettings();
14950
15041
  result.outboundStream[report.mediaType].height = vSettings.height;
14951
15042
  result.outboundStream[report.mediaType].width = vSettings.width;
@@ -14953,7 +15044,7 @@ var createConnection = function createConnection(options) {
14953
15044
  } else if (report.type == 'inbound-rtp') {
14954
15045
  fillStatObject(result.inboundStream, report);
14955
15046
 
14956
- if (report.mediaType == 'video' && remoteVideo != undefined) {
15047
+ if (report.mediaType == 'video' && remoteVideo != undefined && remoteVideo != null) {
14957
15048
  result.inboundStream[report.mediaType].height = remoteVideo.videoHeight;
14958
15049
  result.inboundStream[report.mediaType].width = remoteVideo.videoWidth;
14959
15050
  }
@@ -15126,7 +15217,7 @@ var createConnection = function createConnection(options) {
15126
15217
  clonedConstraints.video.mediaSource = source;
15127
15218
  }
15128
15219
 
15129
- if (window.chrome && woExtension) {
15220
+ if (woExtension) {
15130
15221
  getScreenDeviceIdWoExtension(clonedConstraints).then(function (screenSharingConstraints) {
15131
15222
  navigator.mediaDevices.getDisplayMedia(screenSharingConstraints).then(function (stream) {
15132
15223
  processScreenStream(stream, resolve);
@@ -15399,14 +15490,12 @@ var loadOrdinaryVideo = function loadOrdinaryVideo(display, stream, screenShare,
15399
15490
  var vEl = video;
15400
15491
 
15401
15492
  if (!vEl) {
15402
- vEl = document.createElement('video');
15493
+ vEl = createVideoElement();
15403
15494
  display.appendChild(vEl);
15404
15495
  }
15405
15496
 
15406
15497
  vEl.id = uuid_v1() + LOCAL_CACHED_VIDEO;
15407
- vEl.srcObject = stream; //mute audio
15408
-
15409
- vEl.muted = true;
15498
+ vEl.srcObject = stream;
15410
15499
 
15411
15500
  vEl.onloadedmetadata = function (e) {
15412
15501
  //WCS-2751 Add screen capture using getDisplayMedia in Safari
@@ -15782,6 +15871,19 @@ function getCacheInstance(display) {
15782
15871
  }
15783
15872
  }
15784
15873
 
15874
+ function createVideoElement() {
15875
+ var video = document.createElement('video'); // Prepare video tag to auto play and add specific Safari tweaks #WCS-2425
15876
+
15877
+ video.muted = true;
15878
+
15879
+ if (util.Browser.isSafariWebRTC()) {
15880
+ video.setAttribute("playsinline", "");
15881
+ video.setAttribute("webkit-playsinline", "");
15882
+ }
15883
+
15884
+ return video;
15885
+ }
15886
+
15785
15887
  function removeVideoElement(video) {
15786
15888
  if (video.srcObject) {
15787
15889
  //pause