@livedesk/client 0.1.43 → 0.1.45

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.
@@ -781,30 +781,45 @@ function hasFastDll(runtime) {
781
781
  return !!runtime?.dll && existsSync(runtime.dll);
782
782
  }
783
783
 
784
- function resolveBundledFfmpegPath() {
785
- try {
786
- const ffmpegPath = String(require('ffmpeg-static') || '').trim();
787
- if (ffmpegPath && existsSync(ffmpegPath)) {
788
- return ffmpegPath;
784
+ function resolveBundledFfmpegPaths() {
785
+ const paths = [];
786
+ const addPath = (candidate) => {
787
+ const ffmpegPath = String(candidate || '').trim();
788
+ if (ffmpegPath && existsSync(ffmpegPath) && !paths.includes(ffmpegPath)) {
789
+ paths.push(ffmpegPath);
789
790
  }
791
+ };
792
+
793
+ try {
794
+ const ffmpeg = require('@ffmpeg-installer/ffmpeg');
795
+ addPath(ffmpeg?.path);
790
796
  } catch {
791
797
  }
792
798
 
793
799
  try {
794
- const ffmpeg = require('@ffmpeg-installer/ffmpeg');
795
- const ffmpegPath = String(ffmpeg?.path || '').trim();
796
- return ffmpegPath && existsSync(ffmpegPath) ? ffmpegPath : '';
800
+ addPath(require('ffmpeg-static'));
797
801
  } catch {
798
- return '';
799
802
  }
803
+
804
+ return paths;
800
805
  }
801
806
 
802
807
  function buildFastEnvironment() {
803
808
  const env = { ...process.env };
804
- if (!env.LIVEDESK_FFMPEG) {
805
- const bundledFfmpegPath = resolveBundledFfmpegPath();
806
- if (bundledFfmpegPath) {
807
- env.LIVEDESK_FFMPEG = bundledFfmpegPath;
809
+ const bundledFfmpegPaths = resolveBundledFfmpegPaths();
810
+ if (!env.LIVEDESK_FFMPEG && bundledFfmpegPaths[0]) {
811
+ env.LIVEDESK_FFMPEG = bundledFfmpegPaths[0];
812
+ }
813
+ if (!env.LIVEDESK_FFMPEG_PATHS && bundledFfmpegPaths.length > 0) {
814
+ env.LIVEDESK_FFMPEG_PATHS = bundledFfmpegPaths.join(process.platform === 'win32' ? ';' : ':');
815
+ } else if (env.LIVEDESK_FFMPEG && !env.LIVEDESK_FFMPEG_PATHS) {
816
+ env.LIVEDESK_FFMPEG_PATHS = env.LIVEDESK_FFMPEG;
817
+ } else if (env.LIVEDESK_FFMPEG_PATHS && env.LIVEDESK_FFMPEG) {
818
+ const separator = process.platform === 'win32' ? ';' : ':';
819
+ const paths = env.LIVEDESK_FFMPEG_PATHS.split(separator).filter(Boolean);
820
+ if (!paths.includes(env.LIVEDESK_FFMPEG)) {
821
+ paths.unshift(env.LIVEDESK_FFMPEG);
822
+ env.LIVEDESK_FFMPEG_PATHS = paths.join(separator);
808
823
  }
809
824
  }
810
825
  return env;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {