Fix crashes when playing media on legacy OS

This commit is contained in:
Fedor Indutny 2021-12-11 00:27:42 +01:00 committed by GitHub
parent 2fe5ec6ab2
commit fed84be0b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 1 deletions

View file

@ -16,3 +16,16 @@ export const isWindows = (minVersion?: string): boolean => {
return is.undefined(minVersion) ? true : semver.gte(osRelease, minVersion);
};
export const isLegacy = (): boolean => {
if (process.platform === 'darwin') {
// 17.0.0 - is macOS 10.13
return semver.lt(os.release(), '17.0.0');
}
if (process.platform === 'win32') {
return semver.lt(os.release(), '9.0.0');
}
return false;
};