itube-modern-player 0.8.2 → 0.8.3

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.
@@ -1,2 +1,2 @@
1
- "use strict";function c(){const e=document.createElement("video");e.setAttribute("playsinline","");const t=e.play();return t&&t.catch(()=>{}),e}exports.createGestureVideo=c;
2
- //# sourceMappingURL=gesture-BLWiPHlW.cjs.map
1
+ "use strict";function c(){const e=document.createElement("video");e.setAttribute("playsinline","");const t=e.play();return t&&t.catch(()=>{}),e.pause(),e}exports.createGestureVideo=c;
2
+ //# sourceMappingURL=gesture-Dc6eb_46.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"gesture-BLWiPHlW.cjs","sources":["../src/gesture.ts"],"sourcesContent":["/**\n * User-gesture media unlock, shared by the lazy entries (`createLazyPlayer`\n * and the Vue wrapper's `lazy` mode).\n *\n * Mobile browsers (iOS Safari first of all) allow `play()` with sound only\n * synchronously inside a user gesture — and the permission is granted PER\n * ELEMENT. The lazy flow crosses two async boundaries between the tap and the\n * autostart (the `import()` of the player chunk + the HLS attach), so a video\n * element created after them has no gesture attached: the first tap only\n * loaded the player and playback started on the second tap.\n *\n * The fix: create the `<video>` synchronously in the click handler and call\n * `play()` on it right there. Without a src it rejects immediately (that's\n * fine and expected), but the element keeps its user-activation flag — when\n * the player later attaches the real source to THIS element, `play()` with\n * sound goes through.\n */\nexport function createGestureVideo(): HTMLVideoElement {\n const video = document.createElement('video')\n video.setAttribute('playsinline', '')\n const attempt = video.play()\n // No source yet → the promise usually rejects (NotSupportedError); the\n // play() CALL inside the gesture is what unlocks the element, not its\n // success. NB: in some engines this promise stays PENDING until a source\n // arrives and only resolves once REAL playback starts so the success\n // branch must be a no-op. (A `video.pause()` here paused the just-started\n // video, killing the very autostart this helper exists for.)\n if (attempt) attempt.catch(() => {})\n return video\n}\n"],"names":["createGestureVideo","video","attempt"],"mappings":"aAiBO,SAASA,GAAuC,CACrD,MAAMC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,aAAa,cAAe,EAAE,EACpC,MAAMC,EAAUD,EAAM,KAAA,EAOtB,OAAIC,GAASA,EAAQ,MAAM,IAAM,CAAC,CAAC,EAC5BD,CACT"}
1
+ {"version":3,"file":"gesture-Dc6eb_46.cjs","sources":["../src/gesture.ts"],"sourcesContent":["/**\n * User-gesture media unlock, shared by the lazy entries (`createLazyPlayer`\n * and the Vue wrapper's `lazy` mode).\n *\n * Mobile browsers (iOS Safari first of all) allow `play()` with sound only\n * synchronously inside a user gesture — and the permission is granted PER\n * ELEMENT. The lazy flow crosses two async boundaries between the tap and the\n * autostart (the `import()` of the player chunk + the HLS attach), so a video\n * element created after them has no gesture attached: the first tap only\n * loaded the player and playback started on the second tap.\n *\n * The fix: create the `<video>` synchronously in the click handler and call\n * `play()` on it right there. Without a src it rejects immediately (that's\n * fine and expected), but the element keeps its user-activation flag — when\n * the player later attaches the real source to THIS element, `play()` with\n * sound goes through.\n */\nexport function createGestureVideo(): HTMLVideoElement {\n const video = document.createElement('video')\n video.setAttribute('playsinline', '')\n const attempt = video.play()\n // The play() CALL inside the gesture is what unlocks the element, not its\n // success the promise rejects (no source) or hangs; either way ignore it.\n if (attempt) attempt.catch(() => {})\n // Pause SYNCHRONOUSLY (the canonical play()+pause() unlock activation\n // sticks to the element). Without this the element leaves the gesture with\n // `paused === false` while having no source: the player's later play() sees\n // no paused→playing transition, the `play` event never fires, and the whole\n // start chain breaks (poster stays up, frames may not render while audio\n // plays, playedOnce/UI state stay stale).\n video.pause()\n return video\n}\n"],"names":["createGestureVideo","video","attempt"],"mappings":"aAiBO,SAASA,GAAuC,CACrD,MAAMC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,aAAa,cAAe,EAAE,EACpC,MAAMC,EAAUD,EAAM,KAAA,EAGtB,OAAIC,GAASA,EAAQ,MAAM,IAAM,CAAC,CAAC,EAOnCD,EAAM,MAAA,EACCA,CACT"}
@@ -3,9 +3,9 @@ function c() {
3
3
  e.setAttribute("playsinline", "");
4
4
  const t = e.play();
5
5
  return t && t.catch(() => {
6
- }), e;
6
+ }), e.pause(), e;
7
7
  }
8
8
  export {
9
9
  c
10
10
  };
11
- //# sourceMappingURL=gesture-BYJrYanO.js.map
11
+ //# sourceMappingURL=gesture-hoL6gIex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gesture-BYJrYanO.js","sources":["../src/gesture.ts"],"sourcesContent":["/**\n * User-gesture media unlock, shared by the lazy entries (`createLazyPlayer`\n * and the Vue wrapper's `lazy` mode).\n *\n * Mobile browsers (iOS Safari first of all) allow `play()` with sound only\n * synchronously inside a user gesture — and the permission is granted PER\n * ELEMENT. The lazy flow crosses two async boundaries between the tap and the\n * autostart (the `import()` of the player chunk + the HLS attach), so a video\n * element created after them has no gesture attached: the first tap only\n * loaded the player and playback started on the second tap.\n *\n * The fix: create the `<video>` synchronously in the click handler and call\n * `play()` on it right there. Without a src it rejects immediately (that's\n * fine and expected), but the element keeps its user-activation flag — when\n * the player later attaches the real source to THIS element, `play()` with\n * sound goes through.\n */\nexport function createGestureVideo(): HTMLVideoElement {\n const video = document.createElement('video')\n video.setAttribute('playsinline', '')\n const attempt = video.play()\n // No source yet → the promise usually rejects (NotSupportedError); the\n // play() CALL inside the gesture is what unlocks the element, not its\n // success. NB: in some engines this promise stays PENDING until a source\n // arrives and only resolves once REAL playback starts so the success\n // branch must be a no-op. (A `video.pause()` here paused the just-started\n // video, killing the very autostart this helper exists for.)\n if (attempt) attempt.catch(() => {})\n return video\n}\n"],"names":["createGestureVideo","video","attempt"],"mappings":"AAiBO,SAASA,IAAuC;AACrD,QAAMC,IAAQ,SAAS,cAAc,OAAO;AAC5C,EAAAA,EAAM,aAAa,eAAe,EAAE;AACpC,QAAMC,IAAUD,EAAM,KAAA;AAOtB,SAAIC,KAASA,EAAQ,MAAM,MAAM;AAAA,EAAC,CAAC,GAC5BD;AACT;"}
1
+ {"version":3,"file":"gesture-hoL6gIex.js","sources":["../src/gesture.ts"],"sourcesContent":["/**\n * User-gesture media unlock, shared by the lazy entries (`createLazyPlayer`\n * and the Vue wrapper's `lazy` mode).\n *\n * Mobile browsers (iOS Safari first of all) allow `play()` with sound only\n * synchronously inside a user gesture — and the permission is granted PER\n * ELEMENT. The lazy flow crosses two async boundaries between the tap and the\n * autostart (the `import()` of the player chunk + the HLS attach), so a video\n * element created after them has no gesture attached: the first tap only\n * loaded the player and playback started on the second tap.\n *\n * The fix: create the `<video>` synchronously in the click handler and call\n * `play()` on it right there. Without a src it rejects immediately (that's\n * fine and expected), but the element keeps its user-activation flag — when\n * the player later attaches the real source to THIS element, `play()` with\n * sound goes through.\n */\nexport function createGestureVideo(): HTMLVideoElement {\n const video = document.createElement('video')\n video.setAttribute('playsinline', '')\n const attempt = video.play()\n // The play() CALL inside the gesture is what unlocks the element, not its\n // success the promise rejects (no source) or hangs; either way ignore it.\n if (attempt) attempt.catch(() => {})\n // Pause SYNCHRONOUSLY (the canonical play()+pause() unlock activation\n // sticks to the element). Without this the element leaves the gesture with\n // `paused === false` while having no source: the player's later play() sees\n // no paused→playing transition, the `play` event never fires, and the whole\n // start chain breaks (poster stays up, frames may not render while audio\n // plays, playedOnce/UI state stay stale).\n video.pause()\n return video\n}\n"],"names":["createGestureVideo","video","attempt"],"mappings":"AAiBO,SAASA,IAAuC;AACrD,QAAMC,IAAQ,SAAS,cAAc,OAAO;AAC5C,EAAAA,EAAM,aAAa,eAAe,EAAE;AACpC,QAAMC,IAAUD,EAAM,KAAA;AAGtB,SAAIC,KAASA,EAAQ,MAAM,MAAM;AAAA,EAAC,CAAC,GAOnCD,EAAM,MAAA,GACCA;AACT;"}