Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'frames' does not exist on type 'VideoJsPlayer'. #296

Open
samueleastdev opened this issue Aug 29, 2019 · 2 comments
Open

Property 'frames' does not exist on type 'VideoJsPlayer'. #296

samueleastdev opened this issue Aug 29, 2019 · 2 comments

Comments

@samueleastdev
Copy link

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

@brandonocasey
Copy link
Contributor

I don't think this.player.frames is a function

@gkatsev
Copy link
Member

gkatsev commented Aug 29, 2019

This is a typescript issue. It doesn't like our plugin system and will complain about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants