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.
- package/README.md +4 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +55 -50
- package/dist/core.js.map +1 -1
- package/dist/{gesture-BLWiPHlW.cjs → gesture-Dc6eb_46.cjs} +2 -2
- package/dist/{gesture-BLWiPHlW.cjs.map → gesture-Dc6eb_46.cjs.map} +1 -1
- package/dist/{gesture-BYJrYanO.js → gesture-hoL6gIex.js} +2 -2
- package/dist/{gesture-BYJrYanO.js.map → gesture-hoL6gIex.js.map} +1 -1
- package/dist/itube-modern-player.iife.js +1 -1
- package/dist/itube-modern-player.iife.js.map +1 -1
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture-
|
|
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;"}
|