bytedance / xgplayer

A HTML5 video player with a parser that saves traffic
https://h5player.bytedance.com/
MIT License
8.32k stars 867 forks source link

3.0.9最新版本为什么一大堆报错啊? #1136

Closed JinGuiMin closed 4 months ago

JinGuiMin commented 1 year ago

版本: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%", }); } 报错如下

image

JinGuiMin commented 1 year ago

怀疑是版本冲突,我用的是Angular7

github-actions[bot] commented 9 months ago

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.

sdandroid commented 8 months ago

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);
                                                                    ~~~~~~~~~~~~
github-actions[bot] commented 5 months ago

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.

github-actions[bot] commented 4 months ago

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!