flowplayer / react-flowplayer

Flowplayer React Component
MIT License
2 stars 3 forks source link

Cannot use import statement outside a module #27

Closed sgarchavada closed 2 years ago

sgarchavada commented 2 years ago

I just try to implement this in my Next.js project. Follow the basic steps from documentation, and its crashing

import Flowplayer from "@flowplayer/react-flowplayer"
import "@flowplayer/player/flowplayer.css"

export const FlowVideoPlayer = ({src}) => {
   return (
     <Flowplayer token="my-token" src={src} />
   )
 }
nnarhinen commented 2 years ago

Hello!

You need to use a transpiler and/or bundler like Webpack + Babel to compile the JSX syntax and imports to plain javascript usable outside of modules.