aptechka 0.5.36 → 0.5.37
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/lib/video/index.cjs +1 -1
- package/lib/video/index.d.ts +2 -0
- package/lib/video/index.js +28 -24
- package/package.json +1 -1
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const d=require("../ticker/index.cjs"),h=require("../Damped-3daHRLIW.cjs"),m=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");const p=require("../source/index.cjs");var v=Object.defineProperty,E=Object.getOwnPropertyDescriptor,_=(t,e,r,c)=>{for(var s=c>1?void 0:c?E(e,r):e,u=t.length-1,o;u>=0;u--)(o=t[u])&&(s=(c?o(e,r,s):o(s))||s);return c&&s&&v(e,r,s),s},f=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},a=(t,e,r)=>(f(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},i,n;exports.VideoElement=class extends p.SourceElement{constructor(){super(...arguments),l(this,i,new h.Damped(0,{damping:15})),l(this,n,()=>{this.classList.add(`state-${this.consumerElement.readyState}`),a(this,i).set(this.consumerElement.readyState/4),this.consumerElement.readyState===4&&d.ticker.unsubscribe(a(this,n))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{d.ticker.subscribe(a(this,n)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0))})}get loading(){return a(this,i)}disconnectedCallback(){super.disconnectedCallback(),d.ticker.unsubscribe(a(this,n)),a(this,i).close()}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}};i=new WeakMap;n=new WeakMap;exports.VideoElement=_([m.define("e-video")],exports.VideoElement);
|
package/lib/video/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SourceElement } from '../source';
|
|
2
|
+
import { Damped } from '../animation';
|
|
2
3
|
|
|
3
4
|
export declare class VideoElement extends SourceElement<HTMLVideoElement> {
|
|
4
5
|
#private;
|
|
5
6
|
protected connectedCallback(): void;
|
|
7
|
+
get loading(): Damped;
|
|
6
8
|
protected disconnectedCallback(): void;
|
|
7
9
|
protected createConsumer(): HTMLVideoElement;
|
|
8
10
|
protected consumeSource(url: string | null): void;
|
package/lib/video/index.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { define as p } from "../custom-element/index.js";
|
|
2
|
-
import "../window-resizer/index.js";
|
|
3
1
|
import "../Store-BQXXikps.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { ticker as l } from "../ticker/index.js";
|
|
3
|
+
import { D as d } from "../Damped-CH96byE8.js";
|
|
4
|
+
import { define as m } from "../custom-element/index.js";
|
|
5
|
+
import "../window-resizer/index.js";
|
|
6
|
+
import { SourceElement as f } from "../source/index.js";
|
|
7
|
+
var v = Object.defineProperty, E = Object.getOwnPropertyDescriptor, _ = (e, t, r, c) => {
|
|
8
|
+
for (var s = c > 1 ? void 0 : c ? E(t, r) : t, o = e.length - 1, u; o >= 0; o--)
|
|
9
|
+
(u = e[o]) && (s = (c ? u(t, r, s) : u(s)) || s);
|
|
10
|
+
return c && s && v(t, r, s), s;
|
|
11
|
+
}, y = (e, t, r) => {
|
|
11
12
|
if (!t.has(e))
|
|
12
13
|
throw TypeError("Cannot " + r);
|
|
13
|
-
},
|
|
14
|
+
}, a = (e, t, r) => (y(e, t, "read from private field"), r ? r.call(e) : t.get(e)), h = (e, t, r) => {
|
|
14
15
|
if (t.has(e))
|
|
15
16
|
throw TypeError("Cannot add the same private member more than once");
|
|
16
17
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
17
|
-
},
|
|
18
|
-
let
|
|
18
|
+
}, i, n;
|
|
19
|
+
let p = class extends f {
|
|
19
20
|
constructor() {
|
|
20
|
-
super(...arguments),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
), this.consumerElement.readyState === 4 && o.unsubscribe(u(this, a));
|
|
21
|
+
super(...arguments), h(this, i, new d(0, {
|
|
22
|
+
damping: 15
|
|
23
|
+
})), h(this, n, () => {
|
|
24
|
+
this.classList.add(`state-${this.consumerElement.readyState}`), a(this, i).set(this.consumerElement.readyState / 4), this.consumerElement.readyState === 4 && l.unsubscribe(a(this, n));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
connectedCallback() {
|
|
28
28
|
super.connectedCallback(), this.addEventListener("sourceCapture", () => {
|
|
29
|
-
|
|
29
|
+
l.subscribe(a(this, n)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
|
|
30
30
|
}), this.addEventListener("sourceRelease", () => {
|
|
31
31
|
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0));
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
get loading() {
|
|
35
|
+
return a(this, i);
|
|
36
|
+
}
|
|
34
37
|
disconnectedCallback() {
|
|
35
|
-
super.disconnectedCallback(),
|
|
38
|
+
super.disconnectedCallback(), l.unsubscribe(a(this, n)), a(this, i).close();
|
|
36
39
|
}
|
|
37
40
|
createConsumer() {
|
|
38
41
|
return document.createElement("video");
|
|
@@ -41,10 +44,11 @@ let l = class extends h {
|
|
|
41
44
|
this.consumerElement.src = e || "";
|
|
42
45
|
}
|
|
43
46
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
i = /* @__PURE__ */ new WeakMap();
|
|
48
|
+
n = /* @__PURE__ */ new WeakMap();
|
|
49
|
+
p = _([
|
|
50
|
+
m("e-video")
|
|
51
|
+
], p);
|
|
48
52
|
export {
|
|
49
|
-
|
|
53
|
+
p as VideoElement
|
|
50
54
|
};
|