init commit
This commit is contained in:
37
remotion/node_modules/@remotion/studio/dist/api/get-static-files.js
generated
vendored
Normal file
37
remotion/node_modules/@remotion/studio/dist/api/get-static-files.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStaticFiles = void 0;
|
||||
let warnedServer = false;
|
||||
let warnedPlayer = false;
|
||||
const warnServerOnce = () => {
|
||||
if (warnedServer) {
|
||||
return;
|
||||
}
|
||||
warnedServer = true;
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('Called getStaticFiles() on the server. The API is only available in the browser. An empty array was returned.');
|
||||
};
|
||||
const warnPlayerOnce = () => {
|
||||
if (warnedPlayer) {
|
||||
return;
|
||||
}
|
||||
warnedPlayer = true;
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.');
|
||||
};
|
||||
/*
|
||||
* @description Gets an array containing all files in the `public/` folder. You can reference them by using `staticFile()`.
|
||||
* @see [Documentation](https://www.remotion.dev/docs/studio/get-static-files)
|
||||
*/
|
||||
const getStaticFiles = () => {
|
||||
if (typeof document === 'undefined') {
|
||||
warnServerOnce();
|
||||
return [];
|
||||
}
|
||||
if (window.remotion_isPlayer) {
|
||||
warnPlayerOnce();
|
||||
return [];
|
||||
}
|
||||
return window.remotion_staticFiles;
|
||||
};
|
||||
exports.getStaticFiles = getStaticFiles;
|
||||
Reference in New Issue
Block a user