@flashphoner/websdk 2.0.230 → 2.0.231

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.
@@ -1,4 +1,4 @@
1
- Web SDK - 2.0.230
1
+ Web SDK - 2.0.231
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -206,28 +206,33 @@ function downScaleToFitSize(videoWidth, videoHeight, dstWidth, dstHeight) {
206
206
  function setWebkitFullscreenHandlers(video) {
207
207
  if (video) {
208
208
  let needRestart = false;
209
+ let wasFullscreen = false;
209
210
  // iOS hack when using standard controls to leave fullscreen mode
210
211
  video.addEventListener("pause", function () {
211
212
  if (needRestart) {
212
213
  console.log("Video paused after fullscreen, continue...");
214
+ wasFullscreen = true;
213
215
  video.play();
214
216
  needRestart = false;
215
217
  }
216
218
  });
217
219
  video.addEventListener("webkitendfullscreen", function () {
220
+ wasFullscreen = true;
218
221
  video.play();
219
222
  needRestart = true;
220
223
  });
221
224
  // Start playback in fullscreen if webkit-playsinline is set
222
225
  video.addEventListener("playing", function () {
223
- if (canWebkitFullScreen(video)) {
224
- // After pausing and resuming the video tag may be in invalid state
226
+ // Do not enter fullscreen again if we just left it #WCS-3860
227
+ if (canWebkitFullScreen(video) && !wasFullscreen) {
228
+ // We should catch if fullscreen mode is not available
225
229
  try {
226
230
  video.webkitEnterFullscreen();
227
231
  } catch (e) {
228
232
  console.log("Fullscreen is not allowed: " + e);
229
233
  }
230
234
  }
235
+ wasFullscreen = false;
231
236
  });
232
237
  } else {
233
238
  console.log("No video tag is passed, skip webkit fullscreen handlers setup");
@@ -237,7 +242,7 @@ function setWebkitFullscreenHandlers(video) {
237
242
  function canWebkitFullScreen(video) {
238
243
  let canFullscreen = false;
239
244
  if (video) {
240
- canFullscreen = video.webkitSupportsFullscreen && !video.webkitDisplayingFullscreen && !document.webkitFullscreenElement;
245
+ canFullscreen = video.webkitSupportsFullscreen && !video.webkitDisplayingFullscreen;
241
246
  }
242
247
  return canFullscreen;
243
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashphoner/websdk",
3
- "version": "2.0.230",
3
+ "version": "2.0.231",
4
4
  "description": "Official Flashphoner WebCallServer WebSDK package",
5
5
  "main": "./src/flashphoner-core.js",
6
6
  "types": "./src/flashphoner-core.d.ts",