{"record":{"id":"7bc19266ac09254b","repo":"remotion-dev/remotion","slug":"you-cannot-call-getinputprops-from-a-player","errorCode":null,"errorMessage":"You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.","messagePattern":"You cannot call `getInputProps\\(\\)` from a <Player>\\. Instead, the props are available as React props from component that you passed as `component` prop\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/config/input-props.ts","lineNumber":32,"sourceCode":"\tconsole.warn(\n\t\t'Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.',\n\t);\n\t// eslint-disable-next-line no-console\n\tconsole.warn(\"To hide this warning, don't call this function on the server:\");\n\t// eslint-disable-next-line no-console\n\tconsole.warn(\"  typeof window === 'undefined' ? {} : getInputProps()\");\n};\n\nexport const getInputProps = <\n\tT extends Record<string, unknown> = Record<string, unknown>,\n>(): T => {\n\tif (typeof window === 'undefined') {\n\t\twarnOnceSSRImport();\n\t\treturn {} as T;\n\t}\n\n\tif (getRemotionEnvironment().isPlayer) {\n\t\tthrow new Error(\n\t\t\t'You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.',\n\t\t);\n\t}\n\n\tconst override = getInputPropsOverride();\n\tif (override) {\n\t\treturn override as T;\n\t}\n\n\tif (\n\t\ttypeof window === 'undefined' ||\n\t\ttypeof window.remotion_inputProps === 'undefined'\n\t) {\n\t\tthrow new Error(\n\t\t\t'Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.',\n\t\t);\n\t}\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/config/input-props.ts#L14-L50","documentation":"getInputProps() reads props injected by Remotion's runtime via window.remotion_inputProps, which only exists in Studio and server-side rendering. Inside a <Player>, input props are delivered as ordinary React props to the component passed to the component prop, so calling getInputProps() there is meaningless and is rejected to prevent confusion.","triggerScenarios":"Calling getInputProps() inside a component that is rendered by <Player component={...} />. Also triggered by a shared utility module used in both Studio and Player contexts.","commonSituations":"Reusing a composition component from a Studio/SSR setup directly inside a Player; copy-pasting a getInputProps() call from a template; helper hooks that call getInputProps unconditionally.","solutions":["In Player-hosted components, read props from the component's own props (function MyComp(props) { const {title} = props; }), not getInputProps().","Factor out getInputProps() calls so they only run in Studio/SSR builds.","Branch on environment if a shared hook must serve both contexts."],"exampleFix":"// before\nfunction MyVideo() {\n  const {title} = getInputProps(); // throws in Player\n  return <h1>{title}</h1>;\n}\n<Player component={MyVideo} inputProps={{title: 'Hi'}} />\n\n// after\nfunction MyVideo({title}: {title: string}) {\n  return <h1>{title}</h1>;\n}\n<Player component={MyVideo} inputProps={{title: 'Hi'}} />","handlingStrategy":"validation","validationCode":"import {getRemotionEnvironment} from 'remotion';\nif (!getRemotionEnvironment().isPlayer) {\n  const props = getInputProps();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never call getInputProps() inside a Player-rendered component.","Read input props from the component's own React props in Player contexts.","Factor shared logic so the getInputProps() call lives behind an environment check."],"tags":["player","props","validation","config","environment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}