@editframe/elements 0.9.0-beta.1 → 0.9.0-beta.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/dist/elements/EFMedia.d.ts +1 -1
- package/dist/elements/EFTemporal.d.ts +2 -0
- package/dist/elements/EFTimegroup.d.ts +1 -1
- package/dist/elements/src/elements/EFMedia.js +1 -4
- package/package.json +2 -2
- package/src/elements/EFMedia.browsertest.ts +1 -1
- package/src/elements/EFMedia.ts +4 -6
- package/src/elements/EFTemporal.ts +2 -0
|
@@ -15,7 +15,7 @@ export declare class EFMedia extends EFMedia_base {
|
|
|
15
15
|
get assetId(): string | null;
|
|
16
16
|
fragmentIndexPath(): string;
|
|
17
17
|
fragmentTrackPath(trackId: string): string;
|
|
18
|
-
trackFragmentIndexLoader: Task<readonly [string, typeof fetch], Record<number, TrackFragmentIndex
|
|
18
|
+
trackFragmentIndexLoader: Task<readonly [string, typeof fetch], Record<number, TrackFragmentIndex>>;
|
|
19
19
|
protected initSegmentsLoader: Task<readonly [Record<number, TrackFragmentIndex> | undefined, string, typeof fetch], {
|
|
20
20
|
trackId: string;
|
|
21
21
|
buffer: MP4Box.MP4ArrayBuffer;
|
|
@@ -16,6 +16,8 @@ export declare class TemporalMixinInterface {
|
|
|
16
16
|
get trimAdjustedOwnCurrentTimeMs(): number;
|
|
17
17
|
set duration(value: string);
|
|
18
18
|
get duration(): string;
|
|
19
|
+
set trimstart(value: string);
|
|
20
|
+
set trimend(value: string);
|
|
19
21
|
parentTimegroup?: EFTimegroup;
|
|
20
22
|
rootTimegroup?: EFTimegroup;
|
|
21
23
|
frameTask: Task<readonly unknown[], unknown>;
|
|
@@ -17,7 +17,7 @@ export declare class EFTimegroup extends EFTimegroup_base {
|
|
|
17
17
|
connectedCallback(): void;
|
|
18
18
|
get storageKey(): string;
|
|
19
19
|
get durationMs(): number;
|
|
20
|
-
waitForMediaDurations(): Promise<
|
|
20
|
+
waitForMediaDurations(): Promise<Record<number, import('packages/assets/src/Probe.ts').TrackFragmentIndex>[]>;
|
|
21
21
|
get childTemporals(): import('./EFTemporal.ts').TemporalMixinInterface[];
|
|
22
22
|
protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
23
23
|
shouldWrapWithWorkbench(): boolean;
|
|
@@ -44,9 +44,6 @@ class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
|
|
|
44
44
|
this.trackFragmentIndexLoader = new Task(this, {
|
|
45
45
|
args: () => [this.fragmentIndexPath(), this.fetch],
|
|
46
46
|
task: async ([fragmentIndexPath, fetch], { signal }) => {
|
|
47
|
-
if (this.src === "") {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
47
|
const response = await fetch(fragmentIndexPath, { signal });
|
|
51
48
|
return await response.json();
|
|
52
49
|
},
|
|
@@ -257,7 +254,7 @@ class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
|
|
|
257
254
|
if (EF_RENDERING()) {
|
|
258
255
|
return `editframe://api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
|
|
259
256
|
}
|
|
260
|
-
return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}
|
|
257
|
+
return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
|
|
261
258
|
}
|
|
262
259
|
return `/@ef-track/${this.src ?? ""}?trackId=${trackId}`;
|
|
263
260
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/elements",
|
|
3
|
-
"version": "0.9.0-beta.
|
|
3
|
+
"version": "0.9.0-beta.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "UNLICENSED",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@editframe/assets": "0.9.0-beta.
|
|
23
|
+
"@editframe/assets": "0.9.0-beta.3",
|
|
24
24
|
"@lit/context": "^1.1.2",
|
|
25
25
|
"@lit/task": "^1.0.1",
|
|
26
26
|
"d3": "^7.9.0",
|
|
@@ -76,7 +76,7 @@ describe("EFMedia", () => {
|
|
|
76
76
|
const element = document.createElement("test-media");
|
|
77
77
|
element.setAttribute("asset-id", `${id}:example.mp4`);
|
|
78
78
|
expect(element.fragmentTrackPath("1")).toBe(
|
|
79
|
-
`https://editframe.dev/api/video2/isobmff_tracks/${id}:example.mp4
|
|
79
|
+
`https://editframe.dev/api/video2/isobmff_tracks/${id}:example.mp4/1`,
|
|
80
80
|
);
|
|
81
81
|
});
|
|
82
82
|
});
|
package/src/elements/EFMedia.ts
CHANGED
|
@@ -82,21 +82,19 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
|
|
|
82
82
|
fragmentTrackPath(trackId: string) {
|
|
83
83
|
if (this.assetId) {
|
|
84
84
|
if (EF_RENDERING()) {
|
|
85
|
-
// It is significant that the editframe:// protocol lists the trackId in the path rather than
|
|
86
|
-
// as a query parameter. This is a shortcut to loading track data from storage.
|
|
87
85
|
return `editframe://api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
|
|
88
86
|
}
|
|
89
|
-
return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}
|
|
87
|
+
return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
|
|
90
88
|
}
|
|
89
|
+
// trackId is only specified as a query in the @ef-track url shape
|
|
90
|
+
// this is because that system doesn't have a full url matching system.
|
|
91
|
+
// This is an annoying incosistency that should be fixed.
|
|
91
92
|
return `/@ef-track/${this.src ?? ""}?trackId=${trackId}`;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
public trackFragmentIndexLoader = new Task(this, {
|
|
95
96
|
args: () => [this.fragmentIndexPath(), this.fetch] as const,
|
|
96
97
|
task: async ([fragmentIndexPath, fetch], { signal }) => {
|
|
97
|
-
if (this.src === "") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
98
|
const response = await fetch(fragmentIndexPath, { signal });
|
|
101
99
|
return (await response.json()) as Record<number, TrackFragmentIndex>;
|
|
102
100
|
},
|