umaki 0.2.2 → 0.2.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
CHANGED
|
@@ -592,3 +592,24 @@ import { waitForAllMediaLoaded } from 'umaki'
|
|
|
592
592
|
console.log(allMediaLoaded) // true または false
|
|
593
593
|
})()
|
|
594
594
|
```
|
|
595
|
+
|
|
596
|
+
## Using for framework and tools
|
|
597
|
+
|
|
598
|
+
フレームワークまたは各種ツール特有の使い方を以下に記載します。
|
|
599
|
+
|
|
600
|
+
### Astro or Vite
|
|
601
|
+
|
|
602
|
+
AstroにてSSRする箇所で利用する場合は`vite.ssr.noExternal`に`umaki`を追加してください。
|
|
603
|
+
|
|
604
|
+
``` ts
|
|
605
|
+
// astro.config.ts
|
|
606
|
+
export default defineConfig(({ mode }) => {
|
|
607
|
+
return {
|
|
608
|
+
vite: {
|
|
609
|
+
ssr: {
|
|
610
|
+
noExternal: ['umaki']
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
})
|
|
615
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../to/toBoolean.cjs.js"),s=async(a,t)=>{if(t&&a.paused){if(i.toBoolean(a.dataset.playing))return;const r=a.play();if(r===void 0)return;try{await r,a.currentTime=0,a.dataset.playing="true"}catch{}}if(!t){if(!i.toBoolean(a.dataset.playing))return;a.pause(),a.dataset.playing="false"}};exports.videoPlayControl=s;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { toBoolean as
|
|
1
|
+
import { toBoolean as s } from "../to/toBoolean.es.js";
|
|
2
2
|
const p = async (a, r) => {
|
|
3
3
|
if (r && a.paused) {
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
4
|
+
if (s(a.dataset.playing)) return;
|
|
5
|
+
const i = a.play();
|
|
6
|
+
if (i === void 0) return;
|
|
7
7
|
try {
|
|
8
|
-
await
|
|
8
|
+
await i, a.currentTime = 0, a.dataset.playing = "true";
|
|
9
9
|
} catch {
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
if (!r
|
|
13
|
-
if (!
|
|
12
|
+
if (!r) {
|
|
13
|
+
if (!s(a.dataset.playing)) return;
|
|
14
14
|
a.pause(), a.dataset.playing = "false";
|
|
15
15
|
}
|
|
16
16
|
};
|