WARNING: A work in progress, this is a first attempt at getting VideoJs working in a Typescript and React Enviroment.
This was inspired from the VideoJS React Tutorial - (see also Brightcover Player with React and Typescript)
Prerequistes Using TypeScript-React-Starter: https://github.com/Microsoft/TypeScript-React-Starter
Then npm install packages
npm i --save video.js
npm i --save-dev @types/video.js
Have any suggestions/improvements? Give me a shout in the comments :)
You can fix the issue by specifying the videoJsOptions prop as the second parameter of videojs() :
this.player = videojs(this.videoNode, this.props.videoJsOptions).ready(function() {
Also, on line 22 at VideojsReactTypescript.tsx there's going to be an issue when trying to pass the spread of videoJsOptions as the prop values, instead of referencing it as {...videoJsOptions} you can state it directly as an object like this:
<VideoPlayer videoJsOptions={videoJsOptions}/>
I know this thread is kinda old, but hope it helps anyone that stumbles upon this thread 🐳