remotion
Version:
Make videos programmatically
34 lines (33 loc) • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRemotionEnvironment = void 0;
// Avoid VITE obfuscation
function getNodeEnvString() {
return ['NOD', 'E_EN', 'V'].join('');
}
const getEnvString = () => {
return ['e', 'nv'].join('');
};
/*
* @description Provides information about the Remotion Environment
* @see [Documentation](https://remotion.dev/docs/get-remotion-environment)
*/
const getRemotionEnvironment = () => {
const isPlayer = typeof window !== 'undefined' && window.remotion_isPlayer;
const isRendering = typeof window !== 'undefined' &&
typeof window.process !== 'undefined' &&
typeof window.process.env !== 'undefined' &&
(window.process[getEnvString()][getNodeEnvString()] === 'test' ||
(window.process[getEnvString()][getNodeEnvString()] === 'production' &&
typeof window !== 'undefined' &&
typeof window.remotion_puppeteerTimeout !== 'undefined'));
const isStudio = typeof window !== 'undefined' && window.remotion_isStudio;
const isReadOnlyStudio = typeof window !== 'undefined' && window.remotion_isReadOnlyStudio;
return {
isStudio,
isRendering,
isPlayer,
isReadOnlyStudio,
};
};
exports.getRemotionEnvironment = getRemotionEnvironment;