@editframe/elements 0.9.0-beta.1 → 0.10.0-beta.2

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.
@@ -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> | undefined>;
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<(Record<number, import('packages/assets/src/Probe.ts').TrackFragmentIndex> | undefined)[]>;
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;
@@ -95,9 +95,9 @@ let EFCaptions = class extends EFSourceMixin(
95
95
  captionsPath() {
96
96
  if (this.targetElement.assetId) {
97
97
  if (EF_RENDERING()) {
98
- return `editframe://api/video2/caption_files/${this.targetElement.assetId}`;
98
+ return `editframe://api/v1/caption_files/${this.targetElement.assetId}`;
99
99
  }
100
- return `https://editframe.dev/api/video2/caption_files/${this.targetElement.assetId}`;
100
+ return `https://editframe.dev/api/v1/caption_files/${this.targetElement.assetId}`;
101
101
  }
102
102
  const targetSrc = this.targetElement.src;
103
103
  return `/@ef-captions/${targetSrc}`;
@@ -76,9 +76,9 @@ let EFImage = class extends EFSourceMixin(FetchMixin(LitElement), {
76
76
  assetPath() {
77
77
  if (this.assetId) {
78
78
  if (EF_RENDERING()) {
79
- return `editframe://api/video2/image_files/${this.assetId}`;
79
+ return `editframe://api/v1/image_files/${this.assetId}`;
80
80
  }
81
- return `https://editframe.dev/api/video2/image_files/${this.assetId}`;
81
+ return `https://editframe.dev/api/v1/image_files/${this.assetId}`;
82
82
  }
83
83
  return `/@ef-image/${this.src}`;
84
84
  }
@@ -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
  },
@@ -246,18 +243,18 @@ class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
246
243
  fragmentIndexPath() {
247
244
  if (this.assetId) {
248
245
  if (EF_RENDERING()) {
249
- return `editframe://api/video2/isobmff_files/${this.assetId}/index`;
246
+ return `editframe://api/v1/isobmff_files/${this.assetId}/index`;
250
247
  }
251
- return `https://editframe.dev/api/video2/isobmff_files/${this.assetId}/index`;
248
+ return `https://editframe.dev/api/v1/isobmff_files/${this.assetId}/index`;
252
249
  }
253
250
  return `/@ef-track-fragment-index/${this.src ?? ""}`;
254
251
  }
255
252
  fragmentTrackPath(trackId) {
256
253
  if (this.assetId) {
257
254
  if (EF_RENDERING()) {
258
- return `editframe://api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
255
+ return `editframe://api/v1/isobmff_tracks/${this.assetId}/${trackId}`;
259
256
  }
260
- return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}?trackId=${trackId}`;
257
+ return `https://editframe.dev/api/v1/isobmff_tracks/${this.assetId}/${trackId}`;
261
258
  }
262
259
  return `/@ef-track/${this.src ?? ""}?trackId=${trackId}`;
263
260
  }
@@ -38,7 +38,7 @@ function EFSourceMixin(superClass, options) {
38
38
  `efHost not available for ${this}. Cannot generate production URL`
39
39
  );
40
40
  }
41
- return `${this.efHost}/api/video2/${options.assetType}/${this.md5SumLoader.value}`;
41
+ return `${this.efHost}/api/v1/${options.assetType}/${this.md5SumLoader.value}`;
42
42
  }
43
43
  }
44
44
  __decorateClass([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.9.0-beta.1",
3
+ "version": "0.10.0-beta.2",
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.1",
23
+ "@editframe/assets": "0.10.0-beta.2",
24
24
  "@lit/context": "^1.1.2",
25
25
  "@lit/task": "^1.0.1",
26
26
  "d3": "^7.9.0",
@@ -27,7 +27,7 @@ describe("EFCaptions", () => {
27
27
  document.body.appendChild(captions);
28
28
  workbench.appendChild(captions);
29
29
  expect(captions.captionsPath()).toBe(
30
- "editframe://api/video2/caption_files/550e8400-e29b-41d4-a716-446655440000:example.mp4",
30
+ "editframe://api/v1/caption_files/550e8400-e29b-41d4-a716-446655440000:example.mp4",
31
31
  );
32
32
  });
33
33
  });
@@ -43,7 +43,7 @@ describe("EFCaptions", () => {
43
43
  captions.setAttribute("target", id);
44
44
  document.body.appendChild(captions);
45
45
  expect(captions.captionsPath()).toBe(
46
- `https://editframe.dev/api/video2/caption_files/${id}:example.mp4`,
46
+ `https://editframe.dev/api/v1/caption_files/${id}:example.mp4`,
47
47
  );
48
48
  });
49
49
  });
@@ -91,9 +91,9 @@ export class EFCaptions extends EFSourceMixin(
91
91
  captionsPath() {
92
92
  if (this.targetElement.assetId) {
93
93
  if (EF_RENDERING()) {
94
- return `editframe://api/video2/caption_files/${this.targetElement.assetId}`;
94
+ return `editframe://api/v1/caption_files/${this.targetElement.assetId}`;
95
95
  }
96
- return `https://editframe.dev/api/video2/caption_files/${this.targetElement.assetId}`;
96
+ return `https://editframe.dev/api/v1/caption_files/${this.targetElement.assetId}`;
97
97
  }
98
98
  const targetSrc = this.targetElement.src;
99
99
  return `/@ef-captions/${targetSrc}`;
@@ -19,7 +19,7 @@ describe("EFImage", () => {
19
19
  workbench.appendChild(element);
20
20
  element.assetId = "550e8400-e29b-41d4-a716-446655440000:example.jpg";
21
21
  expect(element.assetPath()).toBe(
22
- "editframe://api/video2/image_files/550e8400-e29b-41d4-a716-446655440000:example.jpg",
22
+ "editframe://api/v1/image_files/550e8400-e29b-41d4-a716-446655440000:example.jpg",
23
23
  );
24
24
  });
25
25
  });
@@ -41,7 +41,7 @@ describe("EFImage", () => {
41
41
  const image = document.createElement("ef-image");
42
42
  image.setAttribute("asset-id", `${id}:example.jpg`);
43
43
  expect(image.assetPath()).toBe(
44
- `https://editframe.dev/api/video2/image_files/${id}:example.jpg`,
44
+ `https://editframe.dev/api/v1/image_files/${id}:example.jpg`,
45
45
  );
46
46
  });
47
47
  });
@@ -52,9 +52,9 @@ export class EFImage extends EFSourceMixin(FetchMixin(LitElement), {
52
52
  assetPath() {
53
53
  if (this.assetId) {
54
54
  if (EF_RENDERING()) {
55
- return `editframe://api/video2/image_files/${this.assetId}`;
55
+ return `editframe://api/v1/image_files/${this.assetId}`;
56
56
  }
57
- return `https://editframe.dev/api/video2/image_files/${this.assetId}`;
57
+ return `https://editframe.dev/api/v1/image_files/${this.assetId}`;
58
58
  }
59
59
  return `/@ef-image/${this.src}`;
60
60
  }
@@ -35,7 +35,7 @@ describe("EFMedia", () => {
35
35
  workbench.appendChild(element);
36
36
  element.assetId = "550e8400-e29b-41d4-a716-446655440000:example.mp4";
37
37
  expect(element.fragmentIndexPath()).toBe(
38
- "editframe://api/video2/isobmff_files/550e8400-e29b-41d4-a716-446655440000:example.mp4/index",
38
+ "editframe://api/v1/isobmff_files/550e8400-e29b-41d4-a716-446655440000:example.mp4/index",
39
39
  );
40
40
  });
41
41
 
@@ -45,7 +45,7 @@ describe("EFMedia", () => {
45
45
  workbench.appendChild(element);
46
46
  element.assetId = "550e8400-e29b-41d4-a716-446655440000:example.mp4";
47
47
  expect(element.fragmentTrackPath("1")).toBe(
48
- "editframe://api/video2/isobmff_tracks/550e8400-e29b-41d4-a716-446655440000:example.mp4/1",
48
+ "editframe://api/v1/isobmff_tracks/550e8400-e29b-41d4-a716-446655440000:example.mp4/1",
49
49
  );
50
50
  });
51
51
  });
@@ -67,7 +67,7 @@ describe("EFMedia", () => {
67
67
  const element = document.createElement("test-media");
68
68
  element.setAttribute("asset-id", `${id}:example.mp4`);
69
69
  expect(element.fragmentIndexPath()).toBe(
70
- `https://editframe.dev/api/video2/isobmff_files/${id}:example.mp4/index`,
70
+ `https://editframe.dev/api/v1/isobmff_files/${id}:example.mp4/index`,
71
71
  );
72
72
  });
73
73
 
@@ -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?trackId=1`,
79
+ `https://editframe.dev/api/v1/isobmff_tracks/${id}:example.mp4/1`,
80
80
  );
81
81
  });
82
82
  });
@@ -72,9 +72,9 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
72
72
  fragmentIndexPath() {
73
73
  if (this.assetId) {
74
74
  if (EF_RENDERING()) {
75
- return `editframe://api/video2/isobmff_files/${this.assetId}/index`;
75
+ return `editframe://api/v1/isobmff_files/${this.assetId}/index`;
76
76
  }
77
- return `https://editframe.dev/api/video2/isobmff_files/${this.assetId}/index`;
77
+ return `https://editframe.dev/api/v1/isobmff_files/${this.assetId}/index`;
78
78
  }
79
79
  return `/@ef-track-fragment-index/${this.src ?? ""}`;
80
80
  }
@@ -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
- return `editframe://api/video2/isobmff_tracks/${this.assetId}/${trackId}`;
85
+ return `editframe://api/v1/isobmff_tracks/${this.assetId}/${trackId}`;
88
86
  }
89
- return `https://editframe.dev/api/video2/isobmff_tracks/${this.assetId}?trackId=${trackId}`;
87
+ return `https://editframe.dev/api/v1/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
  },
@@ -39,7 +39,7 @@ export function EFSourceMixin<T extends Constructor<LitElement>>(
39
39
  );
40
40
  }
41
41
 
42
- return `${this.efHost}/api/video2/${options.assetType}/${this.md5SumLoader.value}`;
42
+ return `${this.efHost}/api/v1/${options.assetType}/${this.md5SumLoader.value}`;
43
43
  }
44
44
 
45
45
  md5SumLoader = new Task(this, {
@@ -24,6 +24,8 @@ export declare class TemporalMixinInterface {
24
24
 
25
25
  set duration(value: string);
26
26
  get duration(): string;
27
+ set trimstart(value: string);
28
+ set trimend(value: string);
27
29
 
28
30
  parentTimegroup?: EFTimegroup;
29
31
  rootTimegroup?: EFTimegroup;