Skip to content

Commit

Permalink
Merge branch 'numberwolf:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
girlbymirror authored Oct 23, 2022
2 parents 0ea9fb1 + dd7b5d9 commit 7b1aeab
Show file tree
Hide file tree
Showing 37 changed files with 67,293 additions and 0 deletions.
16 changes: 16 additions & 0 deletions example_vue2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>

<body>
<div id="app"></div>
<script src="/dist/missile.js"></script>
<script src="/dist/h265webjs-v20220916.js"></script>
<script type="module" src="./src/main.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions example_vue2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "example_vue2",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "vite"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vite": "^3.1.3",
"vite-plugin-vue2": "^2.0.2",
"vue": "^2.6.14"
},
"dependencies": {
"vue-template-compiler": "2.6.14"
}
}
Binary file added example_vue2/public/dist/assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example_vue2/public/dist/assets/demo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example_vue2/public/dist/assets/demo4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example_vue2/public/dist/assets/icon-loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example_vue2/public/dist/demo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 168 additions & 0 deletions example_vue2/public/dist/h265webjs-v20220916.js

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions example_vue2/public/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export interface Web265JsExtraConfig {
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'
/**
* playback window dom id value
*/
player: string
/**
* the video window width size
*/
width: number
/**
* the video window height size
*/
height: number
/**
* player token value
*/
token: string
extInfo?: Web265JsExtraConfig
}

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

interface New265WebJs {
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
playNextFrame(): void
snapshot(): void
release(): void
setPlaybackRate(rate: number): void
getPlaybackRate(): number
}

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

declare global {
interface Window {
new265webjs: new265webJsFn
}
}

export default class H265webjsModule {
static createPlayer: (url: string, config: Web265JsConfig) => New265WebJs
static clear(): void
}
32 changes: 32 additions & 0 deletions example_vue2/public/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*********************************************************
* LICENSE: LICENSE-Free_CN.MD
*
* Author: Numberwolf - ChangYanlong
* QQ: 531365872
* QQ Group:925466059
* Wechat: numberwolf11
* Discord: numberwolf#8694
* E-Mail: [email protected]
* Github: https://github.com/numberwolf/h265web.js
*
* 作者: 小老虎(Numberwolf)(常炎隆)
* QQ: 531365872
* QQ群: 531365872
* 微信: numberwolf11
* Discord: numberwolf#8694
* 邮箱: [email protected]
* 博客: https://www.jianshu.com/u/9c09c1e00fd1
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20220916');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
}

static clear() {
global.STATICE_MEM_playerCount = -1;
global.STATICE_MEM_playerIndexPtr = 0;
}
}
Loading

0 comments on commit 7b1aeab

Please sign in to comment.