Skip to content

🎥 Make videos programmatically with React

Merge branch 'pretty-print-browser-logs' into v4

Jonny Burgereb0c8a91a22f
diff --cc packages/example/src/Video.tsx
index 5fb50488c6,4ccdf2a726..f8345d259e
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@@ -67,6 -67,65 +67,65 @@@ export const Index: React.FC = () =>
const calculateMetadata: CalculateMetadataFunction<
z.infer<typeof dynamicDurationSchema>
> = useCallback(async ({props}) => {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const shouldLog = (..._data: unknown[]) => undefined;
+ // To test logging
+ // const shouldLog = console.log;
+
+ const foo = function* () {
+ yield 'a';
+ yield 'b';
+ yield 'c';
+ };
+ shouldLog('');
+ shouldLog('');
+ shouldLog('');
+ shouldLog('');
+
+ shouldLog('objects', {a: 'string'});
+ shouldLog('boolean:', false);
+ shouldLog('number:', 1);
+ shouldLog('symbol', Symbol('hi'));
+ shouldLog('Date:', new Date());
+ shouldLog('bigint:', BigInt(123));
+ shouldLog('function:', () => 'hi');
+ shouldLog('array:', [1, 2, 3]);
+ shouldLog('regex:', /abc/);
+ shouldLog('');
+ shouldLog('');
+ shouldLog('');
+ shouldLog('');
+ shouldLog('Hello World ArrayBuffer', new ArrayBuffer(1));
+ shouldLog('Hello World DataView', new DataView(new ArrayBuffer(1)));
+ shouldLog('Hello World Error', new Error('hithere'));
+ shouldLog('Hello World Generator', foo());
+ shouldLog('Hello World Iterator', [1, 2, 3].values());
+ const map = new Map();
+ map.set('a', 1);
+ shouldLog('Hello World Map', map);
+ shouldLog('Hello World Node', document.createElement('div'));
+ shouldLog('Hello World null', null);
+ shouldLog(
+ 'Hello World Promise',
- new Promise((resolve) => {
++ new Promise<void>((resolve) => {
+ resolve();
+ })
+ );
+ shouldLog('Hello World Proxy', new Proxy(document, {}));
+ shouldLog('Hello World RegExp', /abc/);
+ shouldLog('Hello World Set', {a: [1, 2, 3]});
+ shouldLog('Hello World TypedArray', new Uint8Array([1, 2, 3]));
+ const wm3 = new WeakMap();
+ const o1 = {};
+ wm3.set(o1, 'azerty');
+ const ws = new WeakSet();
+ const foo2 = {};
+
+ ws.add(foo2);
+
+ console.log('Hello World WeakMap', wm3);
+ console.log('Hello World WeakSet', ws);
+
await new Promise((r) => {
setTimeout(r, 1000);
});