@grfzhl/vue-hls-player 1.1.7 → 1.1.9

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,15 +213,26 @@ 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
+ document.webkitExitFullscreen();
218
+ }
216
219
  isFullscreen.value = false;
217
220
  } else {
218
221
  isFullscreen.value = true;
219
222
  try {
220
223
  if (vpVideoBlock.requestFullscreen) {
221
224
  await vpVideoBlock.requestFullscreen();
222
- } else if (document.querySelector('video').webkitRequestFullscreen) {
223
- vpVideoBlock = document.querySelector('video');
224
- await vpVideoBlock.webkitRequestFullscreen(); // Safari
225
+ } else if (/iPhone|iPad|AppleWebKit/i.test(navigator.userAgent)) {
226
+ vpVideoBlock = document.querySelector('video.hls-player');
227
+ await vpVideoBlock.webkitEnterFullScreen(); // iOS snot
228
+ vpVideoBlock.addEventListener("webkitendfullscreen", () => {
229
+ setTimeout(() => {
230
+ vpVideoBlock.style.width = "100%";
231
+ vpVideoBlock.style.height = "auto";
232
+ }, 100);
233
+ isFullscreen.value = false;
234
+ vpVideoBlock.removeEventListener("webkitendfullscreen")
235
+ });
225
236
  } else if (vpVideoBlock.mozRequestFullScreen) {
226
237
  await vpVideoBlock.mozRequestFullScreen(); // Firefox
227
238
  } else if (vpVideoBlock.msRequestFullscreen) {
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.7",
4
+ "version": "1.1.9",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"