@livedesk/client 0.1.68 → 0.1.70

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.
@@ -2520,20 +2520,46 @@ function resolveBundledFfmpegPaths() {
2520
2520
  function buildFastEnvironment() {
2521
2521
  const env = { ...process.env };
2522
2522
  const bundledFfmpegPaths = resolveBundledFfmpegPaths();
2523
- if (!env.LIVEDESK_FFMPEG && bundledFfmpegPaths[0]) {
2524
- env.LIVEDESK_FFMPEG = bundledFfmpegPaths[0];
2525
- }
2526
- if (!env.LIVEDESK_FFMPEG_PATHS && bundledFfmpegPaths.length > 0) {
2527
- env.LIVEDESK_FFMPEG_PATHS = bundledFfmpegPaths.join(process.platform === 'win32' ? ';' : ':');
2528
- } else if (env.LIVEDESK_FFMPEG && !env.LIVEDESK_FFMPEG_PATHS) {
2529
- env.LIVEDESK_FFMPEG_PATHS = env.LIVEDESK_FFMPEG;
2530
- } else if (env.LIVEDESK_FFMPEG_PATHS && env.LIVEDESK_FFMPEG) {
2531
- const separator = process.platform === 'win32' ? ';' : ':';
2532
- const paths = env.LIVEDESK_FFMPEG_PATHS.split(separator).filter(Boolean);
2533
- if (!paths.includes(env.LIVEDESK_FFMPEG)) {
2534
- paths.unshift(env.LIVEDESK_FFMPEG);
2535
- env.LIVEDESK_FFMPEG_PATHS = paths.join(separator);
2523
+ const separator = process.platform === 'win32' ? ';' : ':';
2524
+ const configuredPaths = env.LIVEDESK_FFMPEG_PATHS
2525
+ ? env.LIVEDESK_FFMPEG_PATHS.split(separator).filter(Boolean)
2526
+ : [];
2527
+ const configuredSingle = env.LIVEDESK_FFMPEG ? [env.LIVEDESK_FFMPEG] : [];
2528
+ const merged = [];
2529
+ const addMerged = path => {
2530
+ const value = String(path || '').trim();
2531
+ if (value && !merged.includes(value)) {
2532
+ merged.push(value);
2536
2533
  }
2534
+ };
2535
+
2536
+ if (process.platform === 'darwin') {
2537
+ bundledFfmpegPaths.forEach(addMerged);
2538
+ configuredPaths.forEach(addMerged);
2539
+ configuredSingle.forEach(addMerged);
2540
+ if (bundledFfmpegPaths[0]) {
2541
+ env.LIVEDESK_FFMPEG = bundledFfmpegPaths[0];
2542
+ }
2543
+ } else {
2544
+ configuredPaths.forEach(addMerged);
2545
+ configuredSingle.forEach(addMerged);
2546
+ bundledFfmpegPaths.forEach(addMerged);
2547
+ if (!env.LIVEDESK_FFMPEG && merged[0]) {
2548
+ env.LIVEDESK_FFMPEG = merged[0];
2549
+ }
2550
+ }
2551
+
2552
+ if (merged.length > 0) {
2553
+ env.LIVEDESK_FFMPEG_PATHS = merged.join(separator);
2554
+ }
2555
+
2556
+ if (process.platform === 'darwin' || env.LIVEDESK_DEBUG_FFMPEG === '1') {
2557
+ const describe = path => path.includes('ffmpeg-static')
2558
+ ? 'ffmpeg-static'
2559
+ : path.includes('@ffmpeg-installer')
2560
+ ? '@ffmpeg-installer/ffmpeg'
2561
+ : path;
2562
+ console.error(`LiveDesk client ${readPackageVersion()} ffmpeg candidates: ${merged.map(describe).join(', ') || 'none'}`);
2537
2563
  }
2538
2564
  return env;
2539
2565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {