itube-modern-player 0.8.0 → 0.8.2
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 +20 -3
- package/dist/core.cjs +3 -3
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +362 -332
- package/dist/core.js.map +1 -1
- package/dist/gesture-BLWiPHlW.cjs +2 -0
- package/dist/gesture-BLWiPHlW.cjs.map +1 -0
- package/dist/gesture-BYJrYanO.js +11 -0
- package/dist/gesture-BYJrYanO.js.map +1 -0
- package/dist/gesture.d.ts +18 -0
- package/dist/itube-modern-player.iife.js +3 -3
- package/dist/itube-modern-player.iife.js.map +1 -1
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.cjs.map +1 -1
- package/dist/lazy.js +81 -44
- package/dist/lazy.js.map +1 -1
- package/dist/player.d.ts +10 -0
- package/dist/types.d.ts +20 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +101 -72
- package/dist/vue.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-gesture media unlock, shared by the lazy entries (`createLazyPlayer`
|
|
3
|
+
* and the Vue wrapper's `lazy` mode).
|
|
4
|
+
*
|
|
5
|
+
* Mobile browsers (iOS Safari first of all) allow `play()` with sound only
|
|
6
|
+
* synchronously inside a user gesture — and the permission is granted PER
|
|
7
|
+
* ELEMENT. The lazy flow crosses two async boundaries between the tap and the
|
|
8
|
+
* autostart (the `import()` of the player chunk + the HLS attach), so a video
|
|
9
|
+
* element created after them has no gesture attached: the first tap only
|
|
10
|
+
* loaded the player and playback started on the second tap.
|
|
11
|
+
*
|
|
12
|
+
* The fix: create the `<video>` synchronously in the click handler and call
|
|
13
|
+
* `play()` on it right there. Without a src it rejects immediately (that's
|
|
14
|
+
* fine and expected), but the element keeps its user-activation flag — when
|
|
15
|
+
* the player later attaches the real source to THIS element, `play()` with
|
|
16
|
+
* sound goes through.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createGestureVideo(): HTMLVideoElement;
|