@editframe/elements 0.12.0-beta.8 → 0.13.0-beta.1
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/EFAudio.d.ts +1 -1
- package/dist/elements/EFCaptions.d.ts +5 -5
- package/dist/elements/EFImage.d.ts +1 -1
- package/dist/elements/EFMedia.browsertest.d.ts +1 -1
- package/dist/elements/EFMedia.d.ts +6 -1
- package/dist/elements/{src/elements/EFMedia.js → EFMedia.js} +3 -3
- package/dist/elements/EFTemporal.browsertest.d.ts +1 -1
- package/dist/elements/EFTemporal.d.ts +145 -2
- package/dist/elements/{src/elements/EFTemporal.js → EFTemporal.js} +3 -0
- package/dist/elements/EFTimegroup.browsertest.d.ts +2 -2
- package/dist/elements/EFTimegroup.d.ts +8 -3
- package/dist/elements/{src/elements/EFTimegroup.js → EFTimegroup.js} +104 -53
- package/dist/elements/EFVideo.d.ts +1 -1
- package/dist/elements/{src/elements/EFVideo.js → EFVideo.js} +10 -2
- package/dist/elements/EFWaveform.d.ts +7 -4
- package/dist/elements/{src/elements/EFWaveform.js → EFWaveform.js} +48 -56
- package/dist/elements/TimegroupController.d.ts +2 -2
- package/dist/elements/util.d.ts +1 -1
- package/dist/gui/ContextMixin.browsertest.d.ts +1 -1
- package/dist/gui/ContextMixin.d.ts +4 -1
- package/dist/{elements/src/gui → gui}/ContextMixin.js +26 -42
- package/dist/gui/EFFilmstrip.d.ts +15 -9
- package/dist/{elements/src/gui → gui}/EFFilmstrip.js +64 -16
- package/dist/gui/EFFocusOverlay.d.ts +17 -0
- package/dist/gui/EFFocusOverlay.js +82 -0
- package/dist/gui/EFPreview.d.ts +3 -1
- package/dist/{elements/src/gui → gui}/EFPreview.js +24 -16
- package/dist/gui/EFScrubber.d.ts +1 -1
- package/dist/gui/EFTimeDisplay.d.ts +1 -1
- package/dist/gui/EFToggleLoop.d.ts +1 -1
- package/dist/gui/EFTogglePlay.d.ts +1 -1
- package/dist/gui/EFWorkbench.d.ts +1 -1
- package/dist/{elements/src/gui → gui}/TWMixin.css.js +1 -1
- package/dist/gui/efContext.d.ts +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/{elements/src/index.js → index.js} +2 -0
- package/dist/style.css +769 -19
- package/package.json +5 -4
- package/src/elements/EFAudio.ts +3 -3
- package/src/elements/EFCaptions.browsertest.ts +3 -3
- package/src/elements/EFCaptions.ts +9 -9
- package/src/elements/EFImage.browsertest.ts +2 -2
- package/src/elements/EFImage.ts +4 -4
- package/src/elements/EFMedia.browsertest.ts +6 -6
- package/src/elements/EFMedia.ts +14 -7
- package/src/elements/EFSourceMixin.ts +3 -3
- package/src/elements/EFTemporal.browsertest.ts +1 -1
- package/src/elements/EFTemporal.ts +159 -4
- package/src/elements/EFTimegroup.browsertest.ts +5 -5
- package/src/elements/EFTimegroup.ts +141 -68
- package/src/elements/EFVideo.ts +15 -4
- package/src/elements/EFWaveform.ts +82 -98
- package/src/elements/FetchMixin.ts +2 -2
- package/src/elements/TimegroupController.ts +2 -2
- package/src/elements/durationConverter.ts +1 -1
- package/src/elements/util.ts +1 -1
- package/src/gui/ContextMixin.browsertest.ts +3 -3
- package/src/gui/ContextMixin.ts +37 -49
- package/src/gui/EFFilmstrip.ts +92 -36
- package/src/gui/EFFocusOverlay.ts +79 -0
- package/src/gui/EFPreview.ts +35 -18
- package/src/gui/EFScrubber.ts +3 -3
- package/src/gui/EFTimeDisplay.ts +2 -2
- package/src/gui/EFToggleLoop.ts +4 -4
- package/src/gui/EFTogglePlay.ts +3 -3
- package/src/gui/EFWorkbench.ts +2 -2
- package/src/gui/efContext.ts +1 -1
- package/dist/assets/src/EncodedAsset.js +0 -560
- package/dist/assets/src/MP4File.js +0 -223
- package/dist/assets/src/memoize.js +0 -14
- package/dist/{elements/src/EF_FRAMEGEN.js → EF_FRAMEGEN.js} +0 -0
- package/dist/{elements/src/EF_INTERACTIVE.js → EF_INTERACTIVE.js} +0 -0
- package/dist/{elements/src/EF_RENDERING.js → EF_RENDERING.js} +0 -0
- package/dist/elements/{src/elements/CrossUpdateController.js → CrossUpdateController.js} +0 -0
- package/dist/elements/{src/elements/EFAudio.js → EFAudio.js} +2 -2
- package/dist/elements/{src/elements/EFCaptions.js → EFCaptions.js} +0 -0
- package/dist/elements/{src/elements/EFImage.js → EFImage.js} +0 -0
- package/dist/elements/{src/elements/EFSourceMixin.js → EFSourceMixin.js} +1 -1
- package/dist/elements/{src/elements/FetchMixin.js → FetchMixin.js} +0 -0
- package/dist/elements/{src/elements/TimegroupController.js → TimegroupController.js} +0 -0
- package/dist/elements/{src/elements/durationConverter.js → durationConverter.js} +0 -0
- package/dist/elements/{src/elements/parseTimeToMs.js → parseTimeToMs.js} +0 -0
- package/dist/{elements/src/gui → gui}/EFScrubber.js +0 -0
- package/dist/{elements/src/gui → gui}/EFTimeDisplay.js +0 -0
- package/dist/{elements/src/gui → gui}/EFToggleLoop.js +1 -1
- /package/dist/{elements/src/gui → gui}/EFTogglePlay.js +0 -0
- /package/dist/{elements/src/gui → gui}/EFWorkbench.js +0 -0
- /package/dist/{elements/src/gui → gui}/TWMixin.js +0 -0
- /package/dist/{elements/src/gui → gui}/apiHostContext.js +0 -0
- /package/dist/{elements/src/gui → gui}/efContext.js +0 -0
- /package/dist/{elements/src/gui → gui}/fetchContext.js +0 -0
- /package/dist/{elements/src/gui → gui}/focusContext.js +0 -0
- /package/dist/{elements/src/gui → gui}/focusedElementContext.js +0 -0
- /package/dist/{elements/src/gui → gui}/playingContext.js +0 -0
- /package/dist/{elements/src/msToTimeCode.js → msToTimeCode.js} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"default": "./dist/
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"./styles.css": "./dist/style.css"
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
|
|
17
17
|
"build": "vite build",
|
|
18
|
-
"build:watch": "vite build --watch"
|
|
18
|
+
"build:watch": "vite build --watch",
|
|
19
|
+
"typedoc": "typedoc --json ../../docs/elements.json --plugin typedoc-plugin-zod --excludeExternals ./src"
|
|
19
20
|
},
|
|
20
21
|
"author": "",
|
|
21
22
|
"license": "UNLICENSED",
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@editframe/assets": "0.
|
|
24
|
+
"@editframe/assets": "0.13.0-beta.1",
|
|
24
25
|
"@lit/context": "^1.1.2",
|
|
25
26
|
"@lit/task": "^1.0.1",
|
|
26
27
|
"d3": "^7.9.0",
|
package/src/elements/EFAudio.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Task } from "@lit/task";
|
|
1
2
|
import { html } from "lit";
|
|
2
|
-
import { createRef, ref } from "lit/directives/ref.js";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
|
+
import { EFMedia } from "./EFMedia.js";
|
|
6
6
|
|
|
7
7
|
@customElement("ef-audio")
|
|
8
8
|
export class EFAudio extends EFMedia {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
2
|
-
import "../gui/EFPreview.
|
|
3
|
-
import "./EFCaptions.
|
|
4
|
-
import "./EFVideo.
|
|
2
|
+
import "../gui/EFPreview.js";
|
|
3
|
+
import "./EFCaptions.js";
|
|
4
|
+
import "./EFVideo.js";
|
|
5
5
|
import { v4 } from "uuid";
|
|
6
6
|
|
|
7
7
|
describe("EFCaptions", () => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Task } from "@lit/task";
|
|
2
2
|
import { LitElement, type PropertyValueMap, css, html } from "lit";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
|
-
import type { GetISOBMFFFileTranscriptionResult } from "../../../api/src/index.
|
|
5
|
-
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.
|
|
6
|
-
import { EF_RENDERING } from "../EF_RENDERING.
|
|
7
|
-
import { CrossUpdateController } from "./CrossUpdateController.
|
|
8
|
-
import { EFAudio } from "./EFAudio.
|
|
9
|
-
import { EFSourceMixin } from "./EFSourceMixin.
|
|
10
|
-
import { EFTemporal } from "./EFTemporal.
|
|
11
|
-
import { EFVideo } from "./EFVideo.
|
|
12
|
-
import { FetchMixin } from "./FetchMixin.
|
|
4
|
+
import type { GetISOBMFFFileTranscriptionResult } from "../../../api/src/index.js";
|
|
5
|
+
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
|
|
6
|
+
import { EF_RENDERING } from "../EF_RENDERING.js";
|
|
7
|
+
import { CrossUpdateController } from "./CrossUpdateController.js";
|
|
8
|
+
import { EFAudio } from "./EFAudio.js";
|
|
9
|
+
import { EFSourceMixin } from "./EFSourceMixin.js";
|
|
10
|
+
import { EFTemporal } from "./EFTemporal.js";
|
|
11
|
+
import { EFVideo } from "./EFVideo.js";
|
|
12
|
+
import { FetchMixin } from "./FetchMixin.js";
|
|
13
13
|
|
|
14
14
|
interface WordSegment {
|
|
15
15
|
text: string;
|
package/src/elements/EFImage.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { Task } from "@lit/task";
|
|
|
2
2
|
import { LitElement, css, html } from "lit";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
|
-
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.
|
|
6
|
-
import { EF_RENDERING } from "../EF_RENDERING.
|
|
7
|
-
import { EFSourceMixin } from "./EFSourceMixin.
|
|
8
|
-
import { FetchMixin } from "./FetchMixin.
|
|
5
|
+
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
|
|
6
|
+
import { EF_RENDERING } from "../EF_RENDERING.js";
|
|
7
|
+
import { EFSourceMixin } from "./EFSourceMixin.js";
|
|
8
|
+
import { FetchMixin } from "./FetchMixin.js";
|
|
9
9
|
|
|
10
10
|
@customElement("ef-image")
|
|
11
11
|
export class EFImage extends EFSourceMixin(FetchMixin(LitElement), {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { customElement } from "lit/decorators.js";
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
4
|
-
import { EFMedia } from "./EFMedia.
|
|
5
|
-
import "../gui/EFWorkbench.
|
|
6
|
-
import "../gui/EFPreview.
|
|
7
|
-
import "./EFTimegroup.
|
|
8
|
-
import { createTestFragmentIndex } from "TEST/createTestFragmentIndex.
|
|
9
|
-
import { useMockWorker } from "TEST/useMockWorker.
|
|
4
|
+
import { EFMedia } from "./EFMedia.js";
|
|
5
|
+
import "../gui/EFWorkbench.js";
|
|
6
|
+
import "../gui/EFPreview.js";
|
|
7
|
+
import "./EFTimegroup.js";
|
|
8
|
+
import { createTestFragmentIndex } from "TEST/createTestFragmentIndex.js";
|
|
9
|
+
import { useMockWorker } from "TEST/useMockWorker.js";
|
|
10
10
|
import { http, HttpResponse } from "msw";
|
|
11
11
|
|
|
12
12
|
@customElement("test-media")
|
package/src/elements/EFMedia.ts
CHANGED
|
@@ -10,12 +10,12 @@ import type { TrackFragmentIndex, TrackSegment } from "@editframe/assets";
|
|
|
10
10
|
|
|
11
11
|
import { VideoAsset } from "@editframe/assets/EncodedAsset.js";
|
|
12
12
|
import { MP4File } from "@editframe/assets/MP4File.js";
|
|
13
|
-
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.
|
|
14
|
-
import { EF_RENDERING } from "../EF_RENDERING.
|
|
15
|
-
import { apiHostContext } from "../gui/apiHostContext.
|
|
16
|
-
import { EFSourceMixin } from "./EFSourceMixin.
|
|
17
|
-
import { EFTemporal, isEFTemporal } from "./EFTemporal.
|
|
18
|
-
import { FetchMixin } from "./FetchMixin.
|
|
13
|
+
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
|
|
14
|
+
import { EF_RENDERING } from "../EF_RENDERING.js";
|
|
15
|
+
import { apiHostContext } from "../gui/apiHostContext.js";
|
|
16
|
+
import { EFSourceMixin } from "./EFSourceMixin.js";
|
|
17
|
+
import { EFTemporal, isEFTemporal } from "./EFTemporal.js";
|
|
18
|
+
import { FetchMixin } from "./FetchMixin.js";
|
|
19
19
|
|
|
20
20
|
const log = debug("ef:elements:EFMedia");
|
|
21
21
|
|
|
@@ -54,6 +54,12 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
|
|
|
54
54
|
efHost?: string;
|
|
55
55
|
|
|
56
56
|
#assetId: string | null = null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The unique identifier for the media asset.
|
|
60
|
+
* This property can be set programmatically or via the "asset-id" attribute.
|
|
61
|
+
* @domAttribute "asset-id"
|
|
62
|
+
*/
|
|
57
63
|
@property({ type: String, attribute: "asset-id", reflect: true })
|
|
58
64
|
set assetId(value: string | null) {
|
|
59
65
|
this.#assetId = value;
|
|
@@ -314,9 +320,10 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
|
|
|
314
320
|
this.style.display = "";
|
|
315
321
|
|
|
316
322
|
const animations = this.getAnimations({ subtree: true });
|
|
323
|
+
|
|
317
324
|
this.style.setProperty("--ef-duration", `${this.durationMs}ms`);
|
|
318
325
|
this.style.setProperty(
|
|
319
|
-
"--ef-transition
|
|
326
|
+
"--ef-transition-duration",
|
|
320
327
|
`${this.parentTimegroup?.overlapMs ?? 0}ms`,
|
|
321
328
|
);
|
|
322
329
|
this.style.setProperty(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { consume } from "@lit/context";
|
|
2
|
-
import type { LitElement } from "lit";
|
|
3
|
-
import { state } from "lit/decorators/state.js";
|
|
4
2
|
import { Task } from "@lit/task";
|
|
3
|
+
import type { LitElement } from "lit";
|
|
5
4
|
import { property } from "lit/decorators/property.js";
|
|
6
|
-
import {
|
|
5
|
+
import { state } from "lit/decorators/state.js";
|
|
6
|
+
import { apiHostContext } from "../gui/apiHostContext.js";
|
|
7
7
|
|
|
8
8
|
export declare class EFSourceMixinInterface {
|
|
9
9
|
apiHost?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { customElement } from "lit/decorators/custom-element.js";
|
|
3
3
|
import { describe, expect, test } from "vitest";
|
|
4
|
-
import { EFTemporal } from "./EFTemporal.
|
|
4
|
+
import { EFTemporal } from "./EFTemporal.js";
|
|
5
5
|
|
|
6
6
|
@customElement("test-temporal")
|
|
7
7
|
class TestTemporal extends EFTemporal(LitElement) {}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { consume, createContext } from "@lit/context";
|
|
2
2
|
import type { LitElement, ReactiveController } from "lit";
|
|
3
3
|
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import type { EFTimegroup } from "./EFTimegroup.
|
|
4
|
+
import type { EFTimegroup } from "./EFTimegroup.js";
|
|
5
5
|
|
|
6
6
|
import { Task } from "@lit/task";
|
|
7
|
-
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.
|
|
8
|
-
import { durationConverter } from "./durationConverter.
|
|
7
|
+
import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
|
|
8
|
+
import { durationConverter } from "./durationConverter.js";
|
|
9
9
|
|
|
10
10
|
export const timegroupContext = createContext<EFTimegroup>(
|
|
11
11
|
Symbol("timeGroupContext"),
|
|
@@ -13,14 +13,76 @@ export const timegroupContext = createContext<EFTimegroup>(
|
|
|
13
13
|
|
|
14
14
|
export declare class TemporalMixinInterface {
|
|
15
15
|
get hasOwnDuration(): boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Used to trim the start of the media.
|
|
19
|
+
*
|
|
20
|
+
* This can be set in either seconds or milliseconds.
|
|
21
|
+
*
|
|
22
|
+
* For example, `trimstart="10s"` is equivalent to `trimstart="10000ms"`.
|
|
23
|
+
*
|
|
24
|
+
* @domAttribute "trimstart"
|
|
25
|
+
*/
|
|
16
26
|
get trimStartMs(): number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Used to trim the end of the media.
|
|
30
|
+
*
|
|
31
|
+
* This can be set in either seconds or milliseconds.
|
|
32
|
+
*
|
|
33
|
+
* For example, `trimend="10s"` is equivalent to `trimend="10000ms"`.
|
|
34
|
+
*
|
|
35
|
+
* @domAttribute "trimend"
|
|
36
|
+
*/
|
|
17
37
|
get trimEndMs(): number;
|
|
38
|
+
|
|
18
39
|
set trimStartMs(value: number);
|
|
19
40
|
set trimEndMs(value: number);
|
|
20
41
|
set trimstart(value: string);
|
|
21
42
|
set trimend(value: string);
|
|
22
43
|
|
|
44
|
+
/**
|
|
45
|
+
* The source in time of the element.
|
|
46
|
+
*
|
|
47
|
+
* This is an amount of time to trim off the beginning of the media.
|
|
48
|
+
*
|
|
49
|
+
* This can be set in either seconds or milliseconds.
|
|
50
|
+
*
|
|
51
|
+
* For example, `sourcein="10s"` is equivalent to `sourcein="10000ms"`.
|
|
52
|
+
*
|
|
53
|
+
* If the sourcein time is greater than the duration of the media, the media
|
|
54
|
+
* will not be played.
|
|
55
|
+
*
|
|
56
|
+
* If the media is 20 seconds long, and the `sourcein` value is set to `10s`, the
|
|
57
|
+
* media will play for 10 seconds, starting at the 10 second mark.
|
|
58
|
+
*
|
|
59
|
+
* Can be used in conjunction with `sourceout` to create a trimmed media.
|
|
60
|
+
*
|
|
61
|
+
* @domAttribute "sourcein"
|
|
62
|
+
*/
|
|
23
63
|
get sourceInMs(): number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The source out time of the element.
|
|
67
|
+
*
|
|
68
|
+
* This is the point in time in the media that will be treated as the end of
|
|
69
|
+
* the media.
|
|
70
|
+
*
|
|
71
|
+
* This can be set in either seconds or milliseconds.
|
|
72
|
+
*
|
|
73
|
+
* For example, `sourceout="10s"` is equivalent to `sourceout="10000ms"`.
|
|
74
|
+
*
|
|
75
|
+
* If the sourceout time is greater than the duration of the media, the media
|
|
76
|
+
* will play until the end of the media.
|
|
77
|
+
*
|
|
78
|
+
* If the media is 20 seconds long, and the `sourceout` value is set to `10s`,
|
|
79
|
+
* the media will play for 10 seconds, starting at zero seconds and ending at
|
|
80
|
+
* the 10 second mark.
|
|
81
|
+
*
|
|
82
|
+
* Can be used in conjunction with `sourcein` to create a trimmed media.
|
|
83
|
+
*
|
|
84
|
+
* @domAttribute "sourceout"
|
|
85
|
+
*/
|
|
24
86
|
get sourceOutMs(): number;
|
|
25
87
|
|
|
26
88
|
set sourceInMs(value: number);
|
|
@@ -28,17 +90,106 @@ export declare class TemporalMixinInterface {
|
|
|
28
90
|
set sourcein(value: string);
|
|
29
91
|
set sourceout(value: string);
|
|
30
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @domAttribute "duration"
|
|
95
|
+
*/
|
|
31
96
|
get durationMs(): number;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The start time of the element within its root timegroup in milliseconds.
|
|
100
|
+
*
|
|
101
|
+
* This is an absolute time according to the highest scoped timegroup the media element is contained within.
|
|
102
|
+
*
|
|
103
|
+
* The calculated value will depend on the mode of the timegroup and the offset of the media element.
|
|
104
|
+
*
|
|
105
|
+
* If the parent time group is in `sequence` mode, the start time will be the
|
|
106
|
+
* start time of the previous sibling element plus the previous sibling's duration
|
|
107
|
+
* minus the overlap of the previous sibling and the current sibling.
|
|
108
|
+
*
|
|
109
|
+
* If the parent time group is in `contain` or `fixed` mode, the start time will be
|
|
110
|
+
* the start time of the parent time group plus the offset of the media element.
|
|
111
|
+
*/
|
|
32
112
|
get startTimeMs(): number;
|
|
33
|
-
|
|
113
|
+
/**
|
|
114
|
+
* The end time of the element within its root timegroup in milliseconds.
|
|
115
|
+
*
|
|
116
|
+
* This is an absolute time according to the highest scoped timegroup the media
|
|
117
|
+
* element is contained within. Computed by adding the media's duration to its
|
|
118
|
+
* start time.
|
|
119
|
+
*
|
|
120
|
+
* If the media element has been trimmed, its end time will be calculated according it
|
|
121
|
+
* its trimmed duration, not its original duration.
|
|
122
|
+
*/
|
|
34
123
|
get endTimeMs(): number;
|
|
124
|
+
/**
|
|
125
|
+
* The start time of the element within its parent timegroup in milliseconds.
|
|
126
|
+
*
|
|
127
|
+
* This is a relative time according to the closest timegroup the media element
|
|
128
|
+
* is contained within. Unless the media element has been given any kind of specific offset
|
|
129
|
+
* it is common for this time to be zero.
|
|
130
|
+
*/
|
|
131
|
+
get startTimeWithinParentMs(): number;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The current time of the element in milliseconds.
|
|
135
|
+
*
|
|
136
|
+
* This is a relative time according to the closest timegroup the media element
|
|
137
|
+
* is contained within.
|
|
138
|
+
*
|
|
139
|
+
* This is suitable for determining the percentage of the media that has been
|
|
140
|
+
* played.
|
|
141
|
+
*/
|
|
35
142
|
get ownCurrentTimeMs(): number;
|
|
143
|
+
/**
|
|
144
|
+
* The current time of the element in milliseconds, adjusted for trimming.
|
|
145
|
+
*
|
|
146
|
+
* This is suitable for mapping to internal media time codes for audio/video
|
|
147
|
+
* elements.
|
|
148
|
+
*
|
|
149
|
+
* For example, if the media has a `sourcein` value of 10s, when `ownCurrentTimeMs` is 0s,
|
|
150
|
+
* `trimAdjustedOwnCurrentTimeMs` will be 10s.
|
|
151
|
+
*
|
|
152
|
+
* sourcein=10s sourceout=10s
|
|
153
|
+
* / / /
|
|
154
|
+
* |--------|=================|---------|
|
|
155
|
+
* ^
|
|
156
|
+
* |_
|
|
157
|
+
* trimAdjustedOwnCurrentTimeMs === 10s
|
|
158
|
+
* |_
|
|
159
|
+
* ownCurrentTimeMs === 0s
|
|
160
|
+
*/
|
|
36
161
|
get trimAdjustedOwnCurrentTimeMs(): number;
|
|
37
162
|
|
|
38
163
|
set duration(value: string);
|
|
39
164
|
get duration(): string;
|
|
40
165
|
|
|
166
|
+
/**
|
|
167
|
+
* The offset of the element within its parent timegroup in milliseconds.
|
|
168
|
+
*
|
|
169
|
+
* This can be set in either seconds or milliseconds.
|
|
170
|
+
*
|
|
171
|
+
* For example, `offset="10s"` is equivalent to `offset="10000ms"`.
|
|
172
|
+
*
|
|
173
|
+
* This can be used to create a negative or positive offset for the start time of the media.
|
|
174
|
+
*
|
|
175
|
+
* This will change the start time of the media relative to it's otherwise normal start time.
|
|
176
|
+
*
|
|
177
|
+
* The duration of the element, or it's parent, or the start and end time of it's temporal siblings will not
|
|
178
|
+
* be affected by this offset.
|
|
179
|
+
*
|
|
180
|
+
* @domAttribute "offset"
|
|
181
|
+
*/
|
|
182
|
+
set offset(value: string);
|
|
183
|
+
get offset(): string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A convenience property for getting the nearest containing timegroup of the media element.
|
|
187
|
+
*/
|
|
41
188
|
parentTimegroup?: EFTimegroup;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A convenience property for getting the root timegroup of the media element.
|
|
192
|
+
*/
|
|
42
193
|
rootTimegroup?: EFTimegroup;
|
|
43
194
|
|
|
44
195
|
frameTask: Task<readonly unknown[], unknown>;
|
|
@@ -151,6 +302,7 @@ export const EFTemporal = <T extends Constructor<LitElement>>(
|
|
|
151
302
|
);
|
|
152
303
|
}
|
|
153
304
|
}
|
|
305
|
+
|
|
154
306
|
get parentTimegroup() {
|
|
155
307
|
return this.#parentTimegroup;
|
|
156
308
|
}
|
|
@@ -340,6 +492,9 @@ export const EFTemporal = <T extends Constructor<LitElement>>(
|
|
|
340
492
|
return parent;
|
|
341
493
|
}
|
|
342
494
|
|
|
495
|
+
/**
|
|
496
|
+
* The start time of the element within its parent timegroup.
|
|
497
|
+
*/
|
|
343
498
|
get startTimeWithinParentMs() {
|
|
344
499
|
if (!this.parentTemporal) {
|
|
345
500
|
return 0;
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
render as litRender,
|
|
6
6
|
} from "lit";
|
|
7
7
|
import { assert, beforeEach, describe, test } from "vitest";
|
|
8
|
-
import { EFTimegroup } from "./EFTimegroup.
|
|
9
|
-
import "./EFTimegroup.
|
|
8
|
+
import { EFTimegroup } from "./EFTimegroup.js";
|
|
9
|
+
import "./EFTimegroup.js";
|
|
10
10
|
import { customElement } from "lit/decorators/custom-element.js";
|
|
11
|
-
import { ContextMixin } from "../gui/ContextMixin.
|
|
12
|
-
import { EFTemporal } from "./EFTemporal.
|
|
11
|
+
import { ContextMixin } from "../gui/ContextMixin.js";
|
|
12
|
+
import { EFTemporal } from "./EFTemporal.js";
|
|
13
13
|
// Need workbench to make workbench wrapping occurs
|
|
14
|
-
import "../gui/EFWorkbench.
|
|
14
|
+
import "../gui/EFWorkbench.js";
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
17
|
for (let i = 0; i < localStorage.length; i++) {
|