@flashphoner/websdk 2.0.240 → 2.0.242

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.
@@ -56,11 +56,14 @@ var createConnection = function (options) {
56
56
  var screenShare = false;
57
57
  var playoutDelay = options.playoutDelay;
58
58
  // Set video track contentHint to `detail` by default to workaround Chromium 91 bug #WCS-3257
59
- var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail';
59
+ // Set video track contentHint to `motion` by default to keep bitrate and fps for better camera stream quality #WCS-4109
60
+ var videoContentHint = options.videoContentHint ? options.videoContentHint : 'motion';
60
61
  // Pass the option to unmute automatically (true by default) #WCS-2425
61
62
  var unmutePlayOnStart = options.unmutePlayOnStart !== undefined ? options.unmutePlayOnStart : true;
62
63
  // Use a standard HTML5 video controls if needed (to enable fullscreen in Safari 16 for example) #WCS-3606
63
64
  var useControls = options.useControls || false;
65
+ // Stream event handler to rise an event #WCS-4097
66
+ var unmuteRequiredEvent = options.unmuteRequiredEvent ? options.unmuteRequiredEvent : null;
64
67
 
65
68
  if (bidirectional) {
66
69
  localVideo = getCacheInstance(localDisplay);
@@ -174,6 +177,9 @@ var createConnection = function (options) {
174
177
  // Automatically unmute video if needed #WCS-2425
175
178
  if (unmutePlayOnStart) {
176
179
  remoteVideo.muted = false;
180
+ } else {
181
+ // Fire UNMUTE_REQUIRED stream event #WCS-4097
182
+ fireUnmuteEvent();
177
183
  }
178
184
  }).catch(function (e) {
179
185
  if (validBrowsers.includes(browserDetails.browser)) {
@@ -182,6 +188,8 @@ var createConnection = function (options) {
182
188
  logger.info(LOG_PREFIX, "Autoplay detected! Trying to play a video with a muted sound...");
183
189
  remoteVideo.muted = true;
184
190
  remoteVideo.play();
191
+ // Fire UNMUTE_REQUIRED stream event #WCS-4097
192
+ fireUnmuteEvent();
185
193
  } else {
186
194
  logger.error(LOG_PREFIX, e);
187
195
  }
@@ -793,6 +801,12 @@ var createConnection = function (options) {
793
801
  });
794
802
  };
795
803
 
804
+ var fireUnmuteEvent = function() {
805
+ if (unmuteRequiredEvent && typeof unmuteRequiredEvent === 'function') {
806
+ unmuteRequiredEvent();
807
+ }
808
+ };
809
+
796
810
  var exports = {};
797
811
  exports.state = state;
798
812
  exports.createOffer = createOffer;