video.js icon indicating copy to clipboard operation
video.js copied to clipboard

Cannot use VideoJS 8.x with Angular

Open ghost opened this issue 2 years ago • 6 comments
trafficstars

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'?

ghost avatar Jun 17 '23 09:06 ghost

Same here

renanrider avatar Jun 26 '23 14:06 renanrider

Me too

mg360 avatar Aug 10 '23 19:08 mg360

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

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

nikhilbhalwankar avatar Nov 13 '23 10:11 nikhilbhalwankar

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! 👻

MarcoSerrano1013 avatar Jul 23 '24 05:07 MarcoSerrano1013