@w0s/button-media-same-play 3.0.5 → 3.0.6
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 +1 -1
- package/dist/attribute/Controles.d.ts.map +1 -1
- package/dist/attribute/Controles.js +4 -4
- package/dist/attribute/Controles.js.map +1 -1
- package/dist/attribute/Status.d.ts.map +1 -1
- package/dist/buttonMediaSamePlay.d.ts +2 -2
- package/dist/buttonMediaSamePlay.d.ts.map +1 -1
- package/dist/buttonMediaSamePlay.js +4 -6
- package/dist/buttonMediaSamePlay.js.map +1 -1
- package/dist/event/click.d.ts +3 -3
- package/dist/event/click.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Simultaneous playback button for multiple audio / video
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@w0s/button-media-same-play)
|
|
4
|
-
[](https://github.com/SaekiTominaga/js-library-browser/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
6
|
- If you press the button during pause, the playback starts from the position with the lowest playback time.
|
|
7
7
|
- Pause if you press a button during playback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controles.d.ts","sourceRoot":"","sources":["../../src/attribute/Controles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAGb;;OAEG;
|
|
1
|
+
{"version":3,"file":"Controles.d.ts","sourceRoot":"","sources":["../../src/attribute/Controles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAGb;;OAEG;IACH,YAAY,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAgB3C;IAED,IAAI,QAAQ,IAAI,gBAAgB,EAAE,CAEjC;CACD"}
|
|
@@ -8,15 +8,15 @@ export default class {
|
|
|
8
8
|
*/
|
|
9
9
|
constructor(value) {
|
|
10
10
|
if (value === null || value === undefined) {
|
|
11
|
-
throw new TypeError('The `aria-controls` attribute is not set
|
|
11
|
+
throw new TypeError('The `aria-controls` attribute is not set');
|
|
12
12
|
}
|
|
13
13
|
value.split(' ').forEach((id) => {
|
|
14
|
-
const element = document.
|
|
14
|
+
const element = document.querySelector(`#${id}`);
|
|
15
15
|
if (element === null) {
|
|
16
|
-
throw new Error(`Element \`#${id}\` not found
|
|
16
|
+
throw new Error(`Element \`#${id}\` not found`);
|
|
17
17
|
}
|
|
18
18
|
if (!(element instanceof HTMLMediaElement)) {
|
|
19
|
-
throw new
|
|
19
|
+
throw new TypeError(`Element \`#${id}\` is not a \`HTMLMediaElement\``);
|
|
20
20
|
}
|
|
21
21
|
this.#elements.push(element);
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controles.js","sourceRoot":"","sources":["../../src/attribute/Controles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;IACJ,SAAS,GAAuB,EAAE,CAAC;IAE5C;;OAEG;IACH,YAAY,KAAgC;QAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Controles.js","sourceRoot":"","sources":["../../src/attribute/Controles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;IACJ,SAAS,GAAuB,EAAE,CAAC;IAE5C;;OAEG;IACH,YAAY,KAAgC;QAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;QACjE,CAAC;QAED,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAC/B,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACjD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;YACjD,CAAC;YACD,IAAI,CAAC,CAAC,OAAO,YAAY,gBAAgB,CAAC,EAAE,CAAC;gBAC5C,MAAM,IAAI,SAAS,CAAC,cAAc,EAAE,kCAAkC,CAAC,CAAC;YACzE,CAAC;YAED,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../src/attribute/Status.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAGb,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAEzB;IAED,MAAM;
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../src/attribute/Status.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAGb,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAEzB;IAED,MAAM,SAEL;CACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export default _default;
|
|
1
2
|
/**
|
|
2
3
|
* Simultaneous playback button for multiple audio / video
|
|
3
4
|
*
|
|
4
5
|
* @param thisElement - Target element
|
|
5
6
|
*/
|
|
6
|
-
declare
|
|
7
|
-
export default _default;
|
|
7
|
+
declare function _default(thisElement: HTMLButtonElement): void;
|
|
8
8
|
//# sourceMappingURL=buttonMediaSamePlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonMediaSamePlay.d.ts","sourceRoot":"","sources":["../src/buttonMediaSamePlay.ts"],"names":[],"mappings":"AAIA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"buttonMediaSamePlay.d.ts","sourceRoot":"","sources":["../src/buttonMediaSamePlay.ts"],"names":[],"mappings":";AAIA;;;;GAIG;0BACa,WAAW,EAAE,iBAAiB,GAAG,IAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Controles from
|
|
2
|
-
import Status from
|
|
3
|
-
import clickEvent from
|
|
1
|
+
import Controles from './attribute/Controles.js';
|
|
2
|
+
import Status from './attribute/Status.js';
|
|
3
|
+
import clickEvent from './event/click.js';
|
|
4
4
|
/**
|
|
5
5
|
* Simultaneous playback button for multiple audio / video
|
|
6
6
|
*
|
|
@@ -11,11 +11,9 @@ export default (thisElement) => {
|
|
|
11
11
|
const controls = new Controles(ariaControlsAttribute);
|
|
12
12
|
const status = new Status();
|
|
13
13
|
thisElement.addEventListener('click', (ev) => {
|
|
14
|
-
clickEvent(ev, {
|
|
14
|
+
void clickEvent(ev, {
|
|
15
15
|
controls: controls,
|
|
16
16
|
status: status,
|
|
17
|
-
}).catch((e) => {
|
|
18
|
-
throw e;
|
|
19
17
|
});
|
|
20
18
|
}, { passive: true });
|
|
21
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonMediaSamePlay.js","sourceRoot":"","sources":["../src/buttonMediaSamePlay.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C;;;;GAIG;AACH,eAAe,CAAC,WAA8B,EAAQ,EAAE;IACvD,MAAM,qBAAqB,GAAG,WAAW,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAExE,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;IAE5B,WAAW,CAAC,gBAAgB,CAC3B,OAAO,EACP,CAAC,EAAc,EAAE,EAAE;QAClB,UAAU,CAAC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"buttonMediaSamePlay.js","sourceRoot":"","sources":["../src/buttonMediaSamePlay.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C;;;;GAIG;AACH,eAAe,CAAC,WAA8B,EAAQ,EAAE;IACvD,MAAM,qBAAqB,GAAG,WAAW,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAExE,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;IAE5B,WAAW,CAAC,gBAAgB,CAC3B,OAAO,EACP,CAAC,EAAc,EAAE,EAAE;QAClB,KAAK,UAAU,CAAC,EAAE,EAAE;YACnB,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;IACJ,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,CACjB,CAAC;AACH,CAAC,CAAC"}
|
package/dist/event/click.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type Controls from '../attribute/Controles.ts';
|
|
2
2
|
import type Status from '../attribute/Status.ts';
|
|
3
|
+
export default _default;
|
|
3
4
|
/**
|
|
4
5
|
* `click` event
|
|
5
6
|
*
|
|
@@ -7,9 +8,8 @@ import type Status from '../attribute/Status.ts';
|
|
|
7
8
|
* @param data - Elements and attributes
|
|
8
9
|
* @param data.media - `<button aria-controls>` attribute
|
|
9
10
|
*/
|
|
10
|
-
declare
|
|
11
|
+
declare function _default(_ev: Event, data: Readonly<{
|
|
11
12
|
controls: Controls;
|
|
12
13
|
status: Status;
|
|
13
|
-
}>)
|
|
14
|
-
export default _default;
|
|
14
|
+
}>): Promise<void>;
|
|
15
15
|
//# sourceMappingURL=click.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../src/event/click.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../src/event/click.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;;AAEjD;;;;;;GAMG;0BAEF,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,QAAQ,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC,GACA,OAAO,CAAC,IAAI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: (elementOrElements: NodeListOf<Element> | HTMLCollectionOf<Element> | Element | null) => void;
|
|
2
1
|
export default _default;
|
|
2
|
+
declare function _default(elementOrElements: NodeListOf<Element> | HTMLCollectionOf<Element> | Element | null): void;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";0BAUgB,iBAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import buttonMediaSamePlay from
|
|
1
|
+
import buttonMediaSamePlay from './buttonMediaSamePlay.js';
|
|
2
2
|
const validate = (element) => {
|
|
3
3
|
if (!(element instanceof HTMLButtonElement)) {
|
|
4
|
-
throw new
|
|
4
|
+
throw new TypeError('Element must be a `HTMLButtonElement`');
|
|
5
5
|
}
|
|
6
6
|
return element;
|
|
7
7
|
};
|
|
@@ -13,7 +13,7 @@ export default (elementOrElements) => {
|
|
|
13
13
|
buttonMediaSamePlay(validate(elementOrElements));
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
|
|
16
|
+
[...elementOrElements].forEach((element) => {
|
|
17
17
|
buttonMediaSamePlay(validate(element));
|
|
18
18
|
});
|
|
19
19
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAqB,EAAE;IACxD,IAAI,CAAC,CAAC,OAAO,YAAY,iBAAiB,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAqB,EAAE;IACxD,IAAI,CAAC,CAAC,OAAO,YAAY,iBAAiB,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,CAAC,iBAAmF,EAAQ,EAAE;IAC5G,IAAI,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAChC,OAAO;IACR,CAAC;IAED,IAAI,iBAAiB,YAAY,OAAO,EAAE,CAAC;QAC1C,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACP,CAAC,GAAG,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w0s/button-media-same-play",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "Simultaneous playback button for multiple audio / video",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/SaekiTominaga/js-library-browser#readme",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/SaekiTominaga/js-library-browser/issues"
|
|
9
9
|
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "Saeki Tominaga",
|
|
10
12
|
"repository": {
|
|
11
13
|
"type": "git",
|
|
12
14
|
"url": "git+https://github.com/SaekiTominaga/js-library-browser.git"
|
|
13
15
|
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"author": "Saeki Tominaga",
|
|
16
|
-
"type": "module",
|
|
17
|
-
"main": "dist/index.js",
|
|
18
|
-
"module": "dist/index.js",
|
|
19
|
-
"types": "dist/index.d.ts",
|
|
20
16
|
"files": [
|
|
21
17
|
"dist/**/*.d.ts",
|
|
22
18
|
"!dist/**/*.test.d.ts",
|
|
@@ -27,15 +23,20 @@
|
|
|
27
23
|
"dist/**/*.js.map",
|
|
28
24
|
"!dist/**/*.test.js.map"
|
|
29
25
|
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"module": "dist/index.js",
|
|
29
|
+
"types": "dist/index.d.ts",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
30
33
|
"scripts": {
|
|
31
|
-
"dev": "conc \"http-server -o demo -c-1\" \"tsc -w\"",
|
|
34
|
+
"dev": "conc \"http-server ../ -p 8080 -o button-media-same-play/demo -c-1\" \"tsc -w\"",
|
|
32
35
|
"prebuild": "rimraf dist/* -g",
|
|
33
36
|
"build": "tsc",
|
|
34
|
-
"lint": "eslint src/**/*.ts",
|
|
35
37
|
"pretest": "npm run build",
|
|
36
|
-
"test": "
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"access": "public"
|
|
38
|
+
"test": "npm run test:node & npm run test:playwright",
|
|
39
|
+
"test:node": "cross-env NODE_OPTIONS=--experimental-vm-modules jest dist/.+\\.test\\.js -c ../../jest.config.mjs --roots packages/button-media-same-play",
|
|
40
|
+
"test:playwright": "playwright test buttonMediaSamePlay.spec.ts -c ../../playwright.config.js"
|
|
40
41
|
}
|
|
41
42
|
}
|