@editframe/elements 0.11.0-beta.5 → 0.11.0-beta.7

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.
@@ -310,8 +310,14 @@ class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
310
310
  }
311
311
  #audioContext;
312
312
  async fetchAudioSpanningTime(fromMs, toMs) {
313
- fromMs -= this.startTimeMs - this.trimStartMs - this.sourceInMs;
314
- toMs -= this.startTimeMs - this.trimStartMs - this.sourceOutMs;
313
+ if (this.sourceInMs) {
314
+ fromMs -= this.startTimeMs - this.trimStartMs - this.sourceInMs;
315
+ }
316
+ if (this.sourceOutMs) {
317
+ toMs -= this.startTimeMs - this.trimStartMs - this.sourceOutMs;
318
+ }
319
+ fromMs -= this.startTimeMs - this.trimStartMs;
320
+ toMs -= this.startTimeMs - this.trimStartMs;
315
321
  await this.trackFragmentIndexLoader.taskComplete;
316
322
  const audioTrackId = this.defaultAudioTrackId;
317
323
  if (!audioTrackId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.11.0-beta.5",
3
+ "version": "0.11.0-beta.7",
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.11.0-beta.5",
23
+ "@editframe/assets": "0.11.0-beta.7",
24
24
  "@lit/context": "^1.1.2",
25
25
  "@lit/task": "^1.0.1",
26
26
  "d3": "^7.9.0",
@@ -394,8 +394,14 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
394
394
 
395
395
  async fetchAudioSpanningTime(fromMs: number, toMs: number) {
396
396
  // Adjust range for track's own time
397
- fromMs -= this.startTimeMs - this.trimStartMs - this.sourceInMs;
398
- toMs -= this.startTimeMs - this.trimStartMs - this.sourceOutMs;
397
+ if (this.sourceInMs) {
398
+ fromMs -= this.startTimeMs - this.trimStartMs - this.sourceInMs;
399
+ }
400
+ if (this.sourceOutMs) {
401
+ toMs -= this.startTimeMs - this.trimStartMs - this.sourceOutMs;
402
+ }
403
+ fromMs -= this.startTimeMs - this.trimStartMs;
404
+ toMs -= this.startTimeMs - this.trimStartMs;
399
405
 
400
406
  await this.trackFragmentIndexLoader.taskComplete;
401
407
  const audioTrackId = this.defaultAudioTrackId;
@@ -403,6 +409,7 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
403
409
  log("No audio track found");
404
410
  return;
405
411
  }
412
+
406
413
  const audioTrackIndex = this.trackFragmentIndexLoader.value?.[audioTrackId];
407
414
  if (!audioTrackIndex) {
408
415
  log("No audio track found");