videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.15k stars 7.46k forks source link

Cannot use VideoJS 8.x with Angular #8324

Open ghost opened 1 year ago

ghost commented 1 year ago

Hello,

I'm trying to switch over to VideoJS 8.3 at my Angular application, but sadly I cannot load the player anymore:

import videojs from 'video.js';

-> This seems to be working.

This also does not work anymore:

public player!: videojs.Player;

Why can't I access the player anymore? This currently results in the following error:

TS2724: 'videojs' has no exported member named 'Player'. Did you mean 'players'?

renanrider commented 1 year ago

Same here

mg360 commented 1 year ago

Me too

nikhilbhalwankar commented 1 year ago

I was facing the same issue. However if you provide additional import as follows, it works

import Player from "video.js/dist/types/player";

MarcoSerrano1013 commented 4 months ago

Hello friends, I don't understand why the thumbs down to @nikhilbhalwankar , he is correct with: import Player from "video.js/dist/types/player";

Just missed commenting that the variable has to stop referencing from video.js, so it would be: public player!: Player;

Happy coding! 👻

senthils24 commented 2 weeks ago

Hi everyone ,After importing 'Player' also , Still facing the same issue.