@flashphoner/websdk 2.0.209 → 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 (34) 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 +0 -12
  8. package/examples/demo/streaming/player/player.js +10 -9
  9. package/examples/demo/streaming/stream-diagnostic/stream-diagnostic.js +0 -8
  10. package/examples/demo/streaming/stream-local-snapshot/stream-local-snapshot.js +0 -6
  11. package/examples/demo/streaming/stream-snapshot/stream-snapshot.js +0 -6
  12. package/examples/demo/streaming/stream_recording/recording.js +0 -6
  13. package/examples/demo/streaming/streamer/streamer.js +0 -8
  14. package/examples/demo/streaming/two_way_streaming/two_way_streaming.js +0 -11
  15. package/examples/demo/streaming/webrtc-as-rtmp-republishing/webrtc-as-rtmp-republishing.js +0 -6
  16. package/flashphoner-no-flash.js +32 -11
  17. package/flashphoner-no-flash.min.js +2 -2
  18. package/flashphoner-no-webrtc.js +6 -3
  19. package/flashphoner-no-webrtc.min.js +1 -1
  20. package/flashphoner-no-wsplayer.js +32 -11
  21. package/flashphoner-no-wsplayer.min.js +2 -2
  22. package/flashphoner-room-api.js +29 -9
  23. package/flashphoner-room-api.min.js +2 -2
  24. package/flashphoner-temasys-flash-websocket-without-adapterjs.js +6 -3
  25. package/flashphoner-temasys-flash-websocket.js +6 -3
  26. package/flashphoner-temasys-flash-websocket.min.js +1 -1
  27. package/flashphoner-webrtc-only.js +32 -11
  28. package/flashphoner-webrtc-only.min.js +1 -1
  29. package/flashphoner.js +32 -11
  30. package/flashphoner.min.js +2 -2
  31. package/package.json +1 -1
  32. package/src/flashphoner-core.d.ts +18 -4
  33. package/src/flashphoner-core.js +6 -3
  34. package/src/webrtc-media-provider.js +23 -6
@@ -9046,7 +9046,7 @@ var createSession = function createSession(options) {
9046
9046
  mediaProviders: Object.keys(MediaProvider),
9047
9047
  keepAlive: keepAlive,
9048
9048
  authToken: authToken,
9049
- clientVersion: "2.0.209",
9049
+ clientVersion: "2.0.210",
9050
9050
  clientOSVersion: window.navigator.appVersion,
9051
9051
  clientBrowserVersion: window.navigator.userAgent,
9052
9052
  msePacketizationVersion: 2,
@@ -10190,7 +10190,7 @@ var createSession = function createSession(options) {
10190
10190
  * @param {HTMLElement} options.display Div element stream should be displayed in
10191
10191
  * @param {Object=} options.custom User provided custom object that will be available in REST App code
10192
10192
  * @param {Integer} [options.flashBufferTime=0] Specifies how long to buffer messages before starting to display the stream (Flash-only)
10193
- * @param {String=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
10193
+ * @param {string=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
10194
10194
  * @param {string=} options.rtmpUrl Rtmp url stream should be forwarded to
10195
10195
  * @param {Object=} options.mediaConnectionConstraints Stream specific constraints for underlying RTCPeerConnection
10196
10196
  * @param {Boolean=} options.flashShowFullScreenButton Show full screen button in flash
@@ -10199,6 +10199,7 @@ var createSession = function createSession(options) {
10199
10199
  * @param {Integer=} options.playoutDelay Time delay between network reception of media and playout
10200
10200
  * @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
10201
10201
  * @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
10202
+ * @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
10202
10203
  * @param {sdpHook} sdpHook The callback that handles sdp from the server
10203
10204
  * @returns {Stream} Stream
10204
10205
  * @throws {TypeError} Error if no options provided
@@ -10310,6 +10311,7 @@ var createSession = function createSession(options) {
10310
10311
  var playoutDelay = options.playoutDelay;
10311
10312
  var useCanvasMediaStream = options.useCanvasMediaStream;
10312
10313
  var videoContentHint = options.videoContentHint;
10314
+ var unmutePlayOnStart = options.unmutePlayOnStart;
10313
10315
  var audioState_;
10314
10316
  var videoState_;
10315
10317
  var connectionQuality;
@@ -10486,7 +10488,8 @@ var createSession = function createSession(options) {
10486
10488
  connectionConstraints: mediaConnectionConstraints,
10487
10489
  audioOutputId: audioOutputId,
10488
10490
  remoteVideo: remoteVideo,
10489
- playoutDelay: playoutDelay
10491
+ playoutDelay: playoutDelay,
10492
+ unmutePlayOnStart: unmutePlayOnStart
10490
10493
  }, streamRefreshHandlers[id_]).then(function (newConnection) {
10491
10494
  mediaConnection = newConnection;
10492
10495
 
@@ -12004,7 +12007,9 @@ var createConnection = function createConnection(options) {
12004
12007
  var screenShare = false;
12005
12008
  var playoutDelay = options.playoutDelay; // Set video track contentHint to `detail` by default to workaround Chromium 91 bug #WCS-3257
12006
12009
 
12007
- var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail';
12010
+ var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail'; // Pass the option to unmute automatically (true by default) #WCS-2425
12011
+
12012
+ var unmutePlayOnStart = options.unmutePlayOnStart !== undefined ? options.unmutePlayOnStart : true;
12008
12013
 
12009
12014
  if (bidirectional) {
12010
12015
  localVideo = getCacheInstance(localDisplay);
@@ -12023,7 +12028,7 @@ var createConnection = function createConnection(options) {
12023
12028
  remoteVideo = getCacheInstance(remoteDisplay);
12024
12029
 
12025
12030
  if (!remoteVideo) {
12026
- remoteVideo = document.createElement('video');
12031
+ remoteVideo = createVideoElement();
12027
12032
  remoteDisplay.appendChild(remoteVideo);
12028
12033
  }
12029
12034
 
@@ -12048,7 +12053,7 @@ var createConnection = function createConnection(options) {
12048
12053
  if (cachedVideo) {
12049
12054
  remoteVideo = cachedVideo;
12050
12055
  } else {
12051
- remoteVideo = document.createElement('video');
12056
+ remoteVideo = createVideoElement();
12052
12057
  display.appendChild(remoteVideo);
12053
12058
  }
12054
12059
 
@@ -12112,7 +12117,12 @@ var createConnection = function createConnection(options) {
12112
12117
 
12113
12118
  remoteVideo.onloadedmetadata = function (e) {
12114
12119
  if (remoteVideo) {
12115
- remoteVideo.play()["catch"](function (e) {
12120
+ remoteVideo.play().then(function () {
12121
+ // Automatically unmute video if needed #WCS-2425
12122
+ if (unmutePlayOnStart) {
12123
+ remoteVideo.muted = false;
12124
+ }
12125
+ })["catch"](function (e) {
12116
12126
  if (validBrowsers.includes(browserDetails.browser)) {
12117
12127
  //WCS-1698. fixed autoplay in chromium based browsers
12118
12128
  //WCS-2375. fixed autoplay in ios safari
@@ -12881,14 +12891,12 @@ var loadOrdinaryVideo = function loadOrdinaryVideo(display, stream, screenShare,
12881
12891
  var vEl = video;
12882
12892
 
12883
12893
  if (!vEl) {
12884
- vEl = document.createElement('video');
12894
+ vEl = createVideoElement();
12885
12895
  display.appendChild(vEl);
12886
12896
  }
12887
12897
 
12888
12898
  vEl.id = uuid_v1() + LOCAL_CACHED_VIDEO;
12889
- vEl.srcObject = stream; //mute audio
12890
-
12891
- vEl.muted = true;
12899
+ vEl.srcObject = stream;
12892
12900
 
12893
12901
  vEl.onloadedmetadata = function (e) {
12894
12902
  //WCS-2751 Add screen capture using getDisplayMedia in Safari
@@ -13264,6 +13272,19 @@ function getCacheInstance(display) {
13264
13272
  }
13265
13273
  }
13266
13274
 
13275
+ function createVideoElement() {
13276
+ var video = document.createElement('video'); // Prepare video tag to auto play and add specific Safari tweaks #WCS-2425
13277
+
13278
+ video.muted = true;
13279
+
13280
+ if (util.Browser.isSafariWebRTC()) {
13281
+ video.setAttribute("playsinline", "");
13282
+ video.setAttribute("webkit-playsinline", "");
13283
+ }
13284
+
13285
+ return video;
13286
+ }
13287
+
13267
13288
  function removeVideoElement(video) {
13268
13289
  if (video.srcObject) {
13269
13290
  //pause