@flashphoner/websdk 2.0.229 → 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.229
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
  }
@@ -1,6 +1,6 @@
1
1
  var Browser = Flashphoner.Browser;
2
2
  var remoteVideo = null;
3
- var hlsPlayer = null
3
+ var hlsPlayer = null;
4
4
 
5
5
  function loadPlayerPage() {
6
6
  $("#playerPage").load("../hls-player/player-page.html", initPage );
@@ -9,7 +9,13 @@ function loadPlayerPage() {
9
9
  function initPage() {
10
10
  $("#header").text("HLS.JS Player Minimal");
11
11
  $("#urlServer").val(getHLSUrl());
12
- $("#applyBtn").prop('disabled', false).text("Play").off('click').click(playBtnClick);
12
+ $("#applyBtn").prop('disabled', true).text("Play").off('click').click(playBtnClick);
13
+ if (Hls.isSupported()) {
14
+ console.log("Using HLS.JS " + Hls.version);
15
+ $("#applyBtn").prop('disabled', false);
16
+ } else {
17
+ $("#notifyFlash").text("Your browser doesn't support MSE technology required to play video");
18
+ }
13
19
  remoteVideo = document.getElementById('remoteVideo');
14
20
  remoteVideo.style ="background-color: lightgrey;";
15
21
  $('#llHlsMode').show();
@@ -27,19 +33,13 @@ function playBtnClick() {
27
33
  if (key.length > 0 && token.length > 0) {
28
34
  videoSrc += "?" + key + "=" + token;
29
35
  }
30
- if (Hls.isSupported()) {
31
- console.log("Low Latency HLS: "+llHlsEnabled)
32
- hlsPlayer = new Hls(getHlsConfig(llHlsEnabled));
33
- hlsPlayer.on(Hls.Events.MANIFEST_PARSED, function() {
34
- console.log("Play with HLS.js");
35
- remoteVideo.play();
36
- });
37
- hlsPlayer.loadSource(videoSrc);
38
- hlsPlayer.attachMedia(remoteVideo);
39
- }
40
- else {
41
- $("#notifyFlash").text("Your browser doesn't support MSE technology required to play video");
42
- }
36
+ hlsPlayer = new Hls(getHlsConfig(llHlsEnabled));
37
+ hlsPlayer.on(Hls.Events.MANIFEST_PARSED, function() {
38
+ console.log("Play with HLS.js");
39
+ remoteVideo.play();
40
+ });
41
+ hlsPlayer.loadSource(videoSrc);
42
+ hlsPlayer.attachMedia(remoteVideo);
43
43
  onStarted();
44
44
  }
45
45
  }
@@ -52,6 +52,7 @@ function getHlsConfig(llHlsEnabled) {
52
52
  backBufferLength: 90,
53
53
  manifestLoadingTimeOut: 15000
54
54
  };
55
+ console.log("Low Latency HLS: "+llHlsEnabled)
55
56
  if(llHlsEnabled) {
56
57
  // Here we configure HLS.JS for lower latency
57
58
  config = {
@@ -126,6 +126,7 @@ function removeHighlight(input) {
126
126
 
127
127
  function initVideoJsPlayer(video) {
128
128
  var videoJsPlayer = videojs(video);
129
+ console.log("Using VideoJs " + videojs.VERSION);
129
130
  if (Browser.isSafariWebRTC() && Browser.isiOS()) {
130
131
  // iOS hack when using standard controls to leave fullscreen mode
131
132
  var videoTag = getActualVideoTag();