@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
@@ -40,12 +40,6 @@ function publishBtnClick() {
40
40
  $(this).prop('disabled', true);
41
41
  $('#url').prop('disabled', true);
42
42
  $("#downloadDiv").hide();
43
- if (Browser.isSafariWebRTC()) {
44
- Flashphoner.playFirstVideo(localVideo, true, PRELOADER_URL).then(function() {
45
- startRecording();
46
- });
47
- return;
48
- }
49
43
  startRecording();
50
44
  }
51
45
  }
@@ -40,14 +40,6 @@ function onStopped() {
40
40
 
41
41
  function publishBtnClick() {
42
42
  $(this).prop('disabled', true);
43
- if (Browser.isSafariWebRTC()) {
44
- Flashphoner.playFirstVideo(localVideo, true, PRELOADER_URL).then(function() {
45
- Flashphoner.playFirstVideo(remoteVideo, false, PRELOADER_URL).then(function() {
46
- start();
47
- });
48
- });
49
- return;
50
- }
51
43
  start();
52
44
  }
53
45
 
@@ -103,12 +103,6 @@ function publishBtnClick() {
103
103
  if (validateForm("streamerForm")) {
104
104
  $('#publishStream').prop('disabled', true);
105
105
  $(this).prop('disabled', true);
106
- if (Browser.isSafariWebRTC()) {
107
- Flashphoner.playFirstVideo(localVideo, true, PRELOADER_URL).then(function() {
108
- publishStream();
109
- });
110
- return;
111
- }
112
106
  publishStream();
113
107
  }
114
108
  }
@@ -145,11 +139,6 @@ function playBtnClick() {
145
139
  $(this).prop('disabled', true);
146
140
  if (Flashphoner.getMediaProviders()[0] === "WSPlayer") {
147
141
  Flashphoner.playFirstSound();
148
- } else if (Browser.isSafariWebRTC() || Flashphoner.getMediaProviders()[0] === "MSE") {
149
- Flashphoner.playFirstVideo(remoteVideo, false, PRELOADER_URL).then(function () {
150
- playStream();
151
- });
152
- return;
153
142
  }
154
143
  playStream();
155
144
  }
@@ -43,12 +43,6 @@ function onStopped() {
43
43
  function publishBtnClick() {
44
44
  if (validateForm()) {
45
45
  $(this).prop('disabled', true);
46
- if (Browser.isSafariWebRTC()) {
47
- Flashphoner.playFirstVideo(localVideo, true, PRELOADER_URL).then(function() {
48
- start();
49
- });
50
- return;
51
- }
52
46
  start();
53
47
  }
54
48
  }
@@ -10149,7 +10149,7 @@ var createSession = function createSession(options) {
10149
10149
  mediaProviders: Object.keys(MediaProvider),
10150
10150
  keepAlive: keepAlive,
10151
10151
  authToken: authToken,
10152
- clientVersion: "2.0.209",
10152
+ clientVersion: "2.0.210",
10153
10153
  clientOSVersion: window.navigator.appVersion,
10154
10154
  clientBrowserVersion: window.navigator.userAgent,
10155
10155
  msePacketizationVersion: 2,
@@ -11293,7 +11293,7 @@ var createSession = function createSession(options) {
11293
11293
  * @param {HTMLElement} options.display Div element stream should be displayed in
11294
11294
  * @param {Object=} options.custom User provided custom object that will be available in REST App code
11295
11295
  * @param {Integer} [options.flashBufferTime=0] Specifies how long to buffer messages before starting to display the stream (Flash-only)
11296
- * @param {String=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
11296
+ * @param {string=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
11297
11297
  * @param {string=} options.rtmpUrl Rtmp url stream should be forwarded to
11298
11298
  * @param {Object=} options.mediaConnectionConstraints Stream specific constraints for underlying RTCPeerConnection
11299
11299
  * @param {Boolean=} options.flashShowFullScreenButton Show full screen button in flash
@@ -11302,6 +11302,7 @@ var createSession = function createSession(options) {
11302
11302
  * @param {Integer=} options.playoutDelay Time delay between network reception of media and playout
11303
11303
  * @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
11304
11304
  * @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
11305
+ * @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
11305
11306
  * @param {sdpHook} sdpHook The callback that handles sdp from the server
11306
11307
  * @returns {Stream} Stream
11307
11308
  * @throws {TypeError} Error if no options provided
@@ -11413,6 +11414,7 @@ var createSession = function createSession(options) {
11413
11414
  var playoutDelay = options.playoutDelay;
11414
11415
  var useCanvasMediaStream = options.useCanvasMediaStream;
11415
11416
  var videoContentHint = options.videoContentHint;
11417
+ var unmutePlayOnStart = options.unmutePlayOnStart;
11416
11418
  var audioState_;
11417
11419
  var videoState_;
11418
11420
  var connectionQuality;
@@ -11589,7 +11591,8 @@ var createSession = function createSession(options) {
11589
11591
  connectionConstraints: mediaConnectionConstraints,
11590
11592
  audioOutputId: audioOutputId,
11591
11593
  remoteVideo: remoteVideo,
11592
- playoutDelay: playoutDelay
11594
+ playoutDelay: playoutDelay,
11595
+ unmutePlayOnStart: unmutePlayOnStart
11593
11596
  }, streamRefreshHandlers[id_]).then(function (newConnection) {
11594
11597
  mediaConnection = newConnection;
11595
11598
 
@@ -13117,7 +13120,9 @@ var createConnection = function createConnection(options) {
13117
13120
  var screenShare = false;
13118
13121
  var playoutDelay = options.playoutDelay; // Set video track contentHint to `detail` by default to workaround Chromium 91 bug #WCS-3257
13119
13122
 
13120
- var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail';
13123
+ var videoContentHint = options.videoContentHint ? options.videoContentHint : 'detail'; // Pass the option to unmute automatically (true by default) #WCS-2425
13124
+
13125
+ var unmutePlayOnStart = options.unmutePlayOnStart !== undefined ? options.unmutePlayOnStart : true;
13121
13126
 
13122
13127
  if (bidirectional) {
13123
13128
  localVideo = getCacheInstance(localDisplay);
@@ -13136,7 +13141,7 @@ var createConnection = function createConnection(options) {
13136
13141
  remoteVideo = getCacheInstance(remoteDisplay);
13137
13142
 
13138
13143
  if (!remoteVideo) {
13139
- remoteVideo = document.createElement('video');
13144
+ remoteVideo = createVideoElement();
13140
13145
  remoteDisplay.appendChild(remoteVideo);
13141
13146
  }
13142
13147
 
@@ -13161,7 +13166,7 @@ var createConnection = function createConnection(options) {
13161
13166
  if (cachedVideo) {
13162
13167
  remoteVideo = cachedVideo;
13163
13168
  } else {
13164
- remoteVideo = document.createElement('video');
13169
+ remoteVideo = createVideoElement();
13165
13170
  display.appendChild(remoteVideo);
13166
13171
  }
13167
13172
 
@@ -13225,7 +13230,12 @@ var createConnection = function createConnection(options) {
13225
13230
 
13226
13231
  remoteVideo.onloadedmetadata = function (e) {
13227
13232
  if (remoteVideo) {
13228
- remoteVideo.play()["catch"](function (e) {
13233
+ remoteVideo.play().then(function () {
13234
+ // Automatically unmute video if needed #WCS-2425
13235
+ if (unmutePlayOnStart) {
13236
+ remoteVideo.muted = false;
13237
+ }
13238
+ })["catch"](function (e) {
13229
13239
  if (validBrowsers.includes(browserDetails.browser)) {
13230
13240
  //WCS-1698. fixed autoplay in chromium based browsers
13231
13241
  //WCS-2375. fixed autoplay in ios safari
@@ -13994,14 +14004,12 @@ var loadOrdinaryVideo = function loadOrdinaryVideo(display, stream, screenShare,
13994
14004
  var vEl = video;
13995
14005
 
13996
14006
  if (!vEl) {
13997
- vEl = document.createElement('video');
14007
+ vEl = createVideoElement();
13998
14008
  display.appendChild(vEl);
13999
14009
  }
14000
14010
 
14001
14011
  vEl.id = uuid_v1() + LOCAL_CACHED_VIDEO;
14002
- vEl.srcObject = stream; //mute audio
14003
-
14004
- vEl.muted = true;
14012
+ vEl.srcObject = stream;
14005
14013
 
14006
14014
  vEl.onloadedmetadata = function (e) {
14007
14015
  //WCS-2751 Add screen capture using getDisplayMedia in Safari
@@ -14377,6 +14385,19 @@ function getCacheInstance(display) {
14377
14385
  }
14378
14386
  }
14379
14387
 
14388
+ function createVideoElement() {
14389
+ var video = document.createElement('video'); // Prepare video tag to auto play and add specific Safari tweaks #WCS-2425
14390
+
14391
+ video.muted = true;
14392
+
14393
+ if (util.Browser.isSafariWebRTC()) {
14394
+ video.setAttribute("playsinline", "");
14395
+ video.setAttribute("webkit-playsinline", "");
14396
+ }
14397
+
14398
+ return video;
14399
+ }
14400
+
14380
14401
  function removeVideoElement(video) {
14381
14402
  if (video.srcObject) {
14382
14403
  //pause