@flashphoner/websdk 2.0.228 → 2.0.229

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 +7 -4
  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 +38 -4
  11. package/examples/demo/streaming/hls-player/player-page.html +2 -0
  12. package/examples/demo/streaming/hls-player/video-js.css +320 -243
  13. package/examples/demo/streaming/hls-player/video.js +18841 -23735
  14. package/examples/demo/streaming/hls-player/video.min.js +30 -17
  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
@@ -6,6 +6,7 @@
6
6
  <link rel="stylesheet" href="../../dependencies/bootstrap/css/bootstrap.css">
7
7
  <link rel="stylesheet" href="hls-native.css">
8
8
  <title>HLS Native Player Minimal</title>
9
+ <script type="text/javascript" src="../../../../flashphoner.js"></script>
9
10
  <script type="text/javascript" src="../../dependencies/jquery/jquery-1.12.0.js"></script>
10
11
  <script type="text/javascript" src="../../dependencies/jquery/jquery-ui.js"></script>
11
12
  <script type="text/javascript" src="../../dependencies/js/utils.js"></script>
@@ -1,3 +1,4 @@
1
+ var Browser = Flashphoner.Browser;
1
2
  var remoteVideo = null;
2
3
 
3
4
  function loadPlayerPage() {
@@ -10,6 +11,10 @@ function initPage() {
10
11
  $("#applyBtn").prop('disabled', false).text("Play").off('click').click(playBtnClick);
11
12
  remoteVideo = document.getElementById('remoteVideo');
12
13
  remoteVideo.style ="background-color: lightgrey;";
14
+ if (Browser.isSafariWebRTC() && Browser.isiOS()) {
15
+ // iOS hack when using standard controls to leave fullscreen mode
16
+ setWebkitFullscreenHandlers(remoteVideo);
17
+ }
13
18
  }
14
19
 
15
20
  function playBtnClick() {
@@ -32,7 +37,6 @@ function playBtnClick() {
32
37
  }
33
38
  else {
34
39
  $("#notifyFlash").text("Your browser doesn't support native HLS playback");
35
- cleanRemoteVideo();
36
40
  }
37
41
  }
38
42
  }
@@ -7,6 +7,7 @@
7
7
  <link rel="stylesheet" href="hls-player.css">
8
8
  <link rel="stylesheet" href="video-js.css">
9
9
  <title>HLS VideoJS Player Minimal</title>
10
+ <script type="text/javascript" src="../../../../flashphoner.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>
12
13
  <script type="text/javascript" src="../../dependencies/js/utils.js"></script>
@@ -1,3 +1,4 @@
1
+ var Browser = Flashphoner.Browser;
1
2
  var player = null;
2
3
 
3
4
  function loadPlayerPage() {
@@ -10,7 +11,7 @@ function initPage() {
10
11
  $("#applyBtn").prop('disabled', false).text("Play").off('click').click(playBtnClick);
11
12
  var remoteVideo = document.getElementById('remoteVideo');
12
13
  remoteVideo.className = "video-js vjs-default-skin";
13
- player = videojs(remoteVideo);
14
+ player = initVideoJsPlayer(remoteVideo);
14
15
  }
15
16
 
16
17
  function playBtnClick() {
@@ -23,12 +24,23 @@ function playBtnClick() {
23
24
  if (key.length > 0 && token.length > 0) {
24
25
  videoSrc += "?" + key + "=" + token;
25
26
  }
27
+ player.on('loadedmetadata', function() {
28
+ console.log("Play with VideoJs");
29
+ player.play();
30
+ });
31
+ player.on('error', function() {
32
+ var error = player.error();
33
+ // Stop on error
34
+ stopBtnClick();
35
+ if (error && error.code == error.MEDIA_ERR_DECODE) {
36
+ // Restart playback in case of decode error
37
+ playBtnClick();
38
+ }
39
+ });
26
40
  player.src({
27
41
  src: videoSrc,
28
42
  type: "application/vnd.apple.mpegurl"
29
43
  });
30
- console.log("Play with VideoJs");
31
- player.play();
32
44
  onStarted();
33
45
  }
34
46
  }
@@ -76,8 +88,10 @@ function createRemoteVideo(parent) {
76
88
  remoteVideo.autoplay="autoplay";
77
89
  remoteVideo.type="application/vnd.apple.mpegurl";
78
90
  remoteVideo.className = "video-js vjs-default-skin";
91
+ remoteVideo.setAttribute("playsinline","");
92
+ remoteVideo.setAttribute("webkit-playsinline","");
79
93
  parent.appendChild(remoteVideo);
80
- player = videojs(remoteVideo);
94
+ player = initVideoJsPlayer(remoteVideo);
81
95
  }
82
96
 
83
97
 
@@ -109,3 +123,23 @@ function highlightInput(input) {
109
123
  function removeHighlight(input) {
110
124
  input.closest('.form-group').removeClass("has-error");
111
125
  }
126
+
127
+ function initVideoJsPlayer(video) {
128
+ var videoJsPlayer = videojs(video);
129
+ if (Browser.isSafariWebRTC() && Browser.isiOS()) {
130
+ // iOS hack when using standard controls to leave fullscreen mode
131
+ var videoTag = getActualVideoTag();
132
+ if(videoTag) {
133
+ setWebkitFullscreenHandlers(videoTag);
134
+ }
135
+ }
136
+ return videoJsPlayer;
137
+ }
138
+
139
+ function getActualVideoTag() {
140
+ var videos = document.querySelectorAll("video");
141
+ if (videos && videos.length > 0) {
142
+ return videos[0];
143
+ }
144
+ return null;
145
+ }
@@ -60,6 +60,8 @@
60
60
  <video id="remoteVideo" width="852" height="480"
61
61
  controls="controls"
62
62
  autoplay="autoplay"
63
+ playsinline="playsinline"
64
+ webkit-playsinline="webkit-playsinline"
63
65
  type="application/vnd.apple.mpegurl"></video>
64
66
  </div>
65
67
  </div>