@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
package/flashphoner.js CHANGED
@@ -11635,7 +11635,7 @@ var createSession = function createSession(options) {
11635
11635
  mediaProviders: Object.keys(MediaProvider),
11636
11636
  keepAlive: keepAlive,
11637
11637
  authToken: authToken,
11638
- clientVersion: "2.0.209",
11638
+ clientVersion: "2.0.210",
11639
11639
  clientOSVersion: window.navigator.appVersion,
11640
11640
  clientBrowserVersion: window.navigator.userAgent,
11641
11641
  msePacketizationVersion: 2,
@@ -12779,7 +12779,7 @@ var createSession = function createSession(options) {
12779
12779
  * @param {HTMLElement} options.display Div element stream should be displayed in
12780
12780
  * @param {Object=} options.custom User provided custom object that will be available in REST App code
12781
12781
  * @param {Integer} [options.flashBufferTime=0] Specifies how long to buffer messages before starting to display the stream (Flash-only)
12782
- * @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")
12783
12783
  * @param {string=} options.rtmpUrl Rtmp url stream should be forwarded to
12784
12784
  * @param {Object=} options.mediaConnectionConstraints Stream specific constraints for underlying RTCPeerConnection
12785
12785
  * @param {Boolean=} options.flashShowFullScreenButton Show full screen button in flash
@@ -12788,6 +12788,7 @@ var createSession = function createSession(options) {
12788
12788
  * @param {Integer=} options.playoutDelay Time delay between network reception of media and playout
12789
12789
  * @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
12790
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
12791
12792
  * @param {sdpHook} sdpHook The callback that handles sdp from the server
12792
12793
  * @returns {Stream} Stream
12793
12794
  * @throws {TypeError} Error if no options provided
@@ -12899,6 +12900,7 @@ var createSession = function createSession(options) {
12899
12900
  var playoutDelay = options.playoutDelay;
12900
12901
  var useCanvasMediaStream = options.useCanvasMediaStream;
12901
12902
  var videoContentHint = options.videoContentHint;
12903
+ var unmutePlayOnStart = options.unmutePlayOnStart;
12902
12904
  var audioState_;
12903
12905
  var videoState_;
12904
12906
  var connectionQuality;
@@ -13075,7 +13077,8 @@ var createSession = function createSession(options) {
13075
13077
  connectionConstraints: mediaConnectionConstraints,
13076
13078
  audioOutputId: audioOutputId,
13077
13079
  remoteVideo: remoteVideo,
13078
- playoutDelay: playoutDelay
13080
+ playoutDelay: playoutDelay,
13081
+ unmutePlayOnStart: unmutePlayOnStart
13079
13082
  }, streamRefreshHandlers[id_]).then(function (newConnection) {
13080
13083
  mediaConnection = newConnection;
13081
13084
 
@@ -14603,7 +14606,9 @@ var createConnection = function createConnection(options) {
14603
14606
  var screenShare = false;
14604
14607
  var playoutDelay = options.playoutDelay; // Set video track contentHint to `detail` by default to workaround Chromium 91 bug #WCS-3257
14605
14608
 
14606
- 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;
14607
14612
 
14608
14613
  if (bidirectional) {
14609
14614
  localVideo = getCacheInstance(localDisplay);
@@ -14622,7 +14627,7 @@ var createConnection = function createConnection(options) {
14622
14627
  remoteVideo = getCacheInstance(remoteDisplay);
14623
14628
 
14624
14629
  if (!remoteVideo) {
14625
- remoteVideo = document.createElement('video');
14630
+ remoteVideo = createVideoElement();
14626
14631
  remoteDisplay.appendChild(remoteVideo);
14627
14632
  }
14628
14633
 
@@ -14647,7 +14652,7 @@ var createConnection = function createConnection(options) {
14647
14652
  if (cachedVideo) {
14648
14653
  remoteVideo = cachedVideo;
14649
14654
  } else {
14650
- remoteVideo = document.createElement('video');
14655
+ remoteVideo = createVideoElement();
14651
14656
  display.appendChild(remoteVideo);
14652
14657
  }
14653
14658
 
@@ -14711,7 +14716,12 @@ var createConnection = function createConnection(options) {
14711
14716
 
14712
14717
  remoteVideo.onloadedmetadata = function (e) {
14713
14718
  if (remoteVideo) {
14714
- 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) {
14715
14725
  if (validBrowsers.includes(browserDetails.browser)) {
14716
14726
  //WCS-1698. fixed autoplay in chromium based browsers
14717
14727
  //WCS-2375. fixed autoplay in ios safari
@@ -15480,14 +15490,12 @@ var loadOrdinaryVideo = function loadOrdinaryVideo(display, stream, screenShare,
15480
15490
  var vEl = video;
15481
15491
 
15482
15492
  if (!vEl) {
15483
- vEl = document.createElement('video');
15493
+ vEl = createVideoElement();
15484
15494
  display.appendChild(vEl);
15485
15495
  }
15486
15496
 
15487
15497
  vEl.id = uuid_v1() + LOCAL_CACHED_VIDEO;
15488
- vEl.srcObject = stream; //mute audio
15489
-
15490
- vEl.muted = true;
15498
+ vEl.srcObject = stream;
15491
15499
 
15492
15500
  vEl.onloadedmetadata = function (e) {
15493
15501
  //WCS-2751 Add screen capture using getDisplayMedia in Safari
@@ -15863,6 +15871,19 @@ function getCacheInstance(display) {
15863
15871
  }
15864
15872
  }
15865
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
+
15866
15887
  function removeVideoElement(video) {
15867
15888
  if (video.srcObject) {
15868
15889
  //pause