Closed JinGuiMin closed 4 months ago
怀疑是版本冲突,我用的是Angular7
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.
angular 15
"xgplayer": "^3.0.13",
"xgplayer-hls": "^3.0.13",
"xgplayer-hls.js": "^3.0.13",
xgplayer-hls 和 xgplayer-hls.js 项目启动都不行。
Error: node_modules/xgplayer-hls/es/hls/config.d.ts:33:13 - error TS2456: Type alias 'HlsOption' circularly references itself.
33 export type HlsOption = HlsOption;
~~~~~~~~~
Error: node_modules/xgplayer-hls/es/hls/index.d.ts:123:23 - error TS2503: Cannot find namespace 'NodeJS'.
123 _disconnectTimer: NodeJS.Timeout;
~~~~~~
Error: node_modules/xgplayer-hls/es/hls/manifest-loader/index.d.ts:4:13 - error TS2503: Cannot find namespace 'NodeJS'.
4 _timer: NodeJS.Timeout;
~~~~~~
Error: node_modules/xgplayer-streaming-shared/es/mse.d.ts:28:43 - error TS1016: A required parameter cannot follow an optional parameter.
28 constructor(media?: HTMLMediaElement, config: any);
~~~~~~
Error: node_modules/xgplayer-transmuxer/es/model/audio-sample.d.ts:7:67 - error TS1016: A required parameter cannot follow an optional parameter.
7 constructor(pts: number, data: Uint8Array, duration?: number, sampleOffset: any);
~~~~~~~~~~~~
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue has been automatically closed after a period of inactivity. If it is still present in the latest release, please create a new issue with up-to-date information. Thank you!
版本:3.0.9
我在Angular的ts文件中直接按照文档中的复制过去的。结果编译失败,一大堆报错。
关键代码如下: import Player from "xgplayer"; import "xgplayer/dist/index.min.css"; ngAfterViewInit(): void { this.instance = new Player ({ id: this.container.nativeElement, url: "https://www.runoob.com/try/demo_source/movie.mp4", height: "100%", width: "100%", }); } 报错如下