Open samueleastdev opened 5 years ago
Hi All,
I am trying to get this to work in a react project I have an example here.
https://github.com/samueleastdev/videojs-issue-28418
I am using the following code to import.
import * as React from 'react'; import videojs from 'video.js'; import 'video.js/dist/video-js.css'; import 'videojs-frames'; class App extends React.Component { private player?: videojs.Player; private videoNode?: HTMLVideoElement; constructor() { super({}); this.player = undefined; this.videoNode = undefined; } componentDidMount() { this.player = videojs(this.videoNode, { autoplay: false, controls: true, sources: [ { src: 'http://vjs.zencdn.net/v/oceans.mp4', type: 'video/mp4', }, ], }).ready(function onReady() { console.log('onPlayerReady', this); }); this.player.frames(); } // destroy player on unmount componentWillUnmount() { if (this.player) { this.player.dispose(); } } public render() { return ( <div className="App"> <div data-vjs-player> <video ref={(node: HTMLVideoElement) => (this.videoNode = node)} className="video-js" /> </div> </div> ); } } export default App;
I just get the error.
Property 'frames' does not exist on type 'VideoJsPlayer'.
Any suggestions
I don't think this.player.frames is a function
this.player.frames
This is a typescript issue. It doesn't like our plugin system and will complain about it.
Hi All,
I am trying to get this to work in a react project I have an example here.
https://github.com/samueleastdev/videojs-issue-28418
I am using the following code to import.
I just get the error.
Any suggestions