@hyperframes/producer 0.4.34 → 0.4.36

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/index.js CHANGED
@@ -109567,7 +109567,16 @@ async function resolveMediaDuration(src, mediaStart, baseDir, downloadDir, tagNa
109567
109567
  if (!existsSync15(filePath)) {
109568
109568
  return { duration: 0, resolvedPath: filePath };
109569
109569
  }
109570
- const metadata = tagName19 === "video" ? await extractMediaMetadata(filePath) : await extractAudioMetadata(filePath);
109570
+ let metadata;
109571
+ if (tagName19 === "video") {
109572
+ metadata = await extractMediaMetadata(filePath);
109573
+ } else {
109574
+ try {
109575
+ metadata = await extractAudioMetadata(filePath);
109576
+ } catch {
109577
+ return { duration: 0, resolvedPath: filePath };
109578
+ }
109579
+ }
109571
109580
  const fileDuration = metadata.durationSeconds;
109572
109581
  const effectiveDuration = fileDuration - mediaStart;
109573
109582
  const duration = effectiveDuration > 0 ? effectiveDuration : fileDuration;