@livedesk/client 0.1.67 → 0.1.69

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.
@@ -2491,15 +2491,27 @@ function resolveBundledFfmpegPaths() {
2491
2491
  }
2492
2492
  };
2493
2493
 
2494
- try {
2495
- const ffmpeg = require('@ffmpeg-installer/ffmpeg');
2496
- addPath(ffmpeg?.path);
2497
- } catch {
2498
- }
2494
+ const addFfmpegInstaller = () => {
2495
+ try {
2496
+ const ffmpeg = require('@ffmpeg-installer/ffmpeg');
2497
+ addPath(ffmpeg?.path);
2498
+ } catch {
2499
+ }
2500
+ };
2499
2501
 
2500
- try {
2501
- addPath(require('ffmpeg-static'));
2502
- } catch {
2502
+ const addFfmpegStatic = () => {
2503
+ try {
2504
+ addPath(require('ffmpeg-static'));
2505
+ } catch {
2506
+ }
2507
+ };
2508
+
2509
+ if (process.platform === 'darwin') {
2510
+ addFfmpegStatic();
2511
+ addFfmpegInstaller();
2512
+ } else {
2513
+ addFfmpegInstaller();
2514
+ addFfmpegStatic();
2503
2515
  }
2504
2516
 
2505
2517
  return paths;
@@ -2508,20 +2520,46 @@ function resolveBundledFfmpegPaths() {
2508
2520
  function buildFastEnvironment() {
2509
2521
  const env = { ...process.env };
2510
2522
  const bundledFfmpegPaths = resolveBundledFfmpegPaths();
2511
- if (!env.LIVEDESK_FFMPEG && bundledFfmpegPaths[0]) {
2512
- env.LIVEDESK_FFMPEG = bundledFfmpegPaths[0];
2513
- }
2514
- if (!env.LIVEDESK_FFMPEG_PATHS && bundledFfmpegPaths.length > 0) {
2515
- env.LIVEDESK_FFMPEG_PATHS = bundledFfmpegPaths.join(process.platform === 'win32' ? ';' : ':');
2516
- } else if (env.LIVEDESK_FFMPEG && !env.LIVEDESK_FFMPEG_PATHS) {
2517
- env.LIVEDESK_FFMPEG_PATHS = env.LIVEDESK_FFMPEG;
2518
- } else if (env.LIVEDESK_FFMPEG_PATHS && env.LIVEDESK_FFMPEG) {
2519
- const separator = process.platform === 'win32' ? ';' : ':';
2520
- const paths = env.LIVEDESK_FFMPEG_PATHS.split(separator).filter(Boolean);
2521
- if (!paths.includes(env.LIVEDESK_FFMPEG)) {
2522
- paths.unshift(env.LIVEDESK_FFMPEG);
2523
- 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);
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];
2524
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'}`);
2525
2563
  }
2526
2564
  return env;
2527
2565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {