2022-11-26 05:56:33 +08:00
|
|
|
import {ClientClass} from './config/public/Config';
|
|
|
|
|
|
|
|
let Config: ClientClass;
|
|
|
|
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
Config = require('./config/public/Config').Config;
|
|
|
|
} else {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
Config = require('./config/private/Config').Config;
|
|
|
|
}
|
|
|
|
|
2019-12-10 00:19:28 +08:00
|
|
|
export const SupportedFormats = {
|
2022-12-29 02:12:18 +08:00
|
|
|
Photos: Config.Media.Photo.supportedFormats,
|
2019-12-11 17:39:39 +08:00
|
|
|
// Browser supported video formats
|
|
|
|
// Read more: https://www.w3schools.com/html/html5_video.asp
|
2022-12-29 02:12:18 +08:00
|
|
|
Videos: Config.Media.Video.supportedFormats,
|
|
|
|
MetaFiles: Config.MetaFile.supportedFormats,
|
2019-12-11 17:39:39 +08:00
|
|
|
// These formats need to be transcoded (with the build-in ffmpeg support)
|
2019-12-10 16:36:14 +08:00
|
|
|
TranscodeNeed: {
|
2019-12-14 17:16:17 +08:00
|
|
|
// based on libvips, all supported formats for sharp: https://github.com/libvips/libvips
|
2021-04-18 21:48:35 +08:00
|
|
|
Photos: [] as string[],
|
2022-12-29 02:12:18 +08:00
|
|
|
Videos: Config.Media.Video.supportedFormatsWithTranscoding,
|
2019-12-10 16:36:14 +08:00
|
|
|
},
|
2021-05-30 05:27:52 +08:00
|
|
|
// --------------------------------------------
|
|
|
|
// Below this, it is autogenerated, DO NOT EDIT
|
2019-12-10 00:19:28 +08:00
|
|
|
WithDots: {
|
2021-04-18 21:48:35 +08:00
|
|
|
Photos: [] as string[],
|
|
|
|
Videos: [] as string[],
|
|
|
|
MetaFiles: [] as string[],
|
2019-12-10 19:50:02 +08:00
|
|
|
TranscodeNeed: {
|
2021-04-18 21:48:35 +08:00
|
|
|
Photos: [] as string[],
|
|
|
|
Videos: [] as string[],
|
2022-04-05 01:37:31 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-10 00:19:28 +08:00
|
|
|
};
|
2019-12-10 19:50:02 +08:00
|
|
|
|
2022-04-05 01:37:31 +08:00
|
|
|
SupportedFormats.Photos = SupportedFormats.Photos.concat(
|
2023-09-12 00:57:51 +08:00
|
|
|
SupportedFormats.TranscodeNeed.Photos
|
2022-04-05 01:37:31 +08:00
|
|
|
);
|
|
|
|
SupportedFormats.Videos = SupportedFormats.Videos.concat(
|
2023-09-12 00:57:51 +08:00
|
|
|
SupportedFormats.TranscodeNeed.Videos
|
2022-04-05 01:37:31 +08:00
|
|
|
);
|
|
|
|
SupportedFormats.WithDots.Photos = SupportedFormats.Photos.map((f) => '.' + f);
|
|
|
|
SupportedFormats.WithDots.Videos = SupportedFormats.Videos.map((f) => '.' + f);
|
|
|
|
SupportedFormats.WithDots.MetaFiles = SupportedFormats.MetaFiles.map(
|
2023-09-12 00:57:51 +08:00
|
|
|
(f) => '.' + f
|
2022-04-05 01:37:31 +08:00
|
|
|
);
|
|
|
|
SupportedFormats.WithDots.TranscodeNeed.Photos =
|
2023-09-12 00:57:51 +08:00
|
|
|
SupportedFormats.TranscodeNeed.Photos.map((f) => '.' + f);
|
2022-04-05 01:37:31 +08:00
|
|
|
SupportedFormats.WithDots.TranscodeNeed.Videos =
|
2023-09-12 00:57:51 +08:00
|
|
|
SupportedFormats.TranscodeNeed.Videos.map((f) => '.' + f);
|
2019-12-10 00:19:28 +08:00
|
|
|
|