Skip to content

Commit

Permalink
Merge branch 'master' of github.com:numberwolf/h265web.js
Browse files Browse the repository at this point in the history
  • Loading branch information
numberwolf committed Apr 17, 2022
2 parents 3bd3cd9 + bd4572a commit a95460a
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 147 deletions.
100 changes: 51 additions & 49 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,91 +1,93 @@
export interface ExtraConfig {
moovStartFlag?: boolean;
rawFps?: number;
autoCrop?: boolean;
core?: 0 | 1;
coreProbePart?: number;
ignoreAudio?: 0 | 1;
probeSize?: number;
moovStartFlag?: boolean
rawFps?: number
autoCrop?: boolean
core?: 0 | 1
coreProbePart?: number
ignoreAudio?: 0 | 1
probeSize?: number
}

export interface Web265JsConfig {
/**
*The type of the file to be played, do not fill in the automatic identification
*/
type?: "mp4" | "hls" | "ts" | "raw265" | "flv";
type?: 'mp4' | 'hls' | 'ts' | 'raw265' | 'flv'
/**
* playback window dom id value
*/
player: string;
player: string
/**
* the video window width size
*/
width: number;
width: number
/**
* the video window height size
*/
height: number;
height: number
/**
* player token value
*/
token: string;
extInfo?: ExtraConfig;
token: string
extInfo?: ExtraConfig
}

export interface Web265JsMediaInfo {
audioNone: boolean;
durationMs: number;
fps: number;
sampleRate: number;
audioNone: boolean
durationMs: number
fps: number
sampleRate: number
size: {
height: number;
width: number;
};
videoCodec: 0 | 1;
isHEVC: boolean;
videoType: Web265JsConfig["type"];
height: number
width: number
}
videoCodec: 0 | 1
isHEVC: boolean
videoType: Web265JsConfig['type']
}

interface New265WebJs {
onSeekFinish(): void;
onRender: (
onSeekFinish(): void
onRender(
width: number,
height: number,
imageBufferY: typeof Uint8Array,
imageBufferB: typeof Uint8Array,
imageBufferR: typeof Uint8Array
) => void;
onLoadFinish(): void;
onPlayTime(videoPTS: number): void;
onPlayFinish(): void;
onCacheProcess(cPts: number): void;
onReadyShowDone(): void;
onLoadCache(): void;
onLoadCacheFinshed(): void;
onOpenFullScreen(): void;
onCloseFullScreen(): void;
do(): void;
pause(): void;
isPlaying(): boolean;
setRenderScreen(state: boolean): void;
seek(pts: number): void;
setVoice(volume: number): void;
mediaInfo(): Web265JsMediaInfo;
fullScreen(): void;
closeFullScreen(): void;
release(): void;
): void
onLoadFinish(): void
onPlayTime(videoPTS: number): void
onPlayFinish(): void
onCacheProcess(cPts: number): void
onReadyShowDone(): void
onLoadCache(): void
onLoadCacheFinshed(): void
onOpenFullScreen(): void
onCloseFullScreen(): void
do(): void
pause(): void
isPlaying(): boolean
setRenderScreen(state: boolean): void
seek(pts: number): void
setVoice(volume: number): void
mediaInfo(): Web265JsMediaInfo
fullScreen(): void
closeFullScreen(): void
playNextFrame(): void
snapshot(): void
release(): void
}

declare type new265webJsFn = (
url: string,
config: Web265JsConfig
) => New265WebJs;
) => New265WebJs

interface Window {
new265webjs: new265webJsFn;
new265webjs: new265webJsFn
}

export default class H265webjsModule {
static createPlayer: (url: string, config: Web265JsConfig) => New265WebJs;
static clear(): void;
static createPlayer: (url: string, config: Web265JsConfig) => New265WebJs
static clear(): void
}
100 changes: 51 additions & 49 deletions example/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,91 +1,93 @@
export interface ExtraConfig {
moovStartFlag?: boolean;
rawFps?: number;
autoCrop?: boolean;
core?: 0 | 1;
coreProbePart?: number;
ignoreAudio?: 0 | 1;
probeSize?: number;
moovStartFlag?: boolean
rawFps?: number
autoCrop?: boolean
core?: 0 | 1
coreProbePart?: number
ignoreAudio?: 0 | 1
probeSize?: number
}

export interface Web265JsConfig {
/**
*The type of the file to be played, do not fill in the automatic identification
*/
type?: "mp4" | "hls" | "ts" | "raw265" | "flv";
type?: 'mp4' | 'hls' | 'ts' | 'raw265' | 'flv'
/**
* playback window dom id value
*/
player: string;
player: string
/**
* the video window width size
*/
width: number;
width: number
/**
* the video window height size
*/
height: number;
height: number
/**
* player token value
*/
token: string;
extInfo?: ExtraConfig;
token: string
extInfo?: ExtraConfig
}

export interface Web265JsMediaInfo {
audioNone: boolean;
durationMs: number;
fps: number;
sampleRate: number;
audioNone: boolean
durationMs: number
fps: number
sampleRate: number
size: {
height: number;
width: number;
};
videoCodec: 0 | 1;
isHEVC: boolean;
videoType: Web265JsConfig["type"];
height: number
width: number
}
videoCodec: 0 | 1
isHEVC: boolean
videoType: Web265JsConfig['type']
}

interface New265WebJs {
onSeekFinish(): void;
onRender: (
onSeekFinish(): void
onRender(
width: number,
height: number,
imageBufferY: typeof Uint8Array,
imageBufferB: typeof Uint8Array,
imageBufferR: typeof Uint8Array
) => void;
onLoadFinish(): void;
onPlayTime(videoPTS: number): void;
onPlayFinish(): void;
onCacheProcess(cPts: number): void;
onReadyShowDone(): void;
onLoadCache(): void;
onLoadCacheFinshed(): void;
onOpenFullScreen(): void;
onCloseFullScreen(): void;
do(): void;
pause(): void;
isPlaying(): boolean;
setRenderScreen(state: boolean): void;
seek(pts: number): void;
setVoice(volume: number): void;
mediaInfo(): Web265JsMediaInfo;
fullScreen(): void;
closeFullScreen(): void;
release(): void;
): void
onLoadFinish(): void
onPlayTime(videoPTS: number): void
onPlayFinish(): void
onCacheProcess(cPts: number): void
onReadyShowDone(): void
onLoadCache(): void
onLoadCacheFinshed(): void
onOpenFullScreen(): void
onCloseFullScreen(): void
do(): void
pause(): void
isPlaying(): boolean
setRenderScreen(state: boolean): void
seek(pts: number): void
setVoice(volume: number): void
mediaInfo(): Web265JsMediaInfo
fullScreen(): void
closeFullScreen(): void
playNextFrame(): void
snapshot(): void
release(): void
}

declare type new265webJsFn = (
url: string,
config: Web265JsConfig
) => New265WebJs;
) => New265WebJs

interface Window {
new265webjs: new265webJsFn;
new265webjs: new265webJsFn
}

export default class H265webjsModule {
static createPlayer: (url: string, config: Web265JsConfig) => New265WebJs;
static clear(): void;
static createPlayer: (url: string, config: Web265JsConfig) => New265WebJs
static clear(): void
}
Loading

0 comments on commit a95460a

Please sign in to comment.