@flashphoner/websdk 2.0.228 → 2.0.230

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 (29) hide show
  1. package/docTemplate/README.md +1 -1
  2. package/examples/demo/dependencies/js/utils.js +39 -0
  3. package/examples/demo/streaming/hls-js-player/hls-js-player.html +1 -0
  4. package/examples/demo/streaming/hls-js-player/hls-js-player.js +21 -17
  5. package/examples/demo/streaming/hls-js-player/hls.js +25012 -25818
  6. package/examples/demo/streaming/hls-js-player/hls.min.js +2 -2
  7. package/examples/demo/streaming/hls-native/hls-native.html +1 -0
  8. package/examples/demo/streaming/hls-native/hls-native.js +5 -1
  9. package/examples/demo/streaming/hls-player/hls-player.html +1 -0
  10. package/examples/demo/streaming/hls-player/hls-player.js +39 -4
  11. package/examples/demo/streaming/hls-player/player-page.html +2 -0
  12. package/examples/demo/streaming/hls-player/video-js.css +59 -43
  13. package/examples/demo/streaming/hls-player/video.js +6028 -3743
  14. package/examples/demo/streaming/hls-player/video.min.js +8 -9
  15. package/flashphoner-no-flash.js +2 -2
  16. package/flashphoner-no-flash.min.js +2 -2
  17. package/flashphoner-no-webrtc.js +2 -2
  18. package/flashphoner-no-webrtc.min.js +2 -2
  19. package/flashphoner-no-wsplayer.js +2 -2
  20. package/flashphoner-no-wsplayer.min.js +2 -2
  21. package/flashphoner-room-api.js +3 -3
  22. package/flashphoner-room-api.min.js +3 -3
  23. package/flashphoner-temasys-flash-websocket-without-adapterjs.js +2 -2
  24. package/flashphoner-temasys-flash-websocket.js +2 -2
  25. package/flashphoner-temasys-flash-websocket.min.js +1 -1
  26. package/flashphoner.js +2 -2
  27. package/flashphoner.min.js +2 -2
  28. package/package.json +1 -1
  29. package/src/media-source-media-provider.js +3 -3
@@ -1,4 +1,4 @@
1
- Web SDK - 2.0.228
1
+ Web SDK - 2.0.230
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -202,3 +202,42 @@ function downScaleToFitSize(videoWidth, videoHeight, dstWidth, dstHeight) {
202
202
  h: newHeight
203
203
  };
204
204
  }
205
+
206
+ function setWebkitFullscreenHandlers(video) {
207
+ if (video) {
208
+ let needRestart = false;
209
+ // iOS hack when using standard controls to leave fullscreen mode
210
+ video.addEventListener("pause", function () {
211
+ if (needRestart) {
212
+ console.log("Video paused after fullscreen, continue...");
213
+ video.play();
214
+ needRestart = false;
215
+ }
216
+ });
217
+ video.addEventListener("webkitendfullscreen", function () {
218
+ video.play();
219
+ needRestart = true;
220
+ });
221
+ // Start playback in fullscreen if webkit-playsinline is set
222
+ video.addEventListener("playing", function () {
223
+ if (canWebkitFullScreen(video)) {
224
+ // After pausing and resuming the video tag may be in invalid state
225
+ try {
226
+ video.webkitEnterFullscreen();
227
+ } catch (e) {
228
+ console.log("Fullscreen is not allowed: " + e);
229
+ }
230
+ }
231
+ });
232
+ } else {
233
+ console.log("No video tag is passed, skip webkit fullscreen handlers setup");
234
+ }
235
+ }
236
+
237
+ function canWebkitFullScreen(video) {
238
+ let canFullscreen = false;
239
+ if (video) {
240
+ canFullscreen = video.webkitSupportsFullscreen && !video.webkitDisplayingFullscreen && !document.webkitFullscreenElement;
241
+ }
242
+ return canFullscreen;
243
+ }
@@ -6,6 +6,7 @@
6
6
  <link rel="stylesheet" href="../../dependencies/bootstrap/css/bootstrap.css">
7
7
  <link rel="stylesheet" href="hls-js-player.css">
8
8
  <title>HLS.JS Player Minimal</title>
9
+ <script type="text/javascript" src="../../../../flashphoner.js"></script>
9
10
  <script type="text/javascript" src="hls.min.js"></script>
10
11
  <script type="text/javascript" src="../../dependencies/jquery/jquery-1.12.0.js"></script>
11
12
  <script type="text/javascript" src="../../dependencies/jquery/jquery-ui.js"></script>
@@ -1,5 +1,6 @@
1
+ var Browser = Flashphoner.Browser;
1
2
  var remoteVideo = null;
2
- var hlsPlayer = null
3
+ var hlsPlayer = null;
3
4
 
4
5
  function loadPlayerPage() {
5
6
  $("#playerPage").load("../hls-player/player-page.html", initPage );
@@ -8,7 +9,13 @@ function loadPlayerPage() {
8
9
  function initPage() {
9
10
  $("#header").text("HLS.JS Player Minimal");
10
11
  $("#urlServer").val(getHLSUrl());
11
- $("#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
+ }
12
19
  remoteVideo = document.getElementById('remoteVideo');
13
20
  remoteVideo.style ="background-color: lightgrey;";
14
21
  $('#llHlsMode').show();
@@ -26,20 +33,14 @@ function playBtnClick() {
26
33
  if (key.length > 0 && token.length > 0) {
27
34
  videoSrc += "?" + key + "=" + token;
28
35
  }
29
- if (Hls.isSupported()) {
30
- console.log("Low Latency HLS: "+llHlsEnabled)
31
- hlsPlayer = new Hls(getHlsConfig(llHlsEnabled));
32
- hlsPlayer.loadSource(videoSrc);
33
- hlsPlayer.attachMedia(remoteVideo);
34
- hlsPlayer.on(Hls.Events.MANIFEST_PARSED, function() {
35
- console.log("Play with HLS.js");
36
- remoteVideo.play();
37
- onStarted();
38
- });
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
+ onStarted();
43
44
  }
44
45
  }
45
46
 
@@ -48,8 +49,10 @@ function getHlsConfig(llHlsEnabled) {
48
49
  var config = {
49
50
  lowLatencyMode: false,
50
51
  enableWorker: true,
51
- backBufferLength: 90
52
+ backBufferLength: 90,
53
+ manifestLoadingTimeOut: 15000
52
54
  };
55
+ console.log("Low Latency HLS: "+llHlsEnabled)
53
56
  if(llHlsEnabled) {
54
57
  // Here we configure HLS.JS for lower latency
55
58
  config = {
@@ -61,6 +64,7 @@ function getHlsConfig(llHlsEnabled) {
61
64
  liveMaxLatencyDuration: 5,
62
65
  liveDurationInfinity: true,
63
66
  highBufferWatchdogPeriod: 1,
67
+ manifestLoadingTimeOut: 15000
64
68
  };
65
69
  }
66
70
  return config;