@editframe/elements 0.15.0-beta.11 → 0.15.0-beta.12
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/dist/elements/EFMedia.d.ts +1 -1
- package/dist/elements/EFMedia.js +7 -2
- package/dist/elements/EFTimegroup.d.ts +1 -1
- package/dist/gui/TWMixin.js +10 -2
- package/package.json +2 -2
- package/src/elements/EFMedia.ts +8 -2
- package/src/gui/TWMixin.ts +15 -2
- package/types.json +1 -1
|
@@ -19,7 +19,7 @@ export declare class EFMedia extends EFMedia_base {
|
|
|
19
19
|
get assetId(): string | null;
|
|
20
20
|
fragmentIndexPath(): string;
|
|
21
21
|
fragmentTrackPath(trackId: string): string;
|
|
22
|
-
trackFragmentIndexLoader: Task<readonly [string, typeof fetch], Record<number, TrackFragmentIndex
|
|
22
|
+
trackFragmentIndexLoader: Task<readonly [string, typeof fetch], Record<number, TrackFragmentIndex> | undefined>;
|
|
23
23
|
initSegmentsLoader: Task<readonly [Record<number, TrackFragmentIndex> | undefined, string, typeof fetch], {
|
|
24
24
|
trackId: string;
|
|
25
25
|
buffer: MP4Box.MP4ArrayBuffer;
|
package/dist/elements/EFMedia.js
CHANGED
|
@@ -70,8 +70,13 @@ const _EFMedia = class _EFMedia2 extends EFTargetable(
|
|
|
70
70
|
this.trackFragmentIndexLoader = new Task(this, {
|
|
71
71
|
args: () => [this.fragmentIndexPath(), this.fetch],
|
|
72
72
|
task: async ([fragmentIndexPath, fetch], { signal }) => {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
try {
|
|
74
|
+
const response = await fetch(fragmentIndexPath, { signal });
|
|
75
|
+
return await response.json();
|
|
76
|
+
} catch (error) {
|
|
77
|
+
log("Failed to load track fragment index", error);
|
|
78
|
+
return void 0;
|
|
79
|
+
}
|
|
75
80
|
},
|
|
76
81
|
onComplete: () => {
|
|
77
82
|
this.requestUpdate("ownCurrentTimeMs");
|
|
@@ -27,7 +27,7 @@ export declare class EFTimegroup extends EFTimegroup_base {
|
|
|
27
27
|
* that caused issues with constructing audio data. We had negative durations
|
|
28
28
|
* in calculations and it was not clear why.
|
|
29
29
|
*/
|
|
30
|
-
waitForMediaDurations(): Promise<Record<number, import('../../../assets/src/index.ts').TrackFragmentIndex>[]>;
|
|
30
|
+
waitForMediaDurations(): Promise<(Record<number, import('../../../assets/src/index.ts').TrackFragmentIndex> | undefined)[]>;
|
|
31
31
|
get childTemporals(): import('./EFTemporal.js').TemporalMixinInterface[];
|
|
32
32
|
protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
33
33
|
private updateAnimations;
|
package/dist/gui/TWMixin.js
CHANGED
|
@@ -18,13 +18,21 @@ function TWMixin(Base) {
|
|
|
18
18
|
"twSheet not found. Probable cause: CSSStyleSheet not supported in this environment"
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
+
const constructorStylesheets = [];
|
|
22
|
+
const constructorStyles = "styles" in this.constructor && this.constructor.styles || [];
|
|
23
|
+
for (const item of constructorStyles) {
|
|
24
|
+
if (item.styleSheet) {
|
|
25
|
+
constructorStylesheets.push(item.styleSheet);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
21
28
|
if (renderRoot?.adoptedStyleSheets) {
|
|
22
29
|
renderRoot.adoptedStyleSheets = [
|
|
23
30
|
twSheet,
|
|
24
|
-
...renderRoot.adoptedStyleSheets
|
|
31
|
+
...renderRoot.adoptedStyleSheets,
|
|
32
|
+
...constructorStylesheets
|
|
25
33
|
];
|
|
26
34
|
} else {
|
|
27
|
-
renderRoot.adoptedStyleSheets = [twSheet];
|
|
35
|
+
renderRoot.adoptedStyleSheets = [twSheet, ...constructorStylesheets];
|
|
28
36
|
}
|
|
29
37
|
return renderRoot;
|
|
30
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/elements",
|
|
3
|
-
"version": "0.15.0-beta.
|
|
3
|
+
"version": "0.15.0-beta.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "UNLICENSED",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@bramus/style-observer": "^1.3.0",
|
|
30
|
-
"@editframe/assets": "0.15.0-beta.
|
|
30
|
+
"@editframe/assets": "0.15.0-beta.12",
|
|
31
31
|
"@lit/context": "^1.1.2",
|
|
32
32
|
"@lit/task": "^1.0.1",
|
|
33
33
|
"d3": "^7.9.0",
|
package/src/elements/EFMedia.ts
CHANGED
|
@@ -126,8 +126,14 @@ export class EFMedia extends EFTargetable(
|
|
|
126
126
|
public trackFragmentIndexLoader = new Task(this, {
|
|
127
127
|
args: () => [this.fragmentIndexPath(), this.fetch] as const,
|
|
128
128
|
task: async ([fragmentIndexPath, fetch], { signal }) => {
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
try {
|
|
130
|
+
const response = await fetch(fragmentIndexPath, { signal });
|
|
131
|
+
|
|
132
|
+
return (await response.json()) as Record<number, TrackFragmentIndex>;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
log("Failed to load track fragment index", error);
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
131
137
|
},
|
|
132
138
|
onComplete: () => {
|
|
133
139
|
this.requestUpdate("ownCurrentTimeMs");
|
package/src/gui/TWMixin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LitElement } from "lit";
|
|
1
|
+
import type { CSSResult, LitElement } from "lit";
|
|
2
2
|
// @ts-expect-error cannot figure out how to declare this module as a string
|
|
3
3
|
import twStyle from "./TWMixin.css?inline";
|
|
4
4
|
|
|
@@ -21,13 +21,26 @@ export function TWMixin<T extends new (...args: any[]) => LitElement>(Base: T) {
|
|
|
21
21
|
"twSheet not found. Probable cause: CSSStyleSheet not supported in this environment",
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
const constructorStylesheets: CSSStyleSheet[] = [];
|
|
26
|
+
const constructorStyles = (("styles" in this.constructor &&
|
|
27
|
+
this.constructor.styles) ||
|
|
28
|
+
[]) as CSSResult[];
|
|
29
|
+
|
|
30
|
+
for (const item of constructorStyles) {
|
|
31
|
+
if (item.styleSheet) {
|
|
32
|
+
constructorStylesheets.push(item.styleSheet);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
24
36
|
if (renderRoot?.adoptedStyleSheets) {
|
|
25
37
|
renderRoot.adoptedStyleSheets = [
|
|
26
38
|
twSheet,
|
|
27
39
|
...renderRoot.adoptedStyleSheets,
|
|
40
|
+
...constructorStylesheets,
|
|
28
41
|
];
|
|
29
42
|
} else {
|
|
30
|
-
renderRoot.adoptedStyleSheets = [twSheet];
|
|
43
|
+
renderRoot.adoptedStyleSheets = [twSheet, ...constructorStylesheets];
|
|
31
44
|
}
|
|
32
45
|
return renderRoot;
|
|
33
46
|
}
|