@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.
package/docTemplate/README.md
CHANGED
|
@@ -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
|
|
224
|
-
|
|
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
|
|
245
|
+
canFullscreen = video.webkitSupportsFullscreen && !video.webkitDisplayingFullscreen;
|
|
241
246
|
}
|
|
242
247
|
return canFullscreen;
|
|
243
248
|
}
|