23 lines
876 B
JavaScript
23 lines
876 B
JavaScript
import { registerUsageEvent } from '@remotion/licensing';
|
|
import { Internals } from 'remotion';
|
|
export const sendUsageEvent = async ({ licenseKey, succeeded, apiName, }) => {
|
|
var _a;
|
|
const host = typeof window === 'undefined'
|
|
? null
|
|
: typeof window.location === 'undefined'
|
|
? null
|
|
: ((_a = window.location.origin) !== null && _a !== void 0 ? _a : null);
|
|
if (host === null) {
|
|
return;
|
|
}
|
|
if (licenseKey === null) {
|
|
Internals.Log.warn({ logLevel: 'warn', tag: 'web-renderer' }, `Pass "licenseKey" to ${apiName}(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.`);
|
|
}
|
|
await registerUsageEvent({
|
|
licenseKey: licenseKey === 'free-license' ? null : licenseKey,
|
|
event: 'webcodec-conversion',
|
|
host,
|
|
succeeded,
|
|
});
|
|
};
|