Open
Description
Description
When installing vidoe.js via NPM and trying to include it in an Angular 15 application I get all kind of strange errors.
I assume the guide on https://videojs.com/guides/angular/ is outdated.
Also when trying to import the player like this: import Player from "video.js/dist/types/player";
The errors persist.
I also tried installing the video.js types. Unfortunately there are no types for v8 yet.
In anyway, it is not possible to install it via NPM into an Angular 15 application.
Error: node_modules/video.js/dist/types/component.d.ts:68:25 - error TS2304: Cannot find name 'Player'.
68 constructor(player: Player, options?: {
~~~~~~
Error: node_modules/video.js/dist/types/component.d.ts:71:8 - error TS1016: A required parameter cannot follow an optional parameter.
71 }, ready: any);
~~~~~
Error: node_modules/video.js/dist/types/component.d.ts:117:15 - error TS2304: Cannot find name 'Player'.
117 player(): Player;
~~~~~~
Error: node_modules/video.js/dist/types/event-target.d.ts:9:13 - error TS2395: Individual declarations in merged declaration 'EventTarget' must be all exported or all local.
9 export type EventTarget = () => any;
~~~~~~~~~~~
Error: node_modules/video.js/dist/types/event-target.d.ts:18:15 - error TS2395: Individual declarations in merged declaration 'EventTarget' must be all exported or all local.
18 declare class EventTarget {
~~~~~~~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:48:25 - error TS2304: Cannot find name 'Player'.
48 constructor(player: Player, options?: {
~~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:49:19 - error TS2304: Cannot find name 'Mixed'.
49 content?: Mixed;
~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:141:24 - error TS2304: Cannot find name 'Mixed'.
141 fillWith(content?: Mixed): void;
~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:164:21 - error TS2304: Cannot find name 'Mixed'.
164 content(value?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:164:29 - error TS2304: Cannot find name 'Mixed'.
164 content(value?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/modal-dialog.d.ts:165:15 - error TS2304: Cannot find name 'Mixed'.
165 content_: Mixed;
~~~~~
Error: node_modules/video.js/dist/types/player.d.ts:36:46 - error TS1016: A required parameter cannot follow an optional parameter.
36 constructor(tag: Element, options?: any, ready: any);
~~~~~
Error: node_modules/video.js/dist/types/player.d.ts:678:15 - error TS2552: Cannot find name 'TimeRange'. Did you mean 'TimeRanges'?
678 played(): TimeRange;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:14133:13
14133 declare var TimeRanges: {
~~~~~~~~~~
'TimeRanges' is declared here.
Error: node_modules/video.js/dist/types/player.d.ts:750:17 - error TS2552: Cannot find name 'TimeRange'. Did you mean 'TimeRanges'?
750 buffered(): TimeRange;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:14133:13
14133 declare var TimeRanges: {
~~~~~~~~~~
'TimeRanges' is declared here.
Error: node_modules/video.js/dist/types/player.d.ts:1359:64 - error TS2552: Cannot find name 'HtmlTrackElement'. Did you mean 'HTMLTrackElement'?
1359 addRemoteTextTrack(options: any, manualCleanup?: boolean): HtmlTrackElement;
~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:8344:13
8344 declare var HTMLTrackElement: {
~~~~~~~~~~~~~~~~
'HTMLTrackElement' is declared here.
Error: node_modules/video.js/dist/types/plugin.d.ts:5:13 - error TS2395: Individual declarations in merged declaration 'Plugin' must be all exported or all local.
5 export type Plugin = {
~~~~~~
Error: node_modules/video.js/dist/types/plugin.d.ts:35:15 - error TS2395: Individual declarations in merged declaration 'Plugin' must be all exported or all local.
35 declare class Plugin {
~~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:57:35 - error TS2304: Cannot find name 'Player'.
57 export function setSource(player: Player, src: any, next: any): void;
~~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:67:50 - error TS2304: Cannot find name 'Tech'.
67 export function setTech(middleware: any[], tech: Tech): void;
~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:84:46 - error TS2304: Cannot find name 'Tech'.
84 export function get(middleware: any[], tech: Tech, method: string): Mixed;
~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:84:69 - error TS2304: Cannot find name 'Mixed'.
84 export function get(middleware: any[], tech: Tech, method: string): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:104:46 - error TS2304: Cannot find name 'Tech'.
104 export function set(middleware: any[], tech: Tech, method: string, arg: Mixed): Mixed;
~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:104:73 - error TS2304: Cannot find name 'Mixed'.
104 export function set(middleware: any[], tech: Tech, method: string, arg: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:104:81 - error TS2304: Cannot find name 'Mixed'.
104 export function set(middleware: any[], tech: Tech, method: string, arg: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:128:50 - error TS2304: Cannot find name 'Tech'.
128 export function mediate(middleware: any[], tech: Tech, method: string, arg?: Mixed): Mixed;
~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:128:78 - error TS2304: Cannot find name 'Mixed'.
128 export function mediate(middleware: any[], tech: Tech, method: string, arg?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:128:86 - error TS2304: Cannot find name 'Mixed'.
128 export function mediate(middleware: any[], tech: Tech, method: string, arg?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:135:45 - error TS2304: Cannot find name 'Player'.
135 export function clearCacheForPlayer(player: Player): void;
~~~~~~
Error: node_modules/video.js/dist/types/tech/middleware.d.ts:170:42 - error TS2304: Cannot find name 'Player'.
170 export type MiddlewareFactory = (player: Player) => any;
~~~~~~
Error: node_modules/video.js/dist/types/tech/tech.d.ts:5:13 - error TS2395: Individual declarations in merged declaration 'Tech' must be all exported or all local.
5 export type Tech = any | string;
~~~~
Error: node_modules/video.js/dist/types/tech/tech.d.ts:12:15 - error TS2395: Individual declarations in merged declaration 'Tech' must be all exported or all local.
12 declare class Tech extends Component {
~~~~
Error: node_modules/video.js/dist/types/tech/tech.d.ts:127:17 - error TS2304: Cannot find name 'TimeRange'.
127 buffered(): TimeRange;
~~~~~~~~~
Error: node_modules/video.js/dist/types/tech/tech.d.ts:239:15 - error TS2304: Cannot find name 'TimeRange'.
239 played(): TimeRange;
~~~~~~~~~
Error: node_modules/video.js/dist/types/tech/tech.d.ts:485:26 - error TS2304: Cannot find name 'bolean'.
485 featuresMuteControl: bolean;
~~~~~~
Error: node_modules/video.js/dist/types/tracks/text-track.d.ts:8:15 - error TS2415: Class 'TextTrack' incorrectly extends base class 'Track'.
Property 'allowedEvents_' is private in type 'Track' but not in type 'TextTrack'.
8 declare class TextTrack extends Track {
~~~~~~~~~
Error: node_modules/video.js/dist/types/tracks/text-track.d.ts:44:15 - error TS2304: Cannot find name 'Tech'.
44 tech: Tech;
~~~~
Error: node_modules/video.js/dist/types/tracks/track-list.d.ts:8:15 - error TS2415: Class 'TrackList' incorrectly extends base class 'EventTarget'.
Types have separate declarations of a private property 'allowedEvents_'.
8 declare class TrackList extends EventTarget {
~~~~~~~~~
Error: node_modules/video.js/dist/types/tracks/track-list.d.ts:17:26 - error TS2304: Cannot find name 'Track'.
17 constructor(tracks?: Track[]);
~~~~~
Error: node_modules/video.js/dist/types/tracks/track-list.d.ts:27:21 - error TS2304: Cannot find name 'Track'.
27 addTrack(track: Track): void;
~~~~~
Error: node_modules/video.js/dist/types/tracks/track-list.d.ts:36:25 - error TS2304: Cannot find name 'Track'.
36 removeTrack(rtrack: Track): void;
~~~~~
Error: node_modules/video.js/dist/types/utils/dom.d.ts:17:29 - error TS2304: Cannot find name 'Mixed'.
17 export function isEl(value: Mixed): boolean;
~~~~~
Error: node_modules/video.js/dist/types/utils/dom.d.ts:44:80 - error TS1016: A required parameter cannot follow an optional parameter.
44 export function createEl(tagName?: string, properties?: any, attributes?: any, content: any): Element;
~~~~~~~
Error: node_modules/video.js/dist/types/utils/dom.d.ts:291:35 - error TS2304: Cannot find name 'Mixed'.
291 export function isTextNode(value: Mixed): boolean;
~~~~~
Error: node_modules/video.js/dist/types/utils/events.d.ts:40:68 - error TS1016: A required parameter cannot follow an optional parameter.
40 export function off(elem: Element | any, type?: string | string[], fn: any): void;
~~
Error: node_modules/video.js/dist/types/utils/fn.d.ts:2:32 - error TS2304: Cannot find name 'Mixed'.
2 export function bind_(context: Mixed, fn: Function, uid?: number): Function;
~~~~~
Error: node_modules/video.js/dist/types/utils/log.d.ts:3:15 - error TS2304: Cannot find name 'Mixed'.
3 (...args: Mixed[]): void;
~~~~~
Error: node_modules/video.js/dist/types/utils/log.d.ts:14:20 - error TS2304: Cannot find name 'Mixed'.
14 error(...args: Mixed[]): any;
~~~~~
Error: node_modules/video.js/dist/types/utils/log.d.ts:15:19 - error TS2304: Cannot find name 'Mixed'.
15 warn(...args: Mixed[]): any;
~~~~~
Error: node_modules/video.js/dist/types/utils/log.d.ts:16:20 - error TS2304: Cannot find name 'Mixed'.
16 debug(...args: Mixed[]): any;
~~~~~
Error: node_modules/video.js/dist/types/utils/obj.d.ts:28:61 - error TS2304: Cannot find name 'Mixed'.
28 export function reduce(object: any, fn: Function, initial?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/utils/obj.d.ts:28:69 - error TS2304: Cannot find name 'Mixed'.
28 export function reduce(object: any, fn: Function, initial?: Mixed): Mixed;
~~~~~
Error: node_modules/video.js/dist/types/utils/obj.d.ts:78:27 - error TS2304: Cannot find name 'Mixed'.
78 export type obj = (value: Mixed, key: string) => any;
~~~~~
Error: node_modules/video.js/dist/types/video.d.ts:88:14 - error TS2304: Cannot find name 'version'.
88 export { version as VERSION };
~~~~~~~
✖ Failed to compile.
Reduced test case
No response
Steps to reproduce
- Create angular application
- npm i --save-dev video.js
- Add video.js according to the guide (https://videojs.com/guides/angular/)
Errors
No response
What version of Video.js are you using?
8.0.4
Video.js plugins used.
None