@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.
- package/docTemplate/README.md +1 -1
- package/examples/demo/dependencies/js/utils.js +39 -0
- package/examples/demo/streaming/hls-js-player/hls-js-player.html +1 -0
- package/examples/demo/streaming/hls-js-player/hls-js-player.js +7 -4
- package/examples/demo/streaming/hls-js-player/hls.js +25012 -25818
- package/examples/demo/streaming/hls-js-player/hls.min.js +2 -2
- package/examples/demo/streaming/hls-native/hls-native.html +1 -0
- package/examples/demo/streaming/hls-native/hls-native.js +5 -1
- package/examples/demo/streaming/hls-player/hls-player.html +1 -0
- package/examples/demo/streaming/hls-player/hls-player.js +38 -4
- package/examples/demo/streaming/hls-player/player-page.html +2 -0
- package/examples/demo/streaming/hls-player/video-js.css +320 -243
- package/examples/demo/streaming/hls-player/video.js +18841 -23735
- package/examples/demo/streaming/hls-player/video.min.js +30 -17
- package/flashphoner-no-flash.js +2 -2
- package/flashphoner-no-flash.min.js +2 -2
- package/flashphoner-no-webrtc.js +2 -2
- package/flashphoner-no-webrtc.min.js +2 -2
- package/flashphoner-no-wsplayer.js +2 -2
- package/flashphoner-no-wsplayer.min.js +2 -2
- package/flashphoner-room-api.js +3 -3
- package/flashphoner-room-api.min.js +3 -3
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +2 -2
- package/flashphoner-temasys-flash-websocket.js +2 -2
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner.js +2 -2
- package/flashphoner.min.js +2 -2
- package/package.json +1 -1
- package/src/media-source-media-provider.js +3 -3
package/docTemplate/README.md
CHANGED
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
var Browser = Flashphoner.Browser;
|
|
1
2
|
var remoteVideo = null;
|
|
2
3
|
var hlsPlayer = null
|
|
3
4
|
|
|
@@ -29,17 +30,17 @@ function playBtnClick() {
|
|
|
29
30
|
if (Hls.isSupported()) {
|
|
30
31
|
console.log("Low Latency HLS: "+llHlsEnabled)
|
|
31
32
|
hlsPlayer = new Hls(getHlsConfig(llHlsEnabled));
|
|
32
|
-
hlsPlayer.loadSource(videoSrc);
|
|
33
|
-
hlsPlayer.attachMedia(remoteVideo);
|
|
34
33
|
hlsPlayer.on(Hls.Events.MANIFEST_PARSED, function() {
|
|
35
34
|
console.log("Play with HLS.js");
|
|
36
35
|
remoteVideo.play();
|
|
37
|
-
onStarted();
|
|
38
36
|
});
|
|
37
|
+
hlsPlayer.loadSource(videoSrc);
|
|
38
|
+
hlsPlayer.attachMedia(remoteVideo);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
41
|
$("#notifyFlash").text("Your browser doesn't support MSE technology required to play video");
|
|
42
42
|
}
|
|
43
|
+
onStarted();
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -48,7 +49,8 @@ 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
|
};
|
|
53
55
|
if(llHlsEnabled) {
|
|
54
56
|
// Here we configure HLS.JS for lower latency
|
|
@@ -61,6 +63,7 @@ function getHlsConfig(llHlsEnabled) {
|
|
|
61
63
|
liveMaxLatencyDuration: 5,
|
|
62
64
|
liveDurationInfinity: true,
|
|
63
65
|
highBufferWatchdogPeriod: 1,
|
|
66
|
+
manifestLoadingTimeOut: 15000
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
69
|
return config;
|