{"version":3,"file":"ReactPlayerWrapper.mjs","names":[],"sources":["../../../../src/components/VideoPlayer/ReactPlayerWrapper.tsx"],"sourcesContent":["import ReactPlayerImport from 'react-player';\n\nimport type { VideoPlayerProps } from './VideoPlayer';\n\n// react-player is CJS with the component on `exports.default`. Some interop setups (e.g. Vite\n// serving the built ESM as a linked workspace dependency) hand back the namespace `{ default }`,\n// which makes React throw \"Element type is invalid\". Unwrap `default` when present.\nconst ReactPlayer =\n  (ReactPlayerImport as unknown as { default?: typeof ReactPlayerImport }).default ??\n  ReactPlayerImport;\n\n/**\n * Default export so `VideoPlayer` can load it with `React.lazy`, keeping `react-player` (~2 MB)\n * out of the SDK's eager import graph until a default video player renders.\n */\nconst ReactPlayerWrapper = ({\n  controls = true,\n  isPlaying,\n  thumbnailUrl,\n  videoUrl,\n}: VideoPlayerProps) => (\n  <ReactPlayer\n    className='react-player'\n    config={{ file: { attributes: { poster: thumbnailUrl } } }}\n    controls={controls}\n    height='100%'\n    playing={isPlaying}\n    url={videoUrl}\n    width='100%'\n  />\n);\n\nexport default ReactPlayerWrapper;\n"],"mappings":";;;AAOA,IAAM,cACH,kBAAwE,WACzE;;;;;AAMF,IAAM,sBAAsB,EAC1B,WAAW,MACX,WACA,cACA,eAEA,oBAAC,aAAD;CACE,WAAU;CACV,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,aAAa,EAAE,EAAE;CAC/C;CACV,QAAO;CACP,SAAS;CACT,KAAK;CACL,OAAM;AACP,CAAA"}