@grfzhl/vue-hls-player 1.1.6 → 1.1.8

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.
@@ -213,21 +213,27 @@ async function startFullscreen() {
213
213
  screen.orientation.unlock();
214
214
  }
215
215
  await document.exitFullscreen();
216
+ if (/iPhone|iPad|AppleWebKit/i.test(navigator.userAgent)) {
217
+ vpVideoBlock = document.querySelector('video');
218
+ vpVideoBlock.addAttribute("playsinline");
219
+ vpVideoBlock.addAttribute("webkit-playsinline");
220
+ }
216
221
  isFullscreen.value = false;
217
222
  } else {
218
223
  isFullscreen.value = true;
219
224
  try {
220
225
  if (vpVideoBlock.requestFullscreen) {
221
226
  await vpVideoBlock.requestFullscreen();
222
- } else if (vpVideoBlock.webkitRequestFullscreen) {
227
+ } else if (/iPhone|iPad|AppleWebKit/i.test(navigator.userAgent)) {
223
228
  vpVideoBlock = document.querySelector('video');
224
- await vpVideoBlock.webkitRequestFullscreen(); // Safari
229
+ vpVideoBlock.removeAttribute("playsinline");
230
+ vpVideoBlock.removeAttribute("webkit-playsinline");
231
+ await vpVideoBlock.webkitRequestFullscreen(); // iOS snot
225
232
  } else if (vpVideoBlock.mozRequestFullScreen) {
226
233
  await vpVideoBlock.mozRequestFullScreen(); // Firefox
227
234
  } else if (vpVideoBlock.msRequestFullscreen) {
228
235
  await vpVideoBlock.msRequestFullscreen(); // IE/Edge
229
236
  }
230
-
231
237
  if (screen.orientation && screen.orientation.lock) {
232
238
  try {
233
239
  await screen.orientation.lock("landscape");
@@ -241,6 +247,7 @@ async function startFullscreen() {
241
247
  console.error("Fullscreen could not be activated", error);
242
248
  isFullscreen.value = false;
243
249
  }
250
+
244
251
  video.value.currentTime = currentTime;
245
252
  }
246
253
  }
@@ -251,7 +258,6 @@ function onSubtitleError(link) {
251
258
 
252
259
  function onFullscreenChange(e) {
253
260
  e.preventDefault();
254
-
255
261
  // hide intro title after x seconds
256
262
  if(isFullscreen.value === true) {
257
263
  setTimeout(() => {
@@ -278,7 +284,7 @@ function onOrientationChange(e) {
278
284
  let isPortrait = angle === 0 || angle === 180;
279
285
  let isLandscape = angle === 90 || angle === -90;
280
286
 
281
- if (isFullscreen.value && isPortrait) {
287
+ if (document.fullscreenElement && isPortrait) {
282
288
  setTimeout(async () => {
283
289
  if (!document.fullscreenElement) {
284
290
  startFullscreen();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grfzhl/vue-hls-player",
3
3
  "private": false,
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"