diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4435cd0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 + +indent_style = space +indent_size = 2 +tab_width = 2 + +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff843d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +ssh +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +/public/assets/ai +/public/assets/ffmpeg diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..d48336a --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,27 @@ +module.exports = { + // parser: 'babel', + arrowParens: 'avoid', // 箭头函数参数括号 默认avoid 可选 avoid| always + bracketSpacing: true, // 对象中打印空格 默认true + insertPragma: false, + printWidth: 120, // 换行长度 + proseWrap: 'always', + requirePragma: false, + singleQuote: true, // 字符串使用单引号 + semi: true, // 每行末尾自动添加分号 + tabWidth: 2, // tab缩进大小,默认为2 + // htmlWhitespaceSensitivity: 'ignore', //对HTML全局空白不敏感 + // jsxSingleQuote: true, // jsx中使用单引号 + // jsxBracketSameLine: true, //多属性html标签的‘>’折行放置 + trailingComma: 'all', + embeddedLanguageFormatting: 'auto', //对引用代码进行格式化 + useTabs: false, // 使用tab缩进,默认false + overrides: [ + { + files: '*.json', + options: { + tabWidth: 2, + singleQuote: false, + }, + }, + ], +}; diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c23d73e --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Unicut is licensed under a modified version of the Apache License 2.0, with the following additional conditions: +1. Unicut may be utilized commercially, including as a backend service for video editing applications or as a video development platform for enterprises. Should the conditions below be met, a commercial license must be obtained from the producer: +a. Multi-tenant service: Unless explicitly authorized by Unicut in writing, you may not use the Unicut source code to operate a multi-tenant environment. +- Tenant Definition: Within the context of Unicut, one tenant corresponds to one workspace. The workspace provides a separated area for each tenant's data and configurations. +b. LOGO and copyright information: In the process of using Unicut's frontend, you may not remove or modify the LOGO or copyright information in the Unicut console or applications. This restriction is inapplicable to uses of Unicut that do not involve its frontend. +- Frontend Definition: For the purposes of this license, the "frontend" of Unicut includes all components located in the src/ directory when running Unicut from the raw source code, or the "web" image when running Unicut with Docker. +2. As a contributor, you should agree that: +a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary. +b. Your contributed code may be used for commercial purposes, including but not limited to its cloud video service operations. +Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0. +The interactive design of this product is protected by appearance patent. +© 2025 Sichuan Aiqiwu Technology Co., Ltd. All Rights Reserved. \ No newline at end of file diff --git a/README.md b/README.md index aaaad90..5bac156 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,117 @@ AI-driven open-source video editing tool 体验地址:https://unicut.h5ds.com -即将开源,敬请期待,欢迎加群 - -![qrcode](qrcode.png) - ![editor](editor.png) +相关技术参考文档: + +React: [https://react.docschina.org/](https://react.docschina.org/) + +semi-ui: [https://semi.design/](https://semi.design/) + +Mobx: [https://cn.mobx.js.org/](https://cn.mobx.js.org/) + +vite: [https://vitejs.cn/guide/](https://vitejs.cn/guide/) + + +# 项目源码说明 + +# 目录结构说明: +``` +├─dist 打包后生成的文件(执行yarn build后才会生成) +│ ├─assets 公共资源文件 +│ │ ├─ai +│ │ │ ├─matting ai抠图代码 +│ │ │ └─onnxruntime-web ai涂抹代码 +│ │ ├─ffmpeg12 ffmpeg代码 +│ │ ├─images 图片资源 +│ │ └─worker 解码代码 +│ └─homeAssets 打包后资源 +│ ├─css +│ ├─jpg +│ ├─js +│ └─png +├─public 静态资源文件夹 +│ └─assets +│ ├─ai +│ │ ├─matting ai抠图代码 +│ │ └─onnxruntime-web ai涂抹代码 +│ ├─ffmpeg12 ffmpeg代码 +│ ├─images 图片资源 +│ └─worker 解码代码 +├─src 项目源代码 +│ ├─assets 图片等资源 +│ │ └─images 图片资源 +│ ├─components 公共组件 +│ │ ├─audio 音频相关组件 +│ │ ├─content 我的草稿和我的素材公用容器组件 +│ │ ├─content-user 我的账号和我的消息公用容器组件 +│ │ ├─footer 网站底部 +│ │ ├─header 网站头部 +│ │ │ └─user 头部右侧的下拉信息框 +│ │ ├─login 登录 +│ │ │ ├─loginMobile 手机登录 +│ │ │ ├─loginQrcode 二维码登录 +│ │ │ └─loginRegisterBox 登录容器框 +│ │ ├─not-found 找不到的提示页面 +│ │ ├─page-loading 页面加载loading +│ │ ├─sub-header banner组件 +│ │ └─water-full 素材资源展示组件 +│ ├─config 配置文件 +│ ├─layout 布局 +│ │ ├─home-layout 首页布局 +│ │ ├─index-layout 关于我们布局 +│ │ ├─user-layout 用户中心布局 +│ │ │ └─sidebar 左侧导航 +│ │ │ └─cropUpload 截图 +│ │ └─workspace-layout 我的空间布局 +│ │ └─sidebar 左侧导航 +│ ├─less 基础less文件 +│ ├─pages 页面 +│ │ ├─aboutus 关于我们 +│ │ ├─home 首页 +│ │ ├─tools 快捷工具页面 +│ │ │ ├─ai-matting ai抠图 +│ │ │ └─ai-rubber ai涂抹 +│ │ ├─user 个人中心 +│ │ │ ├─account 账号设置 +│ │ │ └─message 消息中心 +│ │ └─workspace 我的空间 +│ │ └─user 个人用户空间 +│ │ ├─draft 我的草稿 +│ │ └─material 我的素材 +│ ├─server 请求 +│ ├─stores mobx的store +│ ├─theme 主题 +│ └─utils 公共方法 +├─ssh 本地开发https使用 +├─editorconfig 编辑器配置文件 +├─.gitignore git提交忽略文件 +├─copy.js 打包后复制处理文件 +├─index.html 入口html文件 +├─nodeExternals.js 处理package.json文件 +├─packages.json npm包配置文件 +├─readme.md 项目说明文档 +├─tsconfig.json ts配置文件 +├─tsconfig.node.json 用于vite.config.ts的ts配置文件 +├─vite.config.ts vite打包配置文件 +└─viteConfig.ts vite公共配置文件(暂时未使用) +``` +# 项目开发说明: + +当前目录执行yarn dev,启动开发环境(备注:如果没有在最外层执行过一次yarn install, 需要先在最外层执行以上命令,然后才可以在目录下执行yarn dev启动命令) + + +# 项目单独发布打包命令: + + +# 打包: +当前目录下执行:yarn build(备注:如果没有在最外层执行过一次yarn install和yarn build, 需要先在最外层执行以上两个命令,然后才可以单独对video-web执行yarn build打包) + +执行结束后会在根目录下生成www文件目录,里面是生成的需要发布的文件 + +打包后目录结构说明: +-assets 公共资源 +-homeAssets web系统资源 +-index.html 首页 + diff --git a/index.html b/index.html new file mode 100644 index 0000000..fb9097e --- /dev/null +++ b/index.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + 云剪|爱趣五视频云剪辑|视频剪辑软件|免费在线视频剪辑软件|视频剪辑工具|爱趣五科技有限公司 + + + + + +
+ + + + + diff --git a/package.json b/package.json index 301f1bf..1bd964f 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,111 @@ { - "name": "unicut", + "name": "aacut", + "private": true, "version": "1.0.0", - "main": "index.js", - "repository": "https://unicut.h5ds.com/", - "author": "676015863@qq.com <676015863@qq.com>", - "license": "" + "scripts": { + "dev": "vite", + "build": "yarn clean && yarn build:worker && vite build", + "build:worker": "node worker.config.js", + "preview": "vite preview --port 8080", + "lint": "eslint src --fix", + "clean": "rimraf dist" + }, + "dependencies": { + "@douyinfe/semi-ui": "^2.89.1", + "@ffmpeg/util": "^0.12.1", + "@icon-park/react": "^1.4.2", + "@mediapipe/tasks-vision": "^0.10.18", + "@uiw/react-affix": "^4.22.3", + "@uiw/react-color": "^2.4.0", + "apng-js": "^1.1.5", + "asset-require-hook": "^1.2.0", + "axios": "^0.24.0", + "classnames": "^2.3.2", + "dayjs": "^1.11.10", + "dexie": "^4.4.3", + "echarts": "^5.5.0", + "fflate": "^0.8.2", + "gifuct-js": "^2.1.2", + "gl-transitions": "^1.43.0", + "howler": "^2.2.4", + "http-proxy": "^1.18.1", + "ignore-styles": "^5.0.1", + "jquery": "^3.7.1", + "js-audio-recorder": "^1.0.7", + "jsdom": "^22.1.0", + "jszip": "^3.10.1", + "leafer-ui": "^1.0.0", + "localforage": "^1.10.0", + "lodash": "^4.17.21", + "lottie-web": "^5.12.2", + "mediabunny": "^1.50.9", + "mobx": "^5.15.4", + "mobx-react": "^6.2.2", + "mp4-muxer": "^5.2.1", + "nanoid": "^4.0.2", + "ndarray": "^1.0.19", + "opencv-ts": "^1.3.6", + "p-limit": "^4.0.0", + "pixi-color-effects": "^1.0.0", + "pixi-filters": "^5.2.1", + "pixi.js": "^7.3.0", + "pubsub-js": "^1.9.4", + "qrcode": "^1.5.4", + "qrcode.react": "^3.0.2", + "react": "^18.2.0", + "react-contexify": "^6.0.0", + "react-cropper": "^2.3.3", + "react-dom": "^18.2.0", + "react-easy-crop": "^5.0.2", + "react-fast-compare": "^3.2.2", + "react-image-crop": "^11.0.10", + "react-infinite-scroll-component": "^6.1.0", + "react-markdown": "^10.1.0", + "react-moveable": "^0.56.0", + "react-photo-view": "^1.2.3", + "react-resize-detector": "^9.1.0", + "react-router": "^5.2.0", + "react-router-config": "^5.1.1", + "react-router-dom": "^5.1.0", + "simple-query-string": "^1.3.2", + "swiper": "^12.1.2", + "three": "^0.168.0", + "tinycolor2": "^1.6.0", + "undo-redo-manager2": "^1.0.0", + "use-fs-access": "^1.3.2", + "video-core-sdk": "1.0.64", + "xlsx": "^0.18.5" + }, + "optionalDependencies": { + "esbuild-windows-64": "^0.15.18" + }, + "devDependencies": { + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-proposal-decorators": "^7.22.7", + "@rollup/plugin-commonjs": "^25.0.3", + "@types/jquery": "^3.5.18", + "@types/lodash": "^4.14.197", + "@types/pubsub-js": "^1.8.4", + "@types/react": "^18.2.15", + "@types/react-color": "^3.0.6", + "@types/react-dom": "^18.2.7", + "@types/react-loadable": "^5.5.6", + "@types/react-router": "^5.1.20", + "@types/react-router-config": "^5.0.6", + "@types/react-router-dom": "^5.3.3", + "@types/simple-query-string": "^1.3.1", + "@vitejs/plugin-react": "^4.0.3", + "husky": "^8.0.1", + "less": "^4.1.3", + "less-loader": "^11.1.3", + "lint-staged": "^12.4.2", + "rollup-plugin-node-externals": "^6.1.1", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-visualizer": "^6.0.5", + "stylus": "^0.57.0", + "typescript": "^5.1.6", + "vite": "^4.4.4", + "vite-plugin-imp": "^2.4.0", + "vite-plugin-mkcert": "^1.17.9" + } } diff --git a/public/assets/JamMono.ttf b/public/assets/JamMono.ttf new file mode 100644 index 0000000..5fd93c8 Binary files /dev/null and b/public/assets/JamMono.ttf differ diff --git a/public/assets/MediaInfoModule.wasm b/public/assets/MediaInfoModule.wasm new file mode 100644 index 0000000..8ed1351 Binary files /dev/null and b/public/assets/MediaInfoModule.wasm differ diff --git a/public/assets/avatars1/Adam.png b/public/assets/avatars1/Adam.png new file mode 100644 index 0000000..f47f829 Binary files /dev/null and b/public/assets/avatars1/Adam.png differ diff --git a/public/assets/avatars1/Alastor.png b/public/assets/avatars1/Alastor.png new file mode 100644 index 0000000..e005f95 Binary files /dev/null and b/public/assets/avatars1/Alastor.png differ diff --git a/public/assets/avatars1/Amanda.png b/public/assets/avatars1/Amanda.png new file mode 100644 index 0000000..c0ac2de Binary files /dev/null and b/public/assets/avatars1/Amanda.png differ diff --git a/public/assets/avatars1/Anna.png b/public/assets/avatars1/Anna.png new file mode 100644 index 0000000..0da0fc5 Binary files /dev/null and b/public/assets/avatars1/Anna.png differ diff --git a/public/assets/avatars1/Big Boogie.png b/public/assets/avatars1/Big Boogie.png new file mode 100644 index 0000000..e917be3 Binary files /dev/null and b/public/assets/avatars1/Big Boogie.png differ diff --git a/public/assets/avatars1/Bruce.png b/public/assets/avatars1/Bruce.png new file mode 100644 index 0000000..46a2775 Binary files /dev/null and b/public/assets/avatars1/Bruce.png differ diff --git a/public/assets/avatars1/Candice.png b/public/assets/avatars1/Candice.png new file mode 100644 index 0000000..caa1c87 Binary files /dev/null and b/public/assets/avatars1/Candice.png differ diff --git a/public/assets/avatars1/Cartoon Chef.png b/public/assets/avatars1/Cartoon Chef.png new file mode 100644 index 0000000..509b931 Binary files /dev/null and b/public/assets/avatars1/Cartoon Chef.png differ diff --git a/public/assets/avatars1/Charlie.png b/public/assets/avatars1/Charlie.png new file mode 100644 index 0000000..e5f632f Binary files /dev/null and b/public/assets/avatars1/Charlie.png differ diff --git a/public/assets/avatars1/Chucky.png b/public/assets/avatars1/Chucky.png new file mode 100644 index 0000000..ba868be Binary files /dev/null and b/public/assets/avatars1/Chucky.png differ diff --git a/public/assets/avatars1/Clown Man.png b/public/assets/avatars1/Clown Man.png new file mode 100644 index 0000000..3ffe66a Binary files /dev/null and b/public/assets/avatars1/Clown Man.png differ diff --git a/public/assets/avatars1/Corey.png b/public/assets/avatars1/Corey.png new file mode 100644 index 0000000..4a7163f Binary files /dev/null and b/public/assets/avatars1/Corey.png differ diff --git a/public/assets/avatars1/Daisy.png b/public/assets/avatars1/Daisy.png new file mode 100644 index 0000000..876bfff Binary files /dev/null and b/public/assets/avatars1/Daisy.png differ diff --git a/public/assets/avatars1/Daniel.png b/public/assets/avatars1/Daniel.png new file mode 100644 index 0000000..f28013b Binary files /dev/null and b/public/assets/avatars1/Daniel.png differ diff --git a/public/assets/avatars1/Daníel.png b/public/assets/avatars1/Daníel.png new file mode 100644 index 0000000..6b5155f --- /dev/null +++ b/public/assets/avatars1/Daníel.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"8df2520b3d2612276a0b3d26-ac37789","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/Dave.png b/public/assets/avatars1/Dave.png new file mode 100644 index 0000000..8d70d71 Binary files /dev/null and b/public/assets/avatars1/Dave.png differ diff --git a/public/assets/avatars1/DelicateGirl.png b/public/assets/avatars1/DelicateGirl.png new file mode 100644 index 0000000..64eec5c Binary files /dev/null and b/public/assets/avatars1/DelicateGirl.png differ diff --git a/public/assets/avatars1/Diana.png b/public/assets/avatars1/Diana.png new file mode 100644 index 0000000..c63b4ad Binary files /dev/null and b/public/assets/avatars1/Diana.png differ diff --git a/public/assets/avatars1/Dryw.png b/public/assets/avatars1/Dryw.png new file mode 100644 index 0000000..965037e Binary files /dev/null and b/public/assets/avatars1/Dryw.png differ diff --git a/public/assets/avatars1/Emily.png b/public/assets/avatars1/Emily.png new file mode 100644 index 0000000..b366400 Binary files /dev/null and b/public/assets/avatars1/Emily.png differ diff --git a/public/assets/avatars1/EnergeticMaleII.png b/public/assets/avatars1/EnergeticMaleII.png new file mode 100644 index 0000000..a8d3038 Binary files /dev/null and b/public/assets/avatars1/EnergeticMaleII.png differ diff --git a/public/assets/avatars1/Ethan.png b/public/assets/avatars1/Ethan.png new file mode 100644 index 0000000..9abaae9 Binary files /dev/null and b/public/assets/avatars1/Ethan.png differ diff --git a/public/assets/avatars1/FlirtyFemale.png b/public/assets/avatars1/FlirtyFemale.png new file mode 100644 index 0000000..805b17d Binary files /dev/null and b/public/assets/avatars1/FlirtyFemale.png differ diff --git a/public/assets/avatars1/Frosty Man.png b/public/assets/avatars1/Frosty Man.png new file mode 100644 index 0000000..b2d8c23 Binary files /dev/null and b/public/assets/avatars1/Frosty Man.png differ diff --git a/public/assets/avatars1/Glen.png b/public/assets/avatars1/Glen.png new file mode 100644 index 0000000..6fbc36d Binary files /dev/null and b/public/assets/avatars1/Glen.png differ diff --git a/public/assets/avatars1/GothamHero.png b/public/assets/avatars1/GothamHero.png new file mode 100644 index 0000000..6b0b793 Binary files /dev/null and b/public/assets/avatars1/GothamHero.png differ diff --git a/public/assets/avatars1/Hades.png b/public/assets/avatars1/Hades.png new file mode 100644 index 0000000..fbf44dc Binary files /dev/null and b/public/assets/avatars1/Hades.png differ diff --git a/public/assets/avatars1/Jackson.png b/public/assets/avatars1/Jackson.png new file mode 100644 index 0000000..4b3ad84 Binary files /dev/null and b/public/assets/avatars1/Jackson.png differ diff --git a/public/assets/avatars1/Jigsaw.png b/public/assets/avatars1/Jigsaw.png new file mode 100644 index 0000000..0cd3d21 Binary files /dev/null and b/public/assets/avatars1/Jigsaw.png differ diff --git a/public/assets/avatars1/Kevin McCallister.png b/public/assets/avatars1/Kevin McCallister.png new file mode 100644 index 0000000..0dcd09d Binary files /dev/null and b/public/assets/avatars1/Kevin McCallister.png differ diff --git a/public/assets/avatars1/Lauren.png b/public/assets/avatars1/Lauren.png new file mode 100644 index 0000000..63db588 Binary files /dev/null and b/public/assets/avatars1/Lauren.png differ diff --git a/public/assets/avatars1/Lucas.png b/public/assets/avatars1/Lucas.png new file mode 100644 index 0000000..7110035 Binary files /dev/null and b/public/assets/avatars1/Lucas.png differ diff --git a/public/assets/avatars1/Lucía.png b/public/assets/avatars1/Lucía.png new file mode 100644 index 0000000..068ecd7 --- /dev/null +++ b/public/assets/avatars1/Lucía.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"83eed60b3d26d2736a0b3d26-acc1fc2","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/Luna.png b/public/assets/avatars1/Luna.png new file mode 100644 index 0000000..52d8d06 Binary files /dev/null and b/public/assets/avatars1/Luna.png differ diff --git a/public/assets/avatars1/Michael.png b/public/assets/avatars1/Michael.png new file mode 100644 index 0000000..885a32c Binary files /dev/null and b/public/assets/avatars1/Michael.png differ diff --git a/public/assets/avatars1/Nadia.png b/public/assets/avatars1/Nadia.png new file mode 100644 index 0000000..add554f Binary files /dev/null and b/public/assets/avatars1/Nadia.png differ diff --git a/public/assets/avatars1/Nara.png b/public/assets/avatars1/Nara.png new file mode 100644 index 0000000..9aa26f2 Binary files /dev/null and b/public/assets/avatars1/Nara.png differ diff --git a/public/assets/avatars1/Noah.png b/public/assets/avatars1/Noah.png new file mode 100644 index 0000000..8fd0316 Binary files /dev/null and b/public/assets/avatars1/Noah.png differ diff --git a/public/assets/avatars1/Onez.png b/public/assets/avatars1/Onez.png new file mode 100644 index 0000000..88bbff8 Binary files /dev/null and b/public/assets/avatars1/Onez.png differ diff --git a/public/assets/avatars1/Owen.png b/public/assets/avatars1/Owen.png new file mode 100644 index 0000000..4935bc2 Binary files /dev/null and b/public/assets/avatars1/Owen.png differ diff --git a/public/assets/avatars1/PeacefulFemale.png b/public/assets/avatars1/PeacefulFemale.png new file mode 100644 index 0000000..805b17d Binary files /dev/null and b/public/assets/avatars1/PeacefulFemale.png differ diff --git a/public/assets/avatars1/Sarah.png b/public/assets/avatars1/Sarah.png new file mode 100644 index 0000000..aaa234f Binary files /dev/null and b/public/assets/avatars1/Sarah.png differ diff --git a/public/assets/avatars1/Serena.png b/public/assets/avatars1/Serena.png new file mode 100644 index 0000000..72f3232 --- /dev/null +++ b/public/assets/avatars1/Serena.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"6536600b3d17c8ab6a0b3d17-ac32f90","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/Smith.png b/public/assets/avatars1/Smith.png new file mode 100644 index 0000000..97362e0 Binary files /dev/null and b/public/assets/avatars1/Smith.png differ diff --git a/public/assets/avatars1/Sofía.png b/public/assets/avatars1/Sofía.png new file mode 100644 index 0000000..d4cf837 --- /dev/null +++ b/public/assets/avatars1/Sofía.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"c21c1d0b3d265d5a6a0b3d26-fdbdgdc01gcg60agg39","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/Sophie.png b/public/assets/avatars1/Sophie.png new file mode 100644 index 0000000..01201d4 Binary files /dev/null and b/public/assets/avatars1/Sophie.png differ diff --git a/public/assets/avatars1/Sylus.png b/public/assets/avatars1/Sylus.png new file mode 100644 index 0000000..f832265 Binary files /dev/null and b/public/assets/avatars1/Sylus.png differ diff --git a/public/assets/avatars1/The Grinch.png b/public/assets/avatars1/The Grinch.png new file mode 100644 index 0000000..95d6140 Binary files /dev/null and b/public/assets/avatars1/The Grinch.png differ diff --git a/public/assets/avatars1/Tina老师.png b/public/assets/avatars1/Tina老师.png new file mode 100644 index 0000000..a414167 Binary files /dev/null and b/public/assets/avatars1/Tina老师.png differ diff --git a/public/assets/avatars1/Vivi.png b/public/assets/avatars1/Vivi.png new file mode 100644 index 0000000..c6fdaae Binary files /dev/null and b/public/assets/avatars1/Vivi.png differ diff --git a/public/assets/avatars1/Xavier.png b/public/assets/avatars1/Xavier.png new file mode 100644 index 0000000..3fae239 Binary files /dev/null and b/public/assets/avatars1/Xavier.png differ diff --git a/public/assets/avatars1/Zayne.png b/public/assets/avatars1/Zayne.png new file mode 100644 index 0000000..c95ae78 Binary files /dev/null and b/public/assets/avatars1/Zayne.png differ diff --git a/public/assets/avatars1/あけみ(朱美).png b/public/assets/avatars1/あけみ(朱美).png new file mode 100644 index 0000000..06389fd --- /dev/null +++ b/public/assets/avatars1/あけみ(朱美).png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"c7a60f0b3d2736fc6a0b3d27-fdbdgdc01gcgf22gg42","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/かずね(和音).png b/public/assets/avatars1/かずね(和音).png new file mode 100644 index 0000000..beecafd --- /dev/null +++ b/public/assets/avatars1/かずね(和音).png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"d0cb0c0b3d27cb986a0b3d27-a9c411f","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/さとみ(智美).png b/public/assets/avatars1/さとみ(智美).png new file mode 100644 index 0000000..fc2b533 Binary files /dev/null and b/public/assets/avatars1/さとみ(智美).png differ diff --git a/public/assets/avatars1/つき(月).png b/public/assets/avatars1/つき(月).png new file mode 100644 index 0000000..a6a4ce3 Binary files /dev/null and b/public/assets/avatars1/つき(月).png differ diff --git a/public/assets/avatars1/はるこ(晴子).png b/public/assets/avatars1/はるこ(晴子).png new file mode 100644 index 0000000..32c4e18 --- /dev/null +++ b/public/assets/avatars1/はるこ(晴子).png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"c348d00b3d273e796a0b3d27-ac67a35","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/ひかる(光).png b/public/assets/avatars1/ひかる(光).png new file mode 100644 index 0000000..28a8baf Binary files /dev/null and b/public/assets/avatars1/ひかる(光).png differ diff --git a/public/assets/avatars1/ひろし(広志).png b/public/assets/avatars1/ひろし(広志).png new file mode 100644 index 0000000..cf352c9 --- /dev/null +++ b/public/assets/avatars1/ひろし(広志).png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"e34c70b3d27a7ec6a0b3d27-fdbdgdc01gcg602gg36","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/まさお(正男).png b/public/assets/avatars1/まさお(正男).png new file mode 100644 index 0000000..a5a661b Binary files /dev/null and b/public/assets/avatars1/まさお(正男).png differ diff --git a/public/assets/avatars1/不羁青年.png b/public/assets/avatars1/不羁青年.png new file mode 100644 index 0000000..885aae8 Binary files /dev/null and b/public/assets/avatars1/不羁青年.png differ diff --git a/public/assets/avatars1/东方浩然.png b/public/assets/avatars1/东方浩然.png new file mode 100644 index 0000000..3387988 Binary files /dev/null and b/public/assets/avatars1/东方浩然.png differ diff --git a/public/assets/avatars1/中二青年.png b/public/assets/avatars1/中二青年.png new file mode 100644 index 0000000..d3886e2 Binary files /dev/null and b/public/assets/avatars1/中二青年.png differ diff --git a/public/assets/avatars1/乖巧可儿.png b/public/assets/avatars1/乖巧可儿.png new file mode 100644 index 0000000..e81c4c0 Binary files /dev/null and b/public/assets/avatars1/乖巧可儿.png differ diff --git a/public/assets/avatars1/京腔侃爷.png b/public/assets/avatars1/京腔侃爷.png new file mode 100644 index 0000000..92e1e89 Binary files /dev/null and b/public/assets/avatars1/京腔侃爷.png differ diff --git a/public/assets/avatars1/亮嗓萌仔.png b/public/assets/avatars1/亮嗓萌仔.png new file mode 100644 index 0000000..d1128e7 Binary files /dev/null and b/public/assets/avatars1/亮嗓萌仔.png differ diff --git a/public/assets/avatars1/亲切女声.png b/public/assets/avatars1/亲切女声.png new file mode 100644 index 0000000..78d62f2 Binary files /dev/null and b/public/assets/avatars1/亲切女声.png differ diff --git a/public/assets/avatars1/亲切小卓.png b/public/assets/avatars1/亲切小卓.png new file mode 100644 index 0000000..f40122e Binary files /dev/null and b/public/assets/avatars1/亲切小卓.png differ diff --git a/public/assets/avatars1/亲切青年.png b/public/assets/avatars1/亲切青年.png new file mode 100644 index 0000000..31b23a1 Binary files /dev/null and b/public/assets/avatars1/亲切青年.png differ diff --git a/public/assets/avatars1/仗剑侠客.png b/public/assets/avatars1/仗剑侠客.png new file mode 100644 index 0000000..b991eac Binary files /dev/null and b/public/assets/avatars1/仗剑侠客.png differ diff --git a/public/assets/avatars1/仗剑君子.png b/public/assets/avatars1/仗剑君子.png new file mode 100644 index 0000000..b0d1e22 Binary files /dev/null and b/public/assets/avatars1/仗剑君子.png differ diff --git a/public/assets/avatars1/优柔公子.png b/public/assets/avatars1/优柔公子.png new file mode 100644 index 0000000..3171cbd Binary files /dev/null and b/public/assets/avatars1/优柔公子.png differ diff --git a/public/assets/avatars1/优柔帮主.png b/public/assets/avatars1/优柔帮主.png new file mode 100644 index 0000000..3f1f34e Binary files /dev/null and b/public/assets/avatars1/优柔帮主.png differ diff --git a/public/assets/avatars1/低沉缱绻.png b/public/assets/avatars1/低沉缱绻.png new file mode 100644 index 0000000..d1c46ac Binary files /dev/null and b/public/assets/avatars1/低沉缱绻.png differ diff --git a/public/assets/avatars1/低音沉郁.png b/public/assets/avatars1/低音沉郁.png new file mode 100644 index 0000000..52cd74f Binary files /dev/null and b/public/assets/avatars1/低音沉郁.png differ diff --git a/public/assets/avatars1/佩奇猪.png b/public/assets/avatars1/佩奇猪.png new file mode 100644 index 0000000..09a6028 Binary files /dev/null and b/public/assets/avatars1/佩奇猪.png differ diff --git a/public/assets/avatars1/俊朗男友.png b/public/assets/avatars1/俊朗男友.png new file mode 100644 index 0000000..b24edf8 Binary files /dev/null and b/public/assets/avatars1/俊朗男友.png differ diff --git a/public/assets/avatars1/俊逸公子.png b/public/assets/avatars1/俊逸公子.png new file mode 100644 index 0000000..ed38f48 Binary files /dev/null and b/public/assets/avatars1/俊逸公子.png differ diff --git a/public/assets/avatars1/俏皮女声.png b/public/assets/avatars1/俏皮女声.png new file mode 100644 index 0000000..cc2df8d Binary files /dev/null and b/public/assets/avatars1/俏皮女声.png differ diff --git a/public/assets/avatars1/倾心少女.png b/public/assets/avatars1/倾心少女.png new file mode 100644 index 0000000..bcd2bce Binary files /dev/null and b/public/assets/avatars1/倾心少女.png differ diff --git a/public/assets/avatars1/假小子.png b/public/assets/avatars1/假小子.png new file mode 100644 index 0000000..e536fe2 Binary files /dev/null and b/public/assets/avatars1/假小子.png differ diff --git a/public/assets/avatars1/傲娇公子.png b/public/assets/avatars1/傲娇公子.png new file mode 100644 index 0000000..b8b966e Binary files /dev/null and b/public/assets/avatars1/傲娇公子.png differ diff --git a/public/assets/avatars1/傲娇女友.png b/public/assets/avatars1/傲娇女友.png new file mode 100644 index 0000000..2c13392 Binary files /dev/null and b/public/assets/avatars1/傲娇女友.png differ diff --git a/public/assets/avatars1/傲娇精英.png b/public/assets/avatars1/傲娇精英.png new file mode 100644 index 0000000..75262e8 Binary files /dev/null and b/public/assets/avatars1/傲娇精英.png differ diff --git a/public/assets/avatars1/傲娇霸总.png b/public/assets/avatars1/傲娇霸总.png new file mode 100644 index 0000000..3bf2531 Binary files /dev/null and b/public/assets/avatars1/傲娇霸总.png differ diff --git a/public/assets/avatars1/傲慢娇声.png b/public/assets/avatars1/傲慢娇声.png new file mode 100644 index 0000000..46a7903 Binary files /dev/null and b/public/assets/avatars1/傲慢娇声.png differ diff --git a/public/assets/avatars1/傲慢少爷.png b/public/assets/avatars1/傲慢少爷.png new file mode 100644 index 0000000..9c5ef5b Binary files /dev/null and b/public/assets/avatars1/傲慢少爷.png differ diff --git a/public/assets/avatars1/傲慢青年.png b/public/assets/avatars1/傲慢青年.png new file mode 100644 index 0000000..ccce791 Binary files /dev/null and b/public/assets/avatars1/傲慢青年.png differ diff --git a/public/assets/avatars1/傲气凌人.png b/public/assets/avatars1/傲气凌人.png new file mode 100644 index 0000000..afc69df Binary files /dev/null and b/public/assets/avatars1/傲气凌人.png differ diff --git a/public/assets/avatars1/儒雅公子.png b/public/assets/avatars1/儒雅公子.png new file mode 100644 index 0000000..8014a75 Binary files /dev/null and b/public/assets/avatars1/儒雅公子.png differ diff --git a/public/assets/avatars1/儒雅君子.png b/public/assets/avatars1/儒雅君子.png new file mode 100644 index 0000000..5f59dfc Binary files /dev/null and b/public/assets/avatars1/儒雅君子.png differ diff --git a/public/assets/avatars1/儒雅总裁.png b/public/assets/avatars1/儒雅总裁.png new file mode 100644 index 0000000..b399936 Binary files /dev/null and b/public/assets/avatars1/儒雅总裁.png differ diff --git a/public/assets/avatars1/儒雅才俊.png b/public/assets/avatars1/儒雅才俊.png new file mode 100644 index 0000000..e35938f Binary files /dev/null and b/public/assets/avatars1/儒雅才俊.png differ diff --git a/public/assets/avatars1/儒雅男友.png b/public/assets/avatars1/儒雅男友.png new file mode 100644 index 0000000..61056bd Binary files /dev/null and b/public/assets/avatars1/儒雅男友.png differ diff --git a/public/assets/avatars1/儒雅青年.png b/public/assets/avatars1/儒雅青年.png new file mode 100644 index 0000000..6be500d Binary files /dev/null and b/public/assets/avatars1/儒雅青年.png differ diff --git a/public/assets/avatars1/元气少年.png b/public/assets/avatars1/元气少年.png new file mode 100644 index 0000000..cc291fb Binary files /dev/null and b/public/assets/avatars1/元气少年.png differ diff --git a/public/assets/avatars1/元气甜妹.png b/public/assets/avatars1/元气甜妹.png new file mode 100644 index 0000000..d737d24 Binary files /dev/null and b/public/assets/avatars1/元气甜妹.png differ diff --git a/public/assets/avatars1/内敛才俊.png b/public/assets/avatars1/内敛才俊.png new file mode 100644 index 0000000..bc2bdf3 Binary files /dev/null and b/public/assets/avatars1/内敛才俊.png differ diff --git a/public/assets/avatars1/冷傲总裁.png b/public/assets/avatars1/冷傲总裁.png new file mode 100644 index 0000000..abc13c5 Binary files /dev/null and b/public/assets/avatars1/冷傲总裁.png differ diff --git a/public/assets/avatars1/冷峻上司.png b/public/assets/avatars1/冷峻上司.png new file mode 100644 index 0000000..77f93da Binary files /dev/null and b/public/assets/avatars1/冷峻上司.png differ diff --git a/public/assets/avatars1/冷峻高智.png b/public/assets/avatars1/冷峻高智.png new file mode 100644 index 0000000..7860cc2 Binary files /dev/null and b/public/assets/avatars1/冷峻高智.png differ diff --git a/public/assets/avatars1/冷淡疏离.png b/public/assets/avatars1/冷淡疏离.png new file mode 100644 index 0000000..046bab7 Binary files /dev/null and b/public/assets/avatars1/冷淡疏离.png differ diff --git a/public/assets/avatars1/冷漠兄长.png b/public/assets/avatars1/冷漠兄长.png new file mode 100644 index 0000000..427ad04 Binary files /dev/null and b/public/assets/avatars1/冷漠兄长.png differ diff --git a/public/assets/avatars1/冷漠男友.png b/public/assets/avatars1/冷漠男友.png new file mode 100644 index 0000000..5154ab8 Binary files /dev/null and b/public/assets/avatars1/冷漠男友.png differ diff --git a/public/assets/avatars1/冷脸兄长.png b/public/assets/avatars1/冷脸兄长.png new file mode 100644 index 0000000..fc132a6 Binary files /dev/null and b/public/assets/avatars1/冷脸兄长.png differ diff --git a/public/assets/avatars1/冷脸学霸.png b/public/assets/avatars1/冷脸学霸.png new file mode 100644 index 0000000..50f264a Binary files /dev/null and b/public/assets/avatars1/冷脸学霸.png differ diff --git a/public/assets/avatars1/冷酷哥哥.png b/public/assets/avatars1/冷酷哥哥.png new file mode 100644 index 0000000..04bb76d Binary files /dev/null and b/public/assets/avatars1/冷酷哥哥.png differ diff --git a/public/assets/avatars1/凌云青年.png b/public/assets/avatars1/凌云青年.png new file mode 100644 index 0000000..fd375d0 Binary files /dev/null and b/public/assets/avatars1/凌云青年.png differ diff --git a/public/assets/avatars1/初恋女友.png b/public/assets/avatars1/初恋女友.png new file mode 100644 index 0000000..c2a47a9 Binary files /dev/null and b/public/assets/avatars1/初恋女友.png differ diff --git a/public/assets/avatars1/北京小爷.png b/public/assets/avatars1/北京小爷.png new file mode 100644 index 0000000..a95a7c5 Binary files /dev/null and b/public/assets/avatars1/北京小爷.png differ diff --git a/public/assets/avatars1/双节棍小哥.png b/public/assets/avatars1/双节棍小哥.png new file mode 100644 index 0000000..d6d4b1c Binary files /dev/null and b/public/assets/avatars1/双节棍小哥.png differ diff --git a/public/assets/avatars1/反卷青年.png b/public/assets/avatars1/反卷青年.png new file mode 100644 index 0000000..47abbef Binary files /dev/null and b/public/assets/avatars1/反卷青年.png differ diff --git a/public/assets/avatars1/古风少御.png b/public/assets/avatars1/古风少御.png new file mode 100644 index 0000000..36ed60c --- /dev/null +++ b/public/assets/avatars1/古风少御.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"d990420b3d2979a56a0b3d29-fdbdgdc01gdg400gg29","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/可爱女生.png b/public/assets/avatars1/可爱女生.png new file mode 100644 index 0000000..190e880 Binary files /dev/null and b/public/assets/avatars1/可爱女生.png differ diff --git a/public/assets/avatars1/呆萌川妹.png b/public/assets/avatars1/呆萌川妹.png new file mode 100644 index 0000000..a08a0d0 Binary files /dev/null and b/public/assets/avatars1/呆萌川妹.png differ diff --git a/public/assets/avatars1/咆哮小哥.png b/public/assets/avatars1/咆哮小哥.png new file mode 100644 index 0000000..3eab887 Binary files /dev/null and b/public/assets/avatars1/咆哮小哥.png differ diff --git a/public/assets/avatars1/和蔼奶奶.png b/public/assets/avatars1/和蔼奶奶.png new file mode 100644 index 0000000..0621298 Binary files /dev/null and b/public/assets/avatars1/和蔼奶奶.png differ diff --git a/public/assets/avatars1/唐僧.png b/public/assets/avatars1/唐僧.png new file mode 100644 index 0000000..f2ce137 Binary files /dev/null and b/public/assets/avatars1/唐僧.png differ diff --git a/public/assets/avatars1/嚣张小哥.png b/public/assets/avatars1/嚣张小哥.png new file mode 100644 index 0000000..d6cd440 Binary files /dev/null and b/public/assets/avatars1/嚣张小哥.png differ diff --git a/public/assets/avatars1/四郎.png b/public/assets/avatars1/四郎.png new file mode 100644 index 0000000..2c979f3 Binary files /dev/null and b/public/assets/avatars1/四郎.png differ diff --git a/public/assets/avatars1/固执病娇.png b/public/assets/avatars1/固执病娇.png new file mode 100644 index 0000000..b72e5ec Binary files /dev/null and b/public/assets/avatars1/固执病娇.png differ diff --git a/public/assets/avatars1/天才同桌.png b/public/assets/avatars1/天才同桌.png new file mode 100644 index 0000000..a68b32f Binary files /dev/null and b/public/assets/avatars1/天才同桌.png differ diff --git a/public/assets/avatars1/天才童声.png b/public/assets/avatars1/天才童声.png new file mode 100644 index 0000000..4f67b4e Binary files /dev/null and b/public/assets/avatars1/天才童声.png differ diff --git a/public/assets/avatars1/女雷神.png b/public/assets/avatars1/女雷神.png new file mode 100644 index 0000000..cf18620 Binary files /dev/null and b/public/assets/avatars1/女雷神.png differ diff --git a/public/assets/avatars1/奶气小生.png b/public/assets/avatars1/奶气小生.png new file mode 100644 index 0000000..a8a1fb2 Binary files /dev/null and b/public/assets/avatars1/奶气小生.png differ diff --git a/public/assets/avatars1/奶气萌娃.png b/public/assets/avatars1/奶气萌娃.png new file mode 100644 index 0000000..c43f6a5 Binary files /dev/null and b/public/assets/avatars1/奶气萌娃.png differ diff --git a/public/assets/avatars1/妩媚可人.png b/public/assets/avatars1/妩媚可人.png new file mode 100644 index 0000000..d8a2ea9 Binary files /dev/null and b/public/assets/avatars1/妩媚可人.png differ diff --git a/public/assets/avatars1/妩媚御姐.png b/public/assets/avatars1/妩媚御姐.png new file mode 100644 index 0000000..905506f Binary files /dev/null and b/public/assets/avatars1/妩媚御姐.png differ diff --git a/public/assets/avatars1/妹坨洁儿.png b/public/assets/avatars1/妹坨洁儿.png new file mode 100644 index 0000000..2f39a13 Binary files /dev/null and b/public/assets/avatars1/妹坨洁儿.png differ diff --git a/public/assets/avatars1/娇喘女声.png b/public/assets/avatars1/娇喘女声.png new file mode 100644 index 0000000..64e520b Binary files /dev/null and b/public/assets/avatars1/娇喘女声.png differ diff --git a/public/assets/avatars1/娇弱萝莉.png b/public/assets/avatars1/娇弱萝莉.png new file mode 100644 index 0000000..1b8f4b4 Binary files /dev/null and b/public/assets/avatars1/娇弱萝莉.png differ diff --git a/public/assets/avatars1/娇憨女王.png b/public/assets/avatars1/娇憨女王.png new file mode 100644 index 0000000..a862dad Binary files /dev/null and b/public/assets/avatars1/娇憨女王.png differ diff --git a/public/assets/avatars1/婆婆.png b/public/assets/avatars1/婆婆.png new file mode 100644 index 0000000..abe737b Binary files /dev/null and b/public/assets/avatars1/婆婆.png differ diff --git a/public/assets/avatars1/孤傲公子.png b/public/assets/avatars1/孤傲公子.png new file mode 100644 index 0000000..c397b29 Binary files /dev/null and b/public/assets/avatars1/孤傲公子.png differ diff --git a/public/assets/avatars1/孤高公子.png b/public/assets/avatars1/孤高公子.png new file mode 100644 index 0000000..daab7ef Binary files /dev/null and b/public/assets/avatars1/孤高公子.png differ diff --git a/public/assets/avatars1/学霸同桌.png b/public/assets/avatars1/学霸同桌.png new file mode 100644 index 0000000..8d62506 Binary files /dev/null and b/public/assets/avatars1/学霸同桌.png differ diff --git a/public/assets/avatars1/学霸男同桌.png b/public/assets/avatars1/学霸男同桌.png new file mode 100644 index 0000000..72867f2 Binary files /dev/null and b/public/assets/avatars1/学霸男同桌.png differ diff --git a/public/assets/avatars1/孱弱少爷.png b/public/assets/avatars1/孱弱少爷.png new file mode 100644 index 0000000..2ae7773 Binary files /dev/null and b/public/assets/avatars1/孱弱少爷.png differ diff --git a/public/assets/avatars1/寡言小哥.png b/public/assets/avatars1/寡言小哥.png new file mode 100644 index 0000000..db6d632 --- /dev/null +++ b/public/assets/avatars1/寡言小哥.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"1e911b0b3d1fcb7b6a0b3d1f-a9c414c","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/小侯爷.png b/public/assets/avatars1/小侯爷.png new file mode 100644 index 0000000..0b90dda Binary files /dev/null and b/public/assets/avatars1/小侯爷.png differ diff --git a/public/assets/avatars1/少儿故事.png b/public/assets/avatars1/少儿故事.png new file mode 100644 index 0000000..f9d154e Binary files /dev/null and b/public/assets/avatars1/少儿故事.png differ diff --git a/public/assets/avatars1/少年将军.png b/public/assets/avatars1/少年将军.png new file mode 100644 index 0000000..ab01d06 Binary files /dev/null and b/public/assets/avatars1/少年将军.png differ diff --git a/public/assets/avatars1/少年梓辛.png b/public/assets/avatars1/少年梓辛.png new file mode 100644 index 0000000..12c3df8 Binary files /dev/null and b/public/assets/avatars1/少年梓辛.png differ diff --git a/public/assets/avatars1/干净少年.png b/public/assets/avatars1/干净少年.png new file mode 100644 index 0000000..fc9e2d3 Binary files /dev/null and b/public/assets/avatars1/干净少年.png differ diff --git a/public/assets/avatars1/幽默叔叔.png b/public/assets/avatars1/幽默叔叔.png new file mode 100644 index 0000000..08ba3bd Binary files /dev/null and b/public/assets/avatars1/幽默叔叔.png differ diff --git a/public/assets/avatars1/幽默大爷.png b/public/assets/avatars1/幽默大爷.png new file mode 100644 index 0000000..73f4cbb Binary files /dev/null and b/public/assets/avatars1/幽默大爷.png differ diff --git a/public/assets/avatars1/广告解说.png b/public/assets/avatars1/广告解说.png new file mode 100644 index 0000000..74fc48a Binary files /dev/null and b/public/assets/avatars1/广告解说.png differ diff --git a/public/assets/avatars1/广州德哥.png b/public/assets/avatars1/广州德哥.png new file mode 100644 index 0000000..ec4c925 Binary files /dev/null and b/public/assets/avatars1/广州德哥.png differ diff --git a/public/assets/avatars1/广西远舟.png b/public/assets/avatars1/广西远舟.png new file mode 100644 index 0000000..42d6efc Binary files /dev/null and b/public/assets/avatars1/广西远舟.png differ diff --git a/public/assets/avatars1/庄周.png b/public/assets/avatars1/庄周.png new file mode 100644 index 0000000..da206a5 Binary files /dev/null and b/public/assets/avatars1/庄周.png differ diff --git a/public/assets/avatars1/开心小鸿.png b/public/assets/avatars1/开心小鸿.png new file mode 100644 index 0000000..729004c Binary files /dev/null and b/public/assets/avatars1/开心小鸿.png differ diff --git a/public/assets/avatars1/开朗姐姐.png b/public/assets/avatars1/开朗姐姐.png new file mode 100644 index 0000000..6792444 Binary files /dev/null and b/public/assets/avatars1/开朗姐姐.png differ diff --git a/public/assets/avatars1/开朗婷婷.png b/public/assets/avatars1/开朗婷婷.png new file mode 100644 index 0000000..2cc056f Binary files /dev/null and b/public/assets/avatars1/开朗婷婷.png differ diff --git a/public/assets/avatars1/开朗学长.png b/public/assets/avatars1/开朗学长.png new file mode 100644 index 0000000..caacee4 Binary files /dev/null and b/public/assets/avatars1/开朗学长.png differ diff --git a/public/assets/avatars1/开朗弟弟.png b/public/assets/avatars1/开朗弟弟.png new file mode 100644 index 0000000..a83a482 Binary files /dev/null and b/public/assets/avatars1/开朗弟弟.png differ diff --git a/public/assets/avatars1/开朗轻快.png b/public/assets/avatars1/开朗轻快.png new file mode 100644 index 0000000..eeaea8a Binary files /dev/null and b/public/assets/avatars1/开朗轻快.png differ diff --git a/public/assets/avatars1/开朗青年.png b/public/assets/avatars1/开朗青年.png new file mode 100644 index 0000000..1f54fe5 Binary files /dev/null and b/public/assets/avatars1/开朗青年.png differ diff --git a/public/assets/avatars1/心灵鸡汤.png b/public/assets/avatars1/心灵鸡汤.png new file mode 100644 index 0000000..6d0e30b Binary files /dev/null and b/public/assets/avatars1/心灵鸡汤.png differ diff --git a/public/assets/avatars1/快乐小东.png b/public/assets/avatars1/快乐小东.png new file mode 100644 index 0000000..5475bff Binary files /dev/null and b/public/assets/avatars1/快乐小东.png differ diff --git a/public/assets/avatars1/性感御姐.png b/public/assets/avatars1/性感御姐.png new file mode 100644 index 0000000..5eff922 Binary files /dev/null and b/public/assets/avatars1/性感御姐.png differ diff --git a/public/assets/avatars1/性感魅惑.png b/public/assets/avatars1/性感魅惑.png new file mode 100644 index 0000000..f841d6f Binary files /dev/null and b/public/assets/avatars1/性感魅惑.png differ diff --git a/public/assets/avatars1/悠悠君子.png b/public/assets/avatars1/悠悠君子.png new file mode 100644 index 0000000..122728a Binary files /dev/null and b/public/assets/avatars1/悠悠君子.png differ diff --git a/public/assets/avatars1/悬疑解说.png b/public/assets/avatars1/悬疑解说.png new file mode 100644 index 0000000..db614c4 Binary files /dev/null and b/public/assets/avatars1/悬疑解说.png differ diff --git a/public/assets/avatars1/意气少年.png b/public/assets/avatars1/意气少年.png new file mode 100644 index 0000000..16bc679 Binary files /dev/null and b/public/assets/avatars1/意气少年.png differ diff --git a/public/assets/avatars1/感冒电音姐姐.png b/public/assets/avatars1/感冒电音姐姐.png new file mode 100644 index 0000000..f565038 Binary files /dev/null and b/public/assets/avatars1/感冒电音姐姐.png differ diff --git a/public/assets/avatars1/憨厚敦实.png b/public/assets/avatars1/憨厚敦实.png new file mode 100644 index 0000000..cac7f9a Binary files /dev/null and b/public/assets/avatars1/憨厚敦实.png differ diff --git a/public/assets/avatars1/懒音绵宝.png b/public/assets/avatars1/懒音绵宝.png new file mode 100644 index 0000000..33a726b Binary files /dev/null and b/public/assets/avatars1/懒音绵宝.png differ diff --git a/public/assets/avatars1/懵懂青年.png b/public/assets/avatars1/懵懂青年.png new file mode 100644 index 0000000..c2ffc81 Binary files /dev/null and b/public/assets/avatars1/懵懂青年.png differ diff --git a/public/assets/avatars1/成熟姐姐.png b/public/assets/avatars1/成熟姐姐.png new file mode 100644 index 0000000..2e187aa Binary files /dev/null and b/public/assets/avatars1/成熟姐姐.png differ diff --git a/public/assets/avatars1/成熟总裁.png b/public/assets/avatars1/成熟总裁.png new file mode 100644 index 0000000..2a50551 Binary files /dev/null and b/public/assets/avatars1/成熟总裁.png differ diff --git a/public/assets/avatars1/成熟温柔.png b/public/assets/avatars1/成熟温柔.png new file mode 100644 index 0000000..2c0ec75 Binary files /dev/null and b/public/assets/avatars1/成熟温柔.png differ diff --git a/public/assets/avatars1/撒娇学妹.png b/public/assets/avatars1/撒娇学妹.png new file mode 100644 index 0000000..cfff77b Binary files /dev/null and b/public/assets/avatars1/撒娇学妹.png differ diff --git a/public/assets/avatars1/撒娇男友.png b/public/assets/avatars1/撒娇男友.png new file mode 100644 index 0000000..e622476 Binary files /dev/null and b/public/assets/avatars1/撒娇男友.png differ diff --git a/public/assets/avatars1/撒娇男生.png b/public/assets/avatars1/撒娇男生.png new file mode 100644 index 0000000..40344a7 Binary files /dev/null and b/public/assets/avatars1/撒娇男生.png differ diff --git a/public/assets/avatars1/撒娇粘人.png b/public/assets/avatars1/撒娇粘人.png new file mode 100644 index 0000000..90c359c Binary files /dev/null and b/public/assets/avatars1/撒娇粘人.png differ diff --git a/public/assets/avatars1/擎苍.png b/public/assets/avatars1/擎苍.png new file mode 100644 index 0000000..f15fbcd Binary files /dev/null and b/public/assets/avatars1/擎苍.png differ diff --git a/public/assets/avatars1/文静毛毛.png b/public/assets/avatars1/文静毛毛.png new file mode 100644 index 0000000..1de5b34 Binary files /dev/null and b/public/assets/avatars1/文静毛毛.png differ diff --git a/public/assets/avatars1/斯文青年.png b/public/assets/avatars1/斯文青年.png new file mode 100644 index 0000000..0e74c92 Binary files /dev/null and b/public/assets/avatars1/斯文青年.png differ diff --git a/public/assets/avatars1/春日部姐姐.png b/public/assets/avatars1/春日部姐姐.png new file mode 100644 index 0000000..f2938ff Binary files /dev/null and b/public/assets/avatars1/春日部姐姐.png differ diff --git a/public/assets/avatars1/暖心体贴.png b/public/assets/avatars1/暖心体贴.png new file mode 100644 index 0000000..513f7f8 Binary files /dev/null and b/public/assets/avatars1/暖心体贴.png differ diff --git a/public/assets/avatars1/暖心学姐.png b/public/assets/avatars1/暖心学姐.png new file mode 100644 index 0000000..f559b04 Binary files /dev/null and b/public/assets/avatars1/暖心学姐.png differ diff --git a/public/assets/avatars1/暖心茜茜.png b/public/assets/avatars1/暖心茜茜.png new file mode 100644 index 0000000..d282918 Binary files /dev/null and b/public/assets/avatars1/暖心茜茜.png differ diff --git a/public/assets/avatars1/暖阳女声.png b/public/assets/avatars1/暖阳女声.png new file mode 100644 index 0000000..ddf370d Binary files /dev/null and b/public/assets/avatars1/暖阳女声.png differ diff --git a/public/assets/avatars1/机灵小伙.png b/public/assets/avatars1/机灵小伙.png new file mode 100644 index 0000000..6782a33 Binary files /dev/null and b/public/assets/avatars1/机灵小伙.png differ diff --git a/public/assets/avatars1/机甲智能.png b/public/assets/avatars1/机甲智能.png new file mode 100644 index 0000000..f3b83de Binary files /dev/null and b/public/assets/avatars1/机甲智能.png differ diff --git a/public/assets/avatars1/枕边低语.png b/public/assets/avatars1/枕边低语.png new file mode 100644 index 0000000..ac6834e Binary files /dev/null and b/public/assets/avatars1/枕边低语.png differ diff --git a/public/assets/avatars1/林潇.png b/public/assets/avatars1/林潇.png new file mode 100644 index 0000000..6f4bc3e Binary files /dev/null and b/public/assets/avatars1/林潇.png differ diff --git a/public/assets/avatars1/柔美女友.png b/public/assets/avatars1/柔美女友.png new file mode 100644 index 0000000..44c557e Binary files /dev/null and b/public/assets/avatars1/柔美女友.png differ diff --git a/public/assets/avatars1/柔骨魂师.png b/public/assets/avatars1/柔骨魂师.png new file mode 100644 index 0000000..e0edb4f Binary files /dev/null and b/public/assets/avatars1/柔骨魂师.png differ diff --git a/public/assets/avatars1/樱桃丸子.png b/public/assets/avatars1/樱桃丸子.png new file mode 100644 index 0000000..4976db1 Binary files /dev/null and b/public/assets/avatars1/樱桃丸子.png differ diff --git a/public/assets/avatars1/正直青年.png b/public/assets/avatars1/正直青年.png new file mode 100644 index 0000000..4b0e498 Binary files /dev/null and b/public/assets/avatars1/正直青年.png differ diff --git a/public/assets/avatars1/武则天.png b/public/assets/avatars1/武则天.png new file mode 100644 index 0000000..ae17d3b Binary files /dev/null and b/public/assets/avatars1/武则天.png differ diff --git a/public/assets/avatars1/沉稳优雅.png b/public/assets/avatars1/沉稳优雅.png new file mode 100644 index 0000000..700755a Binary files /dev/null and b/public/assets/avatars1/沉稳优雅.png differ diff --git a/public/assets/avatars1/沉稳明仔.png b/public/assets/avatars1/沉稳明仔.png new file mode 100644 index 0000000..0d4db8f Binary files /dev/null and b/public/assets/avatars1/沉稳明仔.png differ diff --git a/public/assets/avatars1/沪普男.png b/public/assets/avatars1/沪普男.png new file mode 100644 index 0000000..18a3b43 Binary files /dev/null and b/public/assets/avatars1/沪普男.png differ diff --git a/public/assets/avatars1/油腻大叔.png b/public/assets/avatars1/油腻大叔.png new file mode 100644 index 0000000..dd198cd Binary files /dev/null and b/public/assets/avatars1/油腻大叔.png differ diff --git a/public/assets/avatars1/洒脱青年.png b/public/assets/avatars1/洒脱青年.png new file mode 100644 index 0000000..d905b36 Binary files /dev/null and b/public/assets/avatars1/洒脱青年.png differ diff --git a/public/assets/avatars1/活力小哥.png b/public/assets/avatars1/活力小哥.png new file mode 100644 index 0000000..9f593b6 Binary files /dev/null and b/public/assets/avatars1/活力小哥.png differ diff --git a/public/assets/avatars1/活力青年.png b/public/assets/avatars1/活力青年.png new file mode 100644 index 0000000..c76ed74 Binary files /dev/null and b/public/assets/avatars1/活力青年.png differ diff --git a/public/assets/avatars1/活泼刁蛮.png b/public/assets/avatars1/活泼刁蛮.png new file mode 100644 index 0000000..6950231 Binary files /dev/null and b/public/assets/avatars1/活泼刁蛮.png differ diff --git a/public/assets/avatars1/活泼女孩.png b/public/assets/avatars1/活泼女孩.png new file mode 100644 index 0000000..b4af701 Binary files /dev/null and b/public/assets/avatars1/活泼女孩.png differ diff --git a/public/assets/avatars1/活泼爽朗.png b/public/assets/avatars1/活泼爽朗.png new file mode 100644 index 0000000..66686ed Binary files /dev/null and b/public/assets/avatars1/活泼爽朗.png differ diff --git a/public/assets/avatars1/活泼男友.png b/public/assets/avatars1/活泼男友.png new file mode 100644 index 0000000..8732312 Binary files /dev/null and b/public/assets/avatars1/活泼男友.png differ diff --git a/public/assets/avatars1/浩宇小哥.png b/public/assets/avatars1/浩宇小哥.png new file mode 100644 index 0000000..5276d03 Binary files /dev/null and b/public/assets/avatars1/浩宇小哥.png differ diff --git a/public/assets/avatars1/深夜播客.png b/public/assets/avatars1/深夜播客.png new file mode 100644 index 0000000..1973a38 Binary files /dev/null and b/public/assets/avatars1/深夜播客.png differ diff --git a/public/assets/avatars1/深沉总裁.png b/public/assets/avatars1/深沉总裁.png new file mode 100644 index 0000000..44c100e Binary files /dev/null and b/public/assets/avatars1/深沉总裁.png differ diff --git a/public/assets/avatars1/清冷矜贵.png b/public/assets/avatars1/清冷矜贵.png new file mode 100644 index 0000000..d2bcc1a Binary files /dev/null and b/public/assets/avatars1/清冷矜贵.png differ diff --git a/public/assets/avatars1/清冷高雅.png b/public/assets/avatars1/清冷高雅.png new file mode 100644 index 0000000..5c40c96 Binary files /dev/null and b/public/assets/avatars1/清冷高雅.png differ diff --git a/public/assets/avatars1/清新女声.png b/public/assets/avatars1/清新女声.png new file mode 100644 index 0000000..331c3aa Binary files /dev/null and b/public/assets/avatars1/清新女声.png differ diff --git a/public/assets/avatars1/清新沐沐.png b/public/assets/avatars1/清新沐沐.png new file mode 100644 index 0000000..c5288d6 Binary files /dev/null and b/public/assets/avatars1/清新沐沐.png differ diff --git a/public/assets/avatars1/清新波波.png b/public/assets/avatars1/清新波波.png new file mode 100644 index 0000000..a3d5b66 Binary files /dev/null and b/public/assets/avatars1/清新波波.png differ diff --git a/public/assets/avatars1/清晰小雪.png b/public/assets/avatars1/清晰小雪.png new file mode 100644 index 0000000..38c8266 Binary files /dev/null and b/public/assets/avatars1/清晰小雪.png differ diff --git a/public/assets/avatars1/清朗温润.png b/public/assets/avatars1/清朗温润.png new file mode 100644 index 0000000..92fe5e3 Binary files /dev/null and b/public/assets/avatars1/清朗温润.png differ diff --git a/public/assets/avatars1/清澈梓梓.png b/public/assets/avatars1/清澈梓梓.png new file mode 100644 index 0000000..31863e6 Binary files /dev/null and b/public/assets/avatars1/清澈梓梓.png differ diff --git a/public/assets/avatars1/清爽少年.png b/public/assets/avatars1/清爽少年.png new file mode 100644 index 0000000..126245b Binary files /dev/null and b/public/assets/avatars1/清爽少年.png differ diff --git a/public/assets/avatars1/清爽男大.png b/public/assets/avatars1/清爽男大.png new file mode 100644 index 0000000..6e7c5fb Binary files /dev/null and b/public/assets/avatars1/清爽男大.png differ diff --git a/public/assets/avatars1/清甜桃桃.png b/public/assets/avatars1/清甜桃桃.png new file mode 100644 index 0000000..735f392 Binary files /dev/null and b/public/assets/avatars1/清甜桃桃.png differ diff --git a/public/assets/avatars1/清甜莓莓.png b/public/assets/avatars1/清甜莓莓.png new file mode 100644 index 0000000..bcf72e9 Binary files /dev/null and b/public/assets/avatars1/清甜莓莓.png differ diff --git a/public/assets/avatars1/清逸苏感.png b/public/assets/avatars1/清逸苏感.png new file mode 100644 index 0000000..3cb4840 Binary files /dev/null and b/public/assets/avatars1/清逸苏感.png differ diff --git a/public/assets/avatars1/渊博小叔.png b/public/assets/avatars1/渊博小叔.png new file mode 100644 index 0000000..4cfcb3f Binary files /dev/null and b/public/assets/avatars1/渊博小叔.png differ diff --git a/public/assets/avatars1/温婉珊珊.png b/public/assets/avatars1/温婉珊珊.png new file mode 100644 index 0000000..e5b34ef Binary files /dev/null and b/public/assets/avatars1/温婉珊珊.png differ diff --git a/public/assets/avatars1/温暖少年.png b/public/assets/avatars1/温暖少年.png new file mode 100644 index 0000000..056248b Binary files /dev/null and b/public/assets/avatars1/温暖少年.png differ diff --git a/public/assets/avatars1/温暖阿虎.png b/public/assets/avatars1/温暖阿虎.png new file mode 100644 index 0000000..13a760a Binary files /dev/null and b/public/assets/avatars1/温暖阿虎.png differ diff --git a/public/assets/avatars1/温柔内敛.png b/public/assets/avatars1/温柔内敛.png new file mode 100644 index 0000000..50aa28b Binary files /dev/null and b/public/assets/avatars1/温柔内敛.png differ diff --git a/public/assets/avatars1/温柔女神.png b/public/assets/avatars1/温柔女神.png new file mode 100644 index 0000000..ee39751 Binary files /dev/null and b/public/assets/avatars1/温柔女神.png differ diff --git a/public/assets/avatars1/温柔学长.png b/public/assets/avatars1/温柔学长.png new file mode 100644 index 0000000..e0b60ea Binary files /dev/null and b/public/assets/avatars1/温柔学长.png differ diff --git a/public/assets/avatars1/温柔小哥.png b/public/assets/avatars1/温柔小哥.png new file mode 100644 index 0000000..17d480d Binary files /dev/null and b/public/assets/avatars1/温柔小哥.png differ diff --git a/public/assets/avatars1/温柔小雅.png b/public/assets/avatars1/温柔小雅.png new file mode 100644 index 0000000..45add1f Binary files /dev/null and b/public/assets/avatars1/温柔小雅.png differ diff --git a/public/assets/avatars1/温柔文雅.png b/public/assets/avatars1/温柔文雅.png new file mode 100644 index 0000000..8336cd4 Binary files /dev/null and b/public/assets/avatars1/温柔文雅.png differ diff --git a/public/assets/avatars1/温柔淑女.png b/public/assets/avatars1/温柔淑女.png new file mode 100644 index 0000000..2223d62 Binary files /dev/null and b/public/assets/avatars1/温柔淑女.png differ diff --git a/public/assets/avatars1/温柔男友.png b/public/assets/avatars1/温柔男友.png new file mode 100644 index 0000000..f3a225c Binary files /dev/null and b/public/assets/avatars1/温柔男友.png differ diff --git a/public/assets/avatars1/温柔男同桌.png b/public/assets/avatars1/温柔男同桌.png new file mode 100644 index 0000000..1952d08 Binary files /dev/null and b/public/assets/avatars1/温柔男同桌.png differ diff --git a/public/assets/avatars1/温柔白月光.png b/public/assets/avatars1/温柔白月光.png new file mode 100644 index 0000000..346709f Binary files /dev/null and b/public/assets/avatars1/温柔白月光.png differ diff --git a/public/assets/avatars1/温润学者.png b/public/assets/avatars1/温润学者.png new file mode 100644 index 0000000..084479c Binary files /dev/null and b/public/assets/avatars1/温润学者.png differ diff --git a/public/assets/avatars1/温顺少年.png b/public/assets/avatars1/温顺少年.png new file mode 100644 index 0000000..78df864 Binary files /dev/null and b/public/assets/avatars1/温顺少年.png differ diff --git a/public/assets/avatars1/湾区大叔.png b/public/assets/avatars1/湾区大叔.png new file mode 100644 index 0000000..7c4f152 Binary files /dev/null and b/public/assets/avatars1/湾区大叔.png differ diff --git a/public/assets/avatars1/湾湾小何.png b/public/assets/avatars1/湾湾小何.png new file mode 100644 index 0000000..9110e34 Binary files /dev/null and b/public/assets/avatars1/湾湾小何.png differ diff --git a/public/assets/avatars1/潇洒随性.png b/public/assets/avatars1/潇洒随性.png new file mode 100644 index 0000000..25858e3 Binary files /dev/null and b/public/assets/avatars1/潇洒随性.png differ diff --git a/public/assets/avatars1/灵动欣欣.png b/public/assets/avatars1/灵动欣欣.png new file mode 100644 index 0000000..14e50b4 Binary files /dev/null and b/public/assets/avatars1/灵动欣欣.png differ diff --git a/public/assets/avatars1/灿灿.png b/public/assets/avatars1/灿灿.png new file mode 100644 index 0000000..b103c2a Binary files /dev/null and b/public/assets/avatars1/灿灿.png differ diff --git a/public/assets/avatars1/炀炀.png b/public/assets/avatars1/炀炀.png new file mode 100644 index 0000000..936cc34 --- /dev/null +++ b/public/assets/avatars1/炀炀.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"31a1db0b3d17cb0a6a0b3d17-ad25c9f","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/热情艾娜.png b/public/assets/avatars1/热情艾娜.png new file mode 100644 index 0000000..d8a10ce Binary files /dev/null and b/public/assets/avatars1/热情艾娜.png differ diff --git a/public/assets/avatars1/热血少年.png b/public/assets/avatars1/热血少年.png new file mode 100644 index 0000000..e173b5b Binary files /dev/null and b/public/assets/avatars1/热血少年.png differ diff --git a/public/assets/avatars1/熊二.png b/public/assets/avatars1/熊二.png new file mode 100644 index 0000000..579e719 Binary files /dev/null and b/public/assets/avatars1/熊二.png differ diff --git a/public/assets/avatars1/爽快思思.png b/public/assets/avatars1/爽快思思.png new file mode 100644 index 0000000..83ab3c5 Binary files /dev/null and b/public/assets/avatars1/爽快思思.png differ diff --git a/public/assets/avatars1/爽朗小阳.png b/public/assets/avatars1/爽朗小阳.png new file mode 100644 index 0000000..8d2601b Binary files /dev/null and b/public/assets/avatars1/爽朗小阳.png differ diff --git a/public/assets/avatars1/爽朗少年.png b/public/assets/avatars1/爽朗少年.png new file mode 100644 index 0000000..67f1c9a Binary files /dev/null and b/public/assets/avatars1/爽朗少年.png differ diff --git a/public/assets/avatars1/猪八戒.png b/public/assets/avatars1/猪八戒.png new file mode 100644 index 0000000..c8a9fab Binary files /dev/null and b/public/assets/avatars1/猪八戒.png differ diff --git a/public/assets/avatars1/猴哥.png b/public/assets/avatars1/猴哥.png new file mode 100644 index 0000000..7020ae7 Binary files /dev/null and b/public/assets/avatars1/猴哥.png differ diff --git a/public/assets/avatars1/率真小伙.png b/public/assets/avatars1/率真小伙.png new file mode 100644 index 0000000..2be04da Binary files /dev/null and b/public/assets/avatars1/率真小伙.png differ diff --git a/public/assets/avatars1/玲玲姐姐.png b/public/assets/avatars1/玲玲姐姐.png new file mode 100644 index 0000000..8382b35 Binary files /dev/null and b/public/assets/avatars1/玲玲姐姐.png differ diff --git a/public/assets/avatars1/理性圆子.png b/public/assets/avatars1/理性圆子.png new file mode 100644 index 0000000..504b4e0 Binary files /dev/null and b/public/assets/avatars1/理性圆子.png differ diff --git a/public/assets/avatars1/甜心小美.png b/public/assets/avatars1/甜心小美.png new file mode 100644 index 0000000..d7637c8 Binary files /dev/null and b/public/assets/avatars1/甜心小美.png differ diff --git a/public/assets/avatars1/甜系男友.png b/public/assets/avatars1/甜系男友.png new file mode 100644 index 0000000..37db348 Binary files /dev/null and b/public/assets/avatars1/甜系男友.png differ diff --git a/public/assets/avatars1/甜美娇俏.png b/public/assets/avatars1/甜美娇俏.png new file mode 100644 index 0000000..06b9567 Binary files /dev/null and b/public/assets/avatars1/甜美娇俏.png differ diff --git a/public/assets/avatars1/甜美小橘.png b/public/assets/avatars1/甜美小橘.png new file mode 100644 index 0000000..a25bf46 Binary files /dev/null and b/public/assets/avatars1/甜美小橘.png differ diff --git a/public/assets/avatars1/甜美小源.png b/public/assets/avatars1/甜美小源.png new file mode 100644 index 0000000..3c3f5fe Binary files /dev/null and b/public/assets/avatars1/甜美小源.png differ diff --git a/public/assets/avatars1/甜美小雨.png b/public/assets/avatars1/甜美小雨.png new file mode 100644 index 0000000..a419763 Binary files /dev/null and b/public/assets/avatars1/甜美小雨.png differ diff --git a/public/assets/avatars1/甜美悦悦.png b/public/assets/avatars1/甜美悦悦.png new file mode 100644 index 0000000..689f15d Binary files /dev/null and b/public/assets/avatars1/甜美悦悦.png differ diff --git a/public/assets/avatars1/甜美桃子.png b/public/assets/avatars1/甜美桃子.png new file mode 100644 index 0000000..94ae410 Binary files /dev/null and b/public/assets/avatars1/甜美桃子.png differ diff --git a/public/assets/avatars1/甜美活泼.png b/public/assets/avatars1/甜美活泼.png new file mode 100644 index 0000000..e22453d Binary files /dev/null and b/public/assets/avatars1/甜美活泼.png differ diff --git a/public/assets/avatars1/病娇哥哥.png b/public/assets/avatars1/病娇哥哥.png new file mode 100644 index 0000000..64d3ad0 Binary files /dev/null and b/public/assets/avatars1/病娇哥哥.png differ diff --git a/public/assets/avatars1/病娇姐姐.png b/public/assets/avatars1/病娇姐姐.png new file mode 100644 index 0000000..1ce0731 Binary files /dev/null and b/public/assets/avatars1/病娇姐姐.png differ diff --git a/public/assets/avatars1/病娇少年.png b/public/assets/avatars1/病娇少年.png new file mode 100644 index 0000000..f68d0c9 Binary files /dev/null and b/public/assets/avatars1/病娇少年.png differ diff --git a/public/assets/avatars1/病娇弟弟.png b/public/assets/avatars1/病娇弟弟.png new file mode 100644 index 0000000..2831429 Binary files /dev/null and b/public/assets/avatars1/病娇弟弟.png differ diff --git a/public/assets/avatars1/病娇男友.png b/public/assets/avatars1/病娇男友.png new file mode 100644 index 0000000..db70a69 Binary files /dev/null and b/public/assets/avatars1/病娇男友.png differ diff --git a/public/assets/avatars1/病娇白莲.png b/public/assets/avatars1/病娇白莲.png new file mode 100644 index 0000000..54fc9e6 Binary files /dev/null and b/public/assets/avatars1/病娇白莲.png differ diff --git a/public/assets/avatars1/病娇萌妹.png b/public/assets/avatars1/病娇萌妹.png new file mode 100644 index 0000000..6b7dd67 Binary files /dev/null and b/public/assets/avatars1/病娇萌妹.png differ diff --git a/public/assets/avatars1/病弱公子.png b/public/assets/avatars1/病弱公子.png new file mode 100644 index 0000000..882f329 Binary files /dev/null and b/public/assets/avatars1/病弱公子.png differ diff --git a/public/assets/avatars1/病弱少女.png b/public/assets/avatars1/病弱少女.png new file mode 100644 index 0000000..c5e4689 Binary files /dev/null and b/public/assets/avatars1/病弱少女.png differ diff --git a/public/assets/avatars1/病弱少年.png b/public/assets/avatars1/病弱少年.png new file mode 100644 index 0000000..1231e00 Binary files /dev/null and b/public/assets/avatars1/病弱少年.png differ diff --git a/public/assets/avatars1/直率英子.png b/public/assets/avatars1/直率英子.png new file mode 100644 index 0000000..e84b2b9 Binary files /dev/null and b/public/assets/avatars1/直率英子.png differ diff --git a/public/assets/avatars1/直率青年.png b/public/assets/avatars1/直率青年.png new file mode 100644 index 0000000..418428a Binary files /dev/null and b/public/assets/avatars1/直率青年.png differ diff --git a/public/assets/avatars1/知心姐姐.png b/public/assets/avatars1/知心姐姐.png new file mode 100644 index 0000000..744995b Binary files /dev/null and b/public/assets/avatars1/知心姐姐.png differ diff --git a/public/assets/avatars1/知性女声.png b/public/assets/avatars1/知性女声.png new file mode 100644 index 0000000..5b5d16b Binary files /dev/null and b/public/assets/avatars1/知性女声.png differ diff --git a/public/assets/avatars1/知性温婉.png b/public/assets/avatars1/知性温婉.png new file mode 100644 index 0000000..4016276 Binary files /dev/null and b/public/assets/avatars1/知性温婉.png differ diff --git a/public/assets/avatars1/磁性男嗓.png b/public/assets/avatars1/磁性男嗓.png new file mode 100644 index 0000000..a8429be Binary files /dev/null and b/public/assets/avatars1/磁性男嗓.png differ diff --git a/public/assets/avatars1/磁性解说男声.png b/public/assets/avatars1/磁性解说男声.png new file mode 100644 index 0000000..2937553 Binary files /dev/null and b/public/assets/avatars1/磁性解说男声.png differ diff --git a/public/assets/avatars1/神秘法师.png b/public/assets/avatars1/神秘法师.png new file mode 100644 index 0000000..90a0c50 Binary files /dev/null and b/public/assets/avatars1/神秘法师.png differ diff --git a/public/assets/avatars1/秀丽倩倩.png b/public/assets/avatars1/秀丽倩倩.png new file mode 100644 index 0000000..a2a2994 Binary files /dev/null and b/public/assets/avatars1/秀丽倩倩.png differ diff --git a/public/assets/avatars1/粘人男友.png b/public/assets/avatars1/粘人男友.png new file mode 100644 index 0000000..7030f29 Binary files /dev/null and b/public/assets/avatars1/粘人男友.png differ diff --git a/public/assets/avatars1/粤语小溏.png b/public/assets/avatars1/粤语小溏.png new file mode 100644 index 0000000..3f9f722 Binary files /dev/null and b/public/assets/avatars1/粤语小溏.png differ diff --git a/public/assets/avatars1/精灵向导.png b/public/assets/avatars1/精灵向导.png new file mode 100644 index 0000000..f6adb37 Binary files /dev/null and b/public/assets/avatars1/精灵向导.png differ diff --git a/public/assets/avatars1/精英青年.png b/public/assets/avatars1/精英青年.png new file mode 100644 index 0000000..bfc15c2 Binary files /dev/null and b/public/assets/avatars1/精英青年.png differ diff --git a/public/assets/avatars1/纯澈女生.png b/public/assets/avatars1/纯澈女生.png new file mode 100644 index 0000000..40dba21 Binary files /dev/null and b/public/assets/avatars1/纯澈女生.png differ diff --git a/public/assets/avatars1/纯真学弟.png b/public/assets/avatars1/纯真学弟.png new file mode 100644 index 0000000..db97fbc Binary files /dev/null and b/public/assets/avatars1/纯真学弟.png differ diff --git a/public/assets/avatars1/纯真少女.png b/public/assets/avatars1/纯真少女.png new file mode 100644 index 0000000..6d302a0 Binary files /dev/null and b/public/assets/avatars1/纯真少女.png differ diff --git a/public/assets/avatars1/绿茶小哥.png b/public/assets/avatars1/绿茶小哥.png new file mode 100644 index 0000000..d18f350 Binary files /dev/null and b/public/assets/avatars1/绿茶小哥.png differ diff --git a/public/assets/avatars1/翩翩公子.png b/public/assets/avatars1/翩翩公子.png new file mode 100644 index 0000000..b43cfe5 Binary files /dev/null and b/public/assets/avatars1/翩翩公子.png differ diff --git a/public/assets/avatars1/胡子叔叔.png b/public/assets/avatars1/胡子叔叔.png new file mode 100644 index 0000000..b6642f5 Binary files /dev/null and b/public/assets/avatars1/胡子叔叔.png differ diff --git a/public/assets/avatars1/腹黑公子.png b/public/assets/avatars1/腹黑公子.png new file mode 100644 index 0000000..0f6d490 Binary files /dev/null and b/public/assets/avatars1/腹黑公子.png differ diff --git a/public/assets/avatars1/自信青年.png b/public/assets/avatars1/自信青年.png new file mode 100644 index 0000000..56ac0ec Binary files /dev/null and b/public/assets/avatars1/自信青年.png differ diff --git a/public/assets/avatars1/自负青年.png b/public/assets/avatars1/自负青年.png new file mode 100644 index 0000000..fcbf3fa Binary files /dev/null and b/public/assets/avatars1/自负青年.png differ diff --git a/public/assets/avatars1/萌丫头.png b/public/assets/avatars1/萌丫头.png new file mode 100644 index 0000000..cd79596 Binary files /dev/null and b/public/assets/avatars1/萌丫头.png differ diff --git a/public/assets/avatars1/蓝银草魂师.png b/public/assets/avatars1/蓝银草魂师.png new file mode 100644 index 0000000..9a33e22 Binary files /dev/null and b/public/assets/avatars1/蓝银草魂师.png differ diff --git a/public/assets/avatars1/解说小明.png b/public/assets/avatars1/解说小明.png new file mode 100644 index 0000000..c087975 Binary files /dev/null and b/public/assets/avatars1/解说小明.png differ diff --git a/public/assets/avatars1/诡异神秘.png b/public/assets/avatars1/诡异神秘.png new file mode 100644 index 0000000..6e3ec26 Binary files /dev/null and b/public/assets/avatars1/诡异神秘.png differ diff --git a/public/assets/avatars1/调皮公主.png b/public/assets/avatars1/调皮公主.png new file mode 100644 index 0000000..85b54cc Binary files /dev/null and b/public/assets/avatars1/调皮公主.png differ diff --git a/public/assets/avatars1/谄媚女声.png b/public/assets/avatars1/谄媚女声.png new file mode 100644 index 0000000..ecad0ed Binary files /dev/null and b/public/assets/avatars1/谄媚女声.png differ diff --git a/public/assets/avatars1/豫州子轩.png b/public/assets/avatars1/豫州子轩.png new file mode 100644 index 0000000..f041c94 Binary files /dev/null and b/public/assets/avatars1/豫州子轩.png differ diff --git a/public/assets/avatars1/贴心女友.png b/public/assets/avatars1/贴心女友.png new file mode 100644 index 0000000..2105d60 Binary files /dev/null and b/public/assets/avatars1/贴心女友.png differ diff --git a/public/assets/avatars1/贴心女声.png b/public/assets/avatars1/贴心女声.png new file mode 100644 index 0000000..0ec9b50 Binary files /dev/null and b/public/assets/avatars1/贴心女声.png differ diff --git a/public/assets/avatars1/贴心妹妹.png b/public/assets/avatars1/贴心妹妹.png new file mode 100644 index 0000000..ae6db98 Binary files /dev/null and b/public/assets/avatars1/贴心妹妹.png differ diff --git a/public/assets/avatars1/贴心男友.png b/public/assets/avatars1/贴心男友.png new file mode 100644 index 0000000..b907900 Binary files /dev/null and b/public/assets/avatars1/贴心男友.png differ diff --git a/public/assets/avatars1/贴心闺蜜.png b/public/assets/avatars1/贴心闺蜜.png new file mode 100644 index 0000000..9c89d29 Binary files /dev/null and b/public/assets/avatars1/贴心闺蜜.png differ diff --git a/public/assets/avatars1/软萌团子.png b/public/assets/avatars1/软萌团子.png new file mode 100644 index 0000000..d2837e2 Binary files /dev/null and b/public/assets/avatars1/软萌团子.png differ diff --git a/public/assets/avatars1/软萌糖糖.png b/public/assets/avatars1/软萌糖糖.png new file mode 100644 index 0000000..1b7b37f Binary files /dev/null and b/public/assets/avatars1/软萌糖糖.png differ diff --git a/public/assets/avatars1/轻盈朵朵.png b/public/assets/avatars1/轻盈朵朵.png new file mode 100644 index 0000000..1c4070d Binary files /dev/null and b/public/assets/avatars1/轻盈朵朵.png differ diff --git a/public/assets/avatars1/邪魅女王.png b/public/assets/avatars1/邪魅女王.png new file mode 100644 index 0000000..1e078dd Binary files /dev/null and b/public/assets/avatars1/邪魅女王.png differ diff --git a/public/assets/avatars1/邪魅御姐.png b/public/assets/avatars1/邪魅御姐.png new file mode 100644 index 0000000..d8f6b16 Binary files /dev/null and b/public/assets/avatars1/邪魅御姐.png differ diff --git a/public/assets/avatars1/邻家女孩.png b/public/assets/avatars1/邻家女孩.png new file mode 100644 index 0000000..079ac0d Binary files /dev/null and b/public/assets/avatars1/邻家女孩.png differ diff --git a/public/assets/avatars1/邻家男孩.png b/public/assets/avatars1/邻家男孩.png new file mode 100644 index 0000000..59533c3 Binary files /dev/null and b/public/assets/avatars1/邻家男孩.png differ diff --git a/public/assets/avatars1/邻居阿姨.png b/public/assets/avatars1/邻居阿姨.png new file mode 100644 index 0000000..7f3d7d9 Binary files /dev/null and b/public/assets/avatars1/邻居阿姨.png differ diff --git a/public/assets/avatars1/醇厚低音.png b/public/assets/avatars1/醇厚低音.png new file mode 100644 index 0000000..908cb8a Binary files /dev/null and b/public/assets/avatars1/醇厚低音.png differ diff --git a/public/assets/avatars1/醋精男友.png b/public/assets/avatars1/醋精男友.png new file mode 100644 index 0000000..abc4400 Binary files /dev/null and b/public/assets/avatars1/醋精男友.png differ diff --git a/public/assets/avatars1/醋精男生.png b/public/assets/avatars1/醋精男生.png new file mode 100644 index 0000000..9464940 Binary files /dev/null and b/public/assets/avatars1/醋精男生.png differ diff --git a/public/assets/avatars1/闷油瓶小哥.png b/public/assets/avatars1/闷油瓶小哥.png new file mode 100644 index 0000000..9144684 Binary files /dev/null and b/public/assets/avatars1/闷油瓶小哥.png differ diff --git a/public/assets/avatars1/阳光洋洋.png b/public/assets/avatars1/阳光洋洋.png new file mode 100644 index 0000000..4091f9e Binary files /dev/null and b/public/assets/avatars1/阳光洋洋.png differ diff --git a/public/assets/avatars1/阳光阿辰.png b/public/assets/avatars1/阳光阿辰.png new file mode 100644 index 0000000..cfd34ba Binary files /dev/null and b/public/assets/avatars1/阳光阿辰.png differ diff --git a/public/assets/avatars1/阳光青年.png b/public/assets/avatars1/阳光青年.png new file mode 100644 index 0000000..d004cbb Binary files /dev/null and b/public/assets/avatars1/阳光青年.png differ diff --git a/public/assets/avatars1/霸气青叔.png b/public/assets/avatars1/霸气青叔.png new file mode 100644 index 0000000..18229ed Binary files /dev/null and b/public/assets/avatars1/霸气青叔.png differ diff --git a/public/assets/avatars1/霸道少爷.png b/public/assets/avatars1/霸道少爷.png new file mode 100644 index 0000000..8c66947 Binary files /dev/null and b/public/assets/avatars1/霸道少爷.png differ diff --git a/public/assets/avatars1/霸道总裁.png b/public/assets/avatars1/霸道总裁.png new file mode 100644 index 0000000..834b0dc Binary files /dev/null and b/public/assets/avatars1/霸道总裁.png differ diff --git a/public/assets/avatars1/青涩小生.png b/public/assets/avatars1/青涩小生.png new file mode 100644 index 0000000..056fe38 Binary files /dev/null and b/public/assets/avatars1/青涩小生.png differ diff --git a/public/assets/avatars1/青涩青年.png b/public/assets/avatars1/青涩青年.png new file mode 100644 index 0000000..7f754b3 Binary files /dev/null and b/public/assets/avatars1/青涩青年.png differ diff --git a/public/assets/avatars1/顾姐.png b/public/assets/avatars1/顾姐.png new file mode 100644 index 0000000..936b4ec Binary files /dev/null and b/public/assets/avatars1/顾姐.png differ diff --git a/public/assets/avatars1/风发少年.png b/public/assets/avatars1/风发少年.png new file mode 100644 index 0000000..1b8cb3d Binary files /dev/null and b/public/assets/avatars1/风发少年.png differ diff --git a/public/assets/avatars1/高冷御姐.png b/public/assets/avatars1/高冷御姐.png new file mode 100644 index 0000000..87e88f9 Binary files /dev/null and b/public/assets/avatars1/高冷御姐.png differ diff --git a/public/assets/avatars1/高冷总裁.png b/public/assets/avatars1/高冷总裁.png new file mode 100644 index 0000000..62140e7 Binary files /dev/null and b/public/assets/avatars1/高冷总裁.png differ diff --git a/public/assets/avatars1/高冷沉稳.png b/public/assets/avatars1/高冷沉稳.png new file mode 100644 index 0000000..8a5c5dd --- /dev/null +++ b/public/assets/avatars1/高冷沉稳.png @@ -0,0 +1 @@ +{"Success":-1,"error":{"code":4008,"request_id":"122300b3d221afe6a0b3d22-a0ea119","message":"The specified key does not exist.","ec":"0017-00000003","recommend_doc":"https://cloud.bytedance.net/docs/tos/docs/64db3bc855f10602a14c81dc/671f54f792fb7b0328303157"}} \ No newline at end of file diff --git a/public/assets/avatars1/魅力女友.png b/public/assets/avatars1/魅力女友.png new file mode 100644 index 0000000..0489d7e Binary files /dev/null and b/public/assets/avatars1/魅力女友.png differ diff --git a/public/assets/avatars1/魅力苏菲.png b/public/assets/avatars1/魅力苏菲.png new file mode 100644 index 0000000..d68b122 Binary files /dev/null and b/public/assets/avatars1/魅力苏菲.png differ diff --git a/public/assets/avatars1/鲁班七号.png b/public/assets/avatars1/鲁班七号.png new file mode 100644 index 0000000..8fa26cc Binary files /dev/null and b/public/assets/avatars1/鲁班七号.png differ diff --git a/public/assets/avatars1/鸡汤妹妹.png b/public/assets/avatars1/鸡汤妹妹.png new file mode 100644 index 0000000..788bcc4 Binary files /dev/null and b/public/assets/avatars1/鸡汤妹妹.png differ diff --git a/public/assets/avatars1/黯刃秦主.png b/public/assets/avatars1/黯刃秦主.png new file mode 100644 index 0000000..a274015 Binary files /dev/null and b/public/assets/avatars1/黯刃秦主.png differ diff --git a/public/assets/avatars2/Dacey.png b/public/assets/avatars2/Dacey.png new file mode 100644 index 0000000..289df79 Binary files /dev/null and b/public/assets/avatars2/Dacey.png differ diff --git a/public/assets/avatars2/Stokie.png b/public/assets/avatars2/Stokie.png new file mode 100644 index 0000000..0288603 Binary files /dev/null and b/public/assets/avatars2/Stokie.png differ diff --git a/public/assets/avatars2/TVB女声.png b/public/assets/avatars2/TVB女声.png new file mode 100644 index 0000000..1f26077 Binary files /dev/null and b/public/assets/avatars2/TVB女声.png differ diff --git a/public/assets/avatars2/Tina老师.png b/public/assets/avatars2/Tina老师.png new file mode 100644 index 0000000..a414167 Binary files /dev/null and b/public/assets/avatars2/Tina老师.png differ diff --git a/public/assets/avatars2/Vivi.png b/public/assets/avatars2/Vivi.png new file mode 100644 index 0000000..c6fdaae Binary files /dev/null and b/public/assets/avatars2/Vivi.png differ diff --git a/public/assets/avatars2/东方浩然.png b/public/assets/avatars2/东方浩然.png new file mode 100644 index 0000000..3387988 Binary files /dev/null and b/public/assets/avatars2/东方浩然.png differ diff --git a/public/assets/avatars2/云舟.png b/public/assets/avatars2/云舟.png new file mode 100644 index 0000000..10b5055 Binary files /dev/null and b/public/assets/avatars2/云舟.png differ diff --git a/public/assets/avatars2/亮嗓萌仔.png b/public/assets/avatars2/亮嗓萌仔.png new file mode 100644 index 0000000..d1128e7 Binary files /dev/null and b/public/assets/avatars2/亮嗓萌仔.png differ diff --git a/public/assets/avatars2/亲切女声.png b/public/assets/avatars2/亲切女声.png new file mode 100644 index 0000000..78d62f2 Binary files /dev/null and b/public/assets/avatars2/亲切女声.png differ diff --git a/public/assets/avatars2/佩奇猪.png b/public/assets/avatars2/佩奇猪.png new file mode 100644 index 0000000..09a6028 Binary files /dev/null and b/public/assets/avatars2/佩奇猪.png differ diff --git a/public/assets/avatars2/俏皮女声.png b/public/assets/avatars2/俏皮女声.png new file mode 100644 index 0000000..cc2df8d Binary files /dev/null and b/public/assets/avatars2/俏皮女声.png differ diff --git a/public/assets/avatars2/傲娇霸总.png b/public/assets/avatars2/傲娇霸总.png new file mode 100644 index 0000000..3bf2531 Binary files /dev/null and b/public/assets/avatars2/傲娇霸总.png differ diff --git a/public/assets/avatars2/儒雅逸辰.png b/public/assets/avatars2/儒雅逸辰.png new file mode 100644 index 0000000..0f85b50 Binary files /dev/null and b/public/assets/avatars2/儒雅逸辰.png differ diff --git a/public/assets/avatars2/儒雅青年.png b/public/assets/avatars2/儒雅青年.png new file mode 100644 index 0000000..6be500d Binary files /dev/null and b/public/assets/avatars2/儒雅青年.png differ diff --git a/public/assets/avatars2/儿童绘本.png b/public/assets/avatars2/儿童绘本.png new file mode 100644 index 0000000..3b0b765 Binary files /dev/null and b/public/assets/avatars2/儿童绘本.png differ diff --git a/public/assets/avatars2/刘飞.png b/public/assets/avatars2/刘飞.png new file mode 100644 index 0000000..45f0d6b Binary files /dev/null and b/public/assets/avatars2/刘飞.png differ diff --git a/public/assets/avatars2/反卷青年.png b/public/assets/avatars2/反卷青年.png new file mode 100644 index 0000000..47abbef Binary files /dev/null and b/public/assets/avatars2/反卷青年.png differ diff --git a/public/assets/avatars2/可爱女生.png b/public/assets/avatars2/可爱女生.png new file mode 100644 index 0000000..190e880 Binary files /dev/null and b/public/assets/avatars2/可爱女生.png differ diff --git a/public/assets/avatars2/唐僧.png b/public/assets/avatars2/唐僧.png new file mode 100644 index 0000000..f2ce137 Binary files /dev/null and b/public/assets/avatars2/唐僧.png differ diff --git a/public/assets/avatars2/四郎.png b/public/assets/avatars2/四郎.png new file mode 100644 index 0000000..2c979f3 Binary files /dev/null and b/public/assets/avatars2/四郎.png differ diff --git a/public/assets/avatars2/大壹.png b/public/assets/avatars2/大壹.png new file mode 100644 index 0000000..4ff4bca Binary files /dev/null and b/public/assets/avatars2/大壹.png differ diff --git a/public/assets/avatars2/天才同桌.png b/public/assets/avatars2/天才同桌.png new file mode 100644 index 0000000..a68b32f Binary files /dev/null and b/public/assets/avatars2/天才同桌.png differ diff --git a/public/assets/avatars2/天才童声.png b/public/assets/avatars2/天才童声.png new file mode 100644 index 0000000..4f67b4e Binary files /dev/null and b/public/assets/avatars2/天才童声.png differ diff --git a/public/assets/avatars2/女雷神.png b/public/assets/avatars2/女雷神.png new file mode 100644 index 0000000..cf18620 Binary files /dev/null and b/public/assets/avatars2/女雷神.png differ diff --git a/public/assets/avatars2/奶气萌娃.png b/public/assets/avatars2/奶气萌娃.png new file mode 100644 index 0000000..c43f6a5 Binary files /dev/null and b/public/assets/avatars2/奶气萌娃.png differ diff --git a/public/assets/avatars2/娇喘女声.png b/public/assets/avatars2/娇喘女声.png new file mode 100644 index 0000000..64e520b Binary files /dev/null and b/public/assets/avatars2/娇喘女声.png differ diff --git a/public/assets/avatars2/婆婆.png b/public/assets/avatars2/婆婆.png new file mode 100644 index 0000000..abe737b Binary files /dev/null and b/public/assets/avatars2/婆婆.png differ diff --git a/public/assets/avatars2/小天.png b/public/assets/avatars2/小天.png new file mode 100644 index 0000000..cb21c49 Binary files /dev/null and b/public/assets/avatars2/小天.png differ diff --git a/public/assets/avatars2/少儿故事.png b/public/assets/avatars2/少儿故事.png new file mode 100644 index 0000000..f9d154e Binary files /dev/null and b/public/assets/avatars2/少儿故事.png differ diff --git a/public/assets/avatars2/少年梓辛.png b/public/assets/avatars2/少年梓辛.png new file mode 100644 index 0000000..12c3df8 Binary files /dev/null and b/public/assets/avatars2/少年梓辛.png differ diff --git a/public/assets/avatars2/广告解说.png b/public/assets/avatars2/广告解说.png new file mode 100644 index 0000000..74fc48a Binary files /dev/null and b/public/assets/avatars2/广告解说.png differ diff --git a/public/assets/avatars2/庄周.png b/public/assets/avatars2/庄周.png new file mode 100644 index 0000000..da206a5 Binary files /dev/null and b/public/assets/avatars2/庄周.png differ diff --git a/public/assets/avatars2/开朗姐姐.png b/public/assets/avatars2/开朗姐姐.png new file mode 100644 index 0000000..6792444 Binary files /dev/null and b/public/assets/avatars2/开朗姐姐.png differ diff --git a/public/assets/avatars2/开朗学长.png b/public/assets/avatars2/开朗学长.png new file mode 100644 index 0000000..caacee4 Binary files /dev/null and b/public/assets/avatars2/开朗学长.png differ diff --git a/public/assets/avatars2/开朗弟弟.png b/public/assets/avatars2/开朗弟弟.png new file mode 100644 index 0000000..a83a482 Binary files /dev/null and b/public/assets/avatars2/开朗弟弟.png differ diff --git a/public/assets/avatars2/心灵鸡汤.png b/public/assets/avatars2/心灵鸡汤.png new file mode 100644 index 0000000..6d0e30b Binary files /dev/null and b/public/assets/avatars2/心灵鸡汤.png differ diff --git a/public/assets/avatars2/快乐小东.png b/public/assets/avatars2/快乐小东.png new file mode 100644 index 0000000..5475bff Binary files /dev/null and b/public/assets/avatars2/快乐小东.png differ diff --git a/public/assets/avatars2/悠悠君子.png b/public/assets/avatars2/悠悠君子.png new file mode 100644 index 0000000..122728a Binary files /dev/null and b/public/assets/avatars2/悠悠君子.png differ diff --git a/public/assets/avatars2/悬疑解说.png b/public/assets/avatars2/悬疑解说.png new file mode 100644 index 0000000..db614c4 Binary files /dev/null and b/public/assets/avatars2/悬疑解说.png differ diff --git a/public/assets/avatars2/感冒电音姐姐.png b/public/assets/avatars2/感冒电音姐姐.png new file mode 100644 index 0000000..f565038 Binary files /dev/null and b/public/assets/avatars2/感冒电音姐姐.png differ diff --git a/public/assets/avatars2/懒音绵宝.png b/public/assets/avatars2/懒音绵宝.png new file mode 100644 index 0000000..33a726b Binary files /dev/null and b/public/assets/avatars2/懒音绵宝.png differ diff --git a/public/assets/avatars2/撒娇学妹.png b/public/assets/avatars2/撒娇学妹.png new file mode 100644 index 0000000..cfff77b Binary files /dev/null and b/public/assets/avatars2/撒娇学妹.png differ diff --git a/public/assets/avatars2/擎苍.png b/public/assets/avatars2/擎苍.png new file mode 100644 index 0000000..f15fbcd Binary files /dev/null and b/public/assets/avatars2/擎苍.png differ diff --git a/public/assets/avatars2/文静毛毛.png b/public/assets/avatars2/文静毛毛.png new file mode 100644 index 0000000..1de5b34 Binary files /dev/null and b/public/assets/avatars2/文静毛毛.png differ diff --git a/public/assets/avatars2/春日部姐姐.png b/public/assets/avatars2/春日部姐姐.png new file mode 100644 index 0000000..f2938ff Binary files /dev/null and b/public/assets/avatars2/春日部姐姐.png differ diff --git a/public/assets/avatars2/暖阳女声.png b/public/assets/avatars2/暖阳女声.png new file mode 100644 index 0000000..ddf370d Binary files /dev/null and b/public/assets/avatars2/暖阳女声.png differ diff --git a/public/assets/avatars2/林潇.png b/public/assets/avatars2/林潇.png new file mode 100644 index 0000000..6f4bc3e Binary files /dev/null and b/public/assets/avatars2/林潇.png differ diff --git a/public/assets/avatars2/柔美女友.png b/public/assets/avatars2/柔美女友.png new file mode 100644 index 0000000..44c557e Binary files /dev/null and b/public/assets/avatars2/柔美女友.png differ diff --git a/public/assets/avatars2/樱桃丸子.png b/public/assets/avatars2/樱桃丸子.png new file mode 100644 index 0000000..4976db1 Binary files /dev/null and b/public/assets/avatars2/樱桃丸子.png differ diff --git a/public/assets/avatars2/武则天.png b/public/assets/avatars2/武则天.png new file mode 100644 index 0000000..ae17d3b Binary files /dev/null and b/public/assets/avatars2/武则天.png differ diff --git a/public/assets/avatars2/活力小哥.png b/public/assets/avatars2/活力小哥.png new file mode 100644 index 0000000..9f593b6 Binary files /dev/null and b/public/assets/avatars2/活力小哥.png differ diff --git a/public/assets/avatars2/流畅女声.png b/public/assets/avatars2/流畅女声.png new file mode 100644 index 0000000..d89e826 Binary files /dev/null and b/public/assets/avatars2/流畅女声.png differ diff --git a/public/assets/avatars2/深夜播客.png b/public/assets/avatars2/深夜播客.png new file mode 100644 index 0000000..1973a38 Binary files /dev/null and b/public/assets/avatars2/深夜播客.png differ diff --git a/public/assets/avatars2/清新女声.png b/public/assets/avatars2/清新女声.png new file mode 100644 index 0000000..331c3aa Binary files /dev/null and b/public/assets/avatars2/清新女声.png differ diff --git a/public/assets/avatars2/清新沐沐.png b/public/assets/avatars2/清新沐沐.png new file mode 100644 index 0000000..c5288d6 Binary files /dev/null and b/public/assets/avatars2/清新沐沐.png differ diff --git a/public/assets/avatars2/清澈梓梓.png b/public/assets/avatars2/清澈梓梓.png new file mode 100644 index 0000000..31863e6 Binary files /dev/null and b/public/assets/avatars2/清澈梓梓.png differ diff --git a/public/assets/avatars2/清爽男大.png b/public/assets/avatars2/清爽男大.png new file mode 100644 index 0000000..6e7c5fb Binary files /dev/null and b/public/assets/avatars2/清爽男大.png differ diff --git a/public/assets/avatars2/渊博小叔.png b/public/assets/avatars2/渊博小叔.png new file mode 100644 index 0000000..4cfcb3f Binary files /dev/null and b/public/assets/avatars2/渊博小叔.png differ diff --git a/public/assets/avatars2/温婉珊珊.png b/public/assets/avatars2/温婉珊珊.png new file mode 100644 index 0000000..e5b34ef Binary files /dev/null and b/public/assets/avatars2/温婉珊珊.png differ diff --git a/public/assets/avatars2/温暖阿虎.png b/public/assets/avatars2/温暖阿虎.png new file mode 100644 index 0000000..13a760a Binary files /dev/null and b/public/assets/avatars2/温暖阿虎.png differ diff --git a/public/assets/avatars2/温柔小哥.png b/public/assets/avatars2/温柔小哥.png new file mode 100644 index 0000000..17d480d Binary files /dev/null and b/public/assets/avatars2/温柔小哥.png differ diff --git a/public/assets/avatars2/温柔小雅.png b/public/assets/avatars2/温柔小雅.png new file mode 100644 index 0000000..45add1f Binary files /dev/null and b/public/assets/avatars2/温柔小雅.png differ diff --git a/public/assets/avatars2/温柔淑女.png b/public/assets/avatars2/温柔淑女.png new file mode 100644 index 0000000..2223d62 Binary files /dev/null and b/public/assets/avatars2/温柔淑女.png differ diff --git a/public/assets/avatars2/湾湾小何.png b/public/assets/avatars2/湾湾小何.png new file mode 100644 index 0000000..9110e34 Binary files /dev/null and b/public/assets/avatars2/湾湾小何.png differ diff --git a/public/assets/avatars2/灿灿.png b/public/assets/avatars2/灿灿.png new file mode 100644 index 0000000..b103c2a Binary files /dev/null and b/public/assets/avatars2/灿灿.png differ diff --git a/public/assets/avatars2/热情艾娜.png b/public/assets/avatars2/热情艾娜.png new file mode 100644 index 0000000..d8a10ce Binary files /dev/null and b/public/assets/avatars2/热情艾娜.png differ diff --git a/public/assets/avatars2/熊二.png b/public/assets/avatars2/熊二.png new file mode 100644 index 0000000..579e719 Binary files /dev/null and b/public/assets/avatars2/熊二.png differ diff --git a/public/assets/avatars2/爽快思思.png b/public/assets/avatars2/爽快思思.png new file mode 100644 index 0000000..83ab3c5 Binary files /dev/null and b/public/assets/avatars2/爽快思思.png differ diff --git a/public/assets/avatars2/爽朗少年.png b/public/assets/avatars2/爽朗少年.png new file mode 100644 index 0000000..67f1c9a Binary files /dev/null and b/public/assets/avatars2/爽朗少年.png differ diff --git a/public/assets/avatars2/猪八戒.png b/public/assets/avatars2/猪八戒.png new file mode 100644 index 0000000..c8a9fab Binary files /dev/null and b/public/assets/avatars2/猪八戒.png differ diff --git a/public/assets/avatars2/猴哥.png b/public/assets/avatars2/猴哥.png new file mode 100644 index 0000000..7020ae7 Binary files /dev/null and b/public/assets/avatars2/猴哥.png differ diff --git a/public/assets/avatars2/玲玲姐姐.png b/public/assets/avatars2/玲玲姐姐.png new file mode 100644 index 0000000..8382b35 Binary files /dev/null and b/public/assets/avatars2/玲玲姐姐.png differ diff --git a/public/assets/avatars2/甜美小源.png b/public/assets/avatars2/甜美小源.png new file mode 100644 index 0000000..3c3f5fe Binary files /dev/null and b/public/assets/avatars2/甜美小源.png differ diff --git a/public/assets/avatars2/甜美悦悦.png b/public/assets/avatars2/甜美悦悦.png new file mode 100644 index 0000000..689f15d Binary files /dev/null and b/public/assets/avatars2/甜美悦悦.png differ diff --git a/public/assets/avatars2/甜美桃子.png b/public/assets/avatars2/甜美桃子.png new file mode 100644 index 0000000..94ae410 Binary files /dev/null and b/public/assets/avatars2/甜美桃子.png differ diff --git a/public/assets/avatars2/直率英子.png b/public/assets/avatars2/直率英子.png new file mode 100644 index 0000000..e84b2b9 Binary files /dev/null and b/public/assets/avatars2/直率英子.png differ diff --git a/public/assets/avatars2/知性女声.png b/public/assets/avatars2/知性女声.png new file mode 100644 index 0000000..5b5d16b Binary files /dev/null and b/public/assets/avatars2/知性女声.png differ diff --git a/public/assets/avatars2/磁性解说男声.png b/public/assets/avatars2/磁性解说男声.png new file mode 100644 index 0000000..2937553 Binary files /dev/null and b/public/assets/avatars2/磁性解说男声.png differ diff --git a/public/assets/avatars2/萌丫头.png b/public/assets/avatars2/萌丫头.png new file mode 100644 index 0000000..cd79596 Binary files /dev/null and b/public/assets/avatars2/萌丫头.png differ diff --git a/public/assets/avatars2/解说小明.png b/public/assets/avatars2/解说小明.png new file mode 100644 index 0000000..c087975 Binary files /dev/null and b/public/assets/avatars2/解说小明.png differ diff --git a/public/assets/avatars2/译制片男.png b/public/assets/avatars2/译制片男.png new file mode 100644 index 0000000..97da8ca Binary files /dev/null and b/public/assets/avatars2/译制片男.png differ diff --git a/public/assets/avatars2/调皮公主.png b/public/assets/avatars2/调皮公主.png new file mode 100644 index 0000000..85b54cc Binary files /dev/null and b/public/assets/avatars2/调皮公主.png differ diff --git a/public/assets/avatars2/谄媚女声.png b/public/assets/avatars2/谄媚女声.png new file mode 100644 index 0000000..ecad0ed Binary files /dev/null and b/public/assets/avatars2/谄媚女声.png differ diff --git a/public/assets/avatars2/贴心女声.png b/public/assets/avatars2/贴心女声.png new file mode 100644 index 0000000..0ec9b50 Binary files /dev/null and b/public/assets/avatars2/贴心女声.png differ diff --git a/public/assets/avatars2/轻盈朵朵.png b/public/assets/avatars2/轻盈朵朵.png new file mode 100644 index 0000000..1c4070d Binary files /dev/null and b/public/assets/avatars2/轻盈朵朵.png differ diff --git a/public/assets/avatars2/邻家女孩.png b/public/assets/avatars2/邻家女孩.png new file mode 100644 index 0000000..079ac0d Binary files /dev/null and b/public/assets/avatars2/邻家女孩.png differ diff --git a/public/assets/avatars2/邻家男孩.png b/public/assets/avatars2/邻家男孩.png new file mode 100644 index 0000000..59533c3 Binary files /dev/null and b/public/assets/avatars2/邻家男孩.png differ diff --git a/public/assets/avatars2/阳光青年.png b/public/assets/avatars2/阳光青年.png new file mode 100644 index 0000000..d004cbb Binary files /dev/null and b/public/assets/avatars2/阳光青年.png differ diff --git a/public/assets/avatars2/霸气青叔.png b/public/assets/avatars2/霸气青叔.png new file mode 100644 index 0000000..18229ed Binary files /dev/null and b/public/assets/avatars2/霸气青叔.png differ diff --git a/public/assets/avatars2/顾姐.png b/public/assets/avatars2/顾姐.png new file mode 100644 index 0000000..936b4ec Binary files /dev/null and b/public/assets/avatars2/顾姐.png differ diff --git a/public/assets/avatars2/高冷御姐.png b/public/assets/avatars2/高冷御姐.png new file mode 100644 index 0000000..87e88f9 Binary files /dev/null and b/public/assets/avatars2/高冷御姐.png differ diff --git a/public/assets/avatars2/魅力女友.png b/public/assets/avatars2/魅力女友.png new file mode 100644 index 0000000..0489d7e Binary files /dev/null and b/public/assets/avatars2/魅力女友.png differ diff --git a/public/assets/avatars2/魅力苏菲.png b/public/assets/avatars2/魅力苏菲.png new file mode 100644 index 0000000..d68b122 Binary files /dev/null and b/public/assets/avatars2/魅力苏菲.png differ diff --git a/public/assets/avatars2/鲁班七号.png b/public/assets/avatars2/鲁班七号.png new file mode 100644 index 0000000..8fa26cc Binary files /dev/null and b/public/assets/avatars2/鲁班七号.png differ diff --git a/public/assets/avatars2/鸡汤女.png b/public/assets/avatars2/鸡汤女.png new file mode 100644 index 0000000..ac571af Binary files /dev/null and b/public/assets/avatars2/鸡汤女.png differ diff --git a/public/assets/avatars2/鸡汤妹妹.png b/public/assets/avatars2/鸡汤妹妹.png new file mode 100644 index 0000000..788bcc4 Binary files /dev/null and b/public/assets/avatars2/鸡汤妹妹.png differ diff --git a/public/assets/avatars2/黑猫侦探社咪仔.png b/public/assets/avatars2/黑猫侦探社咪仔.png new file mode 100644 index 0000000..9d86b0c Binary files /dev/null and b/public/assets/avatars2/黑猫侦探社咪仔.png differ diff --git a/public/assets/editor-images/404.png b/public/assets/editor-images/404.png new file mode 100644 index 0000000..0d419fa Binary files /dev/null and b/public/assets/editor-images/404.png differ diff --git a/public/assets/editor-images/animation.png b/public/assets/editor-images/animation.png new file mode 100644 index 0000000..e7f86c9 Binary files /dev/null and b/public/assets/editor-images/animation.png differ diff --git a/public/assets/editor-images/favicon.ico b/public/assets/editor-images/favicon.ico new file mode 100644 index 0000000..41e5fc5 Binary files /dev/null and b/public/assets/editor-images/favicon.ico differ diff --git a/public/assets/editor-images/img-null.png b/public/assets/editor-images/img-null.png new file mode 100644 index 0000000..5fa83b1 Binary files /dev/null and b/public/assets/editor-images/img-null.png differ diff --git a/public/assets/effect-images/adjustment.png b/public/assets/effect-images/adjustment.png new file mode 100644 index 0000000..5aaa423 Binary files /dev/null and b/public/assets/effect-images/adjustment.png differ diff --git a/public/assets/effect-images/advanced-bloom.png b/public/assets/effect-images/advanced-bloom.png new file mode 100644 index 0000000..d8232bb Binary files /dev/null and b/public/assets/effect-images/advanced-bloom.png differ diff --git a/public/assets/effect-images/alpha.png b/public/assets/effect-images/alpha.png new file mode 100644 index 0000000..039713a Binary files /dev/null and b/public/assets/effect-images/alpha.png differ diff --git a/public/assets/effect-images/ascii.png b/public/assets/effect-images/ascii.png new file mode 100644 index 0000000..f9dbec4 Binary files /dev/null and b/public/assets/effect-images/ascii.png differ diff --git a/public/assets/effect-images/backdrop-blur.png b/public/assets/effect-images/backdrop-blur.png new file mode 100644 index 0000000..a408d96 Binary files /dev/null and b/public/assets/effect-images/backdrop-blur.png differ diff --git a/public/assets/effect-images/bevel.png b/public/assets/effect-images/bevel.png new file mode 100644 index 0000000..246cfa5 Binary files /dev/null and b/public/assets/effect-images/bevel.png differ diff --git a/public/assets/effect-images/bloom.png b/public/assets/effect-images/bloom.png new file mode 100644 index 0000000..2dbee6d Binary files /dev/null and b/public/assets/effect-images/bloom.png differ diff --git a/public/assets/effect-images/blur.png b/public/assets/effect-images/blur.png new file mode 100644 index 0000000..c8669ed Binary files /dev/null and b/public/assets/effect-images/blur.png differ diff --git a/public/assets/effect-images/bulge-pinch.png b/public/assets/effect-images/bulge-pinch.png new file mode 100644 index 0000000..fd6dd7a Binary files /dev/null and b/public/assets/effect-images/bulge-pinch.png differ diff --git a/public/assets/effect-images/color-gradient.png b/public/assets/effect-images/color-gradient.png new file mode 100644 index 0000000..8a86ed5 Binary files /dev/null and b/public/assets/effect-images/color-gradient.png differ diff --git a/public/assets/effect-images/color-map.png b/public/assets/effect-images/color-map.png new file mode 100644 index 0000000..2add555 Binary files /dev/null and b/public/assets/effect-images/color-map.png differ diff --git a/public/assets/effect-images/color-overlay.png b/public/assets/effect-images/color-overlay.png new file mode 100644 index 0000000..8b1d51b Binary files /dev/null and b/public/assets/effect-images/color-overlay.png differ diff --git a/public/assets/effect-images/color-replace.png b/public/assets/effect-images/color-replace.png new file mode 100644 index 0000000..8de98dd Binary files /dev/null and b/public/assets/effect-images/color-replace.png differ diff --git a/public/assets/effect-images/convolution.png b/public/assets/effect-images/convolution.png new file mode 100644 index 0000000..19d6564 Binary files /dev/null and b/public/assets/effect-images/convolution.png differ diff --git a/public/assets/effect-images/cross-hatch.png b/public/assets/effect-images/cross-hatch.png new file mode 100644 index 0000000..321edbb Binary files /dev/null and b/public/assets/effect-images/cross-hatch.png differ diff --git a/public/assets/effect-images/crt.png b/public/assets/effect-images/crt.png new file mode 100644 index 0000000..174cd29 Binary files /dev/null and b/public/assets/effect-images/crt.png differ diff --git a/public/assets/effect-images/displacement.png b/public/assets/effect-images/displacement.png new file mode 100644 index 0000000..b1530f5 Binary files /dev/null and b/public/assets/effect-images/displacement.png differ diff --git a/public/assets/effect-images/dot.png b/public/assets/effect-images/dot.png new file mode 100644 index 0000000..54dc578 Binary files /dev/null and b/public/assets/effect-images/dot.png differ diff --git a/public/assets/effect-images/drop-shadow.png b/public/assets/effect-images/drop-shadow.png new file mode 100644 index 0000000..034a753 Binary files /dev/null and b/public/assets/effect-images/drop-shadow.png differ diff --git a/public/assets/effect-images/emboss.png b/public/assets/effect-images/emboss.png new file mode 100644 index 0000000..8dca628 Binary files /dev/null and b/public/assets/effect-images/emboss.png differ diff --git a/public/assets/effect-images/glitch.png b/public/assets/effect-images/glitch.png new file mode 100644 index 0000000..caa3631 Binary files /dev/null and b/public/assets/effect-images/glitch.png differ diff --git a/public/assets/effect-images/glow.png b/public/assets/effect-images/glow.png new file mode 100644 index 0000000..89f787c Binary files /dev/null and b/public/assets/effect-images/glow.png differ diff --git a/public/assets/effect-images/godray.png b/public/assets/effect-images/godray.png new file mode 100644 index 0000000..00da768 Binary files /dev/null and b/public/assets/effect-images/godray.png differ diff --git a/public/assets/effect-images/grayscale.png b/public/assets/effect-images/grayscale.png new file mode 100644 index 0000000..992843b Binary files /dev/null and b/public/assets/effect-images/grayscale.png differ diff --git a/public/assets/effect-images/hsl-adjustment.png b/public/assets/effect-images/hsl-adjustment.png new file mode 100644 index 0000000..33bcb5c Binary files /dev/null and b/public/assets/effect-images/hsl-adjustment.png differ diff --git a/public/assets/effect-images/kawase-blur.png b/public/assets/effect-images/kawase-blur.png new file mode 100644 index 0000000..64a3da7 Binary files /dev/null and b/public/assets/effect-images/kawase-blur.png differ diff --git a/public/assets/effect-images/motion-blur.png b/public/assets/effect-images/motion-blur.png new file mode 100644 index 0000000..6b652d4 Binary files /dev/null and b/public/assets/effect-images/motion-blur.png differ diff --git a/public/assets/effect-images/multi-color-replace.png b/public/assets/effect-images/multi-color-replace.png new file mode 100644 index 0000000..35e740b Binary files /dev/null and b/public/assets/effect-images/multi-color-replace.png differ diff --git a/public/assets/effect-images/noise.png b/public/assets/effect-images/noise.png new file mode 100644 index 0000000..5deb891 Binary files /dev/null and b/public/assets/effect-images/noise.png differ diff --git a/public/assets/effect-images/old-film.png b/public/assets/effect-images/old-film.png new file mode 100644 index 0000000..72567d0 Binary files /dev/null and b/public/assets/effect-images/old-film.png differ diff --git a/public/assets/effect-images/outline.png b/public/assets/effect-images/outline.png new file mode 100644 index 0000000..fab6902 Binary files /dev/null and b/public/assets/effect-images/outline.png differ diff --git a/public/assets/effect-images/pixelate.png b/public/assets/effect-images/pixelate.png new file mode 100644 index 0000000..47e684c Binary files /dev/null and b/public/assets/effect-images/pixelate.png differ diff --git a/public/assets/effect-images/radial-blur.png b/public/assets/effect-images/radial-blur.png new file mode 100644 index 0000000..c415ae9 Binary files /dev/null and b/public/assets/effect-images/radial-blur.png differ diff --git a/public/assets/effect-images/reflection.png b/public/assets/effect-images/reflection.png new file mode 100644 index 0000000..c7a033b Binary files /dev/null and b/public/assets/effect-images/reflection.png differ diff --git a/public/assets/effect-images/rgb.png b/public/assets/effect-images/rgb.png new file mode 100644 index 0000000..e40457f Binary files /dev/null and b/public/assets/effect-images/rgb.png differ diff --git a/public/assets/effect-images/shockwave.png b/public/assets/effect-images/shockwave.png new file mode 100644 index 0000000..e1dc314 Binary files /dev/null and b/public/assets/effect-images/shockwave.png differ diff --git a/public/assets/effect-images/simple-lightmap.png b/public/assets/effect-images/simple-lightmap.png new file mode 100644 index 0000000..3b908dd Binary files /dev/null and b/public/assets/effect-images/simple-lightmap.png differ diff --git a/public/assets/effect-images/simplex-noise.png b/public/assets/effect-images/simplex-noise.png new file mode 100644 index 0000000..8f98126 Binary files /dev/null and b/public/assets/effect-images/simplex-noise.png differ diff --git a/public/assets/effect-images/tilt-shift.png b/public/assets/effect-images/tilt-shift.png new file mode 100644 index 0000000..0d020c8 Binary files /dev/null and b/public/assets/effect-images/tilt-shift.png differ diff --git a/public/assets/effect-images/twist.png b/public/assets/effect-images/twist.png new file mode 100644 index 0000000..2164f92 Binary files /dev/null and b/public/assets/effect-images/twist.png differ diff --git a/public/assets/effect-images/zoom-blur.png b/public/assets/effect-images/zoom-blur.png new file mode 100644 index 0000000..1b21b26 Binary files /dev/null and b/public/assets/effect-images/zoom-blur.png differ diff --git a/public/assets/images/B站.png b/public/assets/images/B站.png new file mode 100644 index 0000000..e40834e Binary files /dev/null and b/public/assets/images/B站.png differ diff --git a/public/assets/images/aiqiyi.png b/public/assets/images/aiqiyi.png new file mode 100644 index 0000000..006c230 Binary files /dev/null and b/public/assets/images/aiqiyi.png differ diff --git a/public/assets/images/arrow.png b/public/assets/images/arrow.png new file mode 100644 index 0000000..497dafb Binary files /dev/null and b/public/assets/images/arrow.png differ diff --git a/public/assets/images/bgcolor.jpg b/public/assets/images/bgcolor.jpg new file mode 100644 index 0000000..583353a Binary files /dev/null and b/public/assets/images/bgcolor.jpg differ diff --git a/public/assets/images/home.png b/public/assets/images/home.png new file mode 100644 index 0000000..65468db Binary files /dev/null and b/public/assets/images/home.png differ diff --git a/public/assets/images/ico1.png b/public/assets/images/ico1.png new file mode 100644 index 0000000..4ebd041 Binary files /dev/null and b/public/assets/images/ico1.png differ diff --git a/public/assets/images/ico2.png b/public/assets/images/ico2.png new file mode 100644 index 0000000..e641f39 Binary files /dev/null and b/public/assets/images/ico2.png differ diff --git a/public/assets/images/ico3.png b/public/assets/images/ico3.png new file mode 100644 index 0000000..db87399 Binary files /dev/null and b/public/assets/images/ico3.png differ diff --git a/public/assets/images/ico4.png b/public/assets/images/ico4.png new file mode 100644 index 0000000..2b1338f Binary files /dev/null and b/public/assets/images/ico4.png differ diff --git a/public/assets/images/ico5.png b/public/assets/images/ico5.png new file mode 100644 index 0000000..711f26a Binary files /dev/null and b/public/assets/images/ico5.png differ diff --git a/public/assets/images/ico6.png b/public/assets/images/ico6.png new file mode 100644 index 0000000..83d70bc Binary files /dev/null and b/public/assets/images/ico6.png differ diff --git a/public/assets/images/ico7.png b/public/assets/images/ico7.png new file mode 100644 index 0000000..db966ac Binary files /dev/null and b/public/assets/images/ico7.png differ diff --git a/public/assets/images/ico8.png b/public/assets/images/ico8.png new file mode 100644 index 0000000..dcc6edd Binary files /dev/null and b/public/assets/images/ico8.png differ diff --git a/public/assets/images/img-null.png b/public/assets/images/img-null.png new file mode 100644 index 0000000..5fa83b1 Binary files /dev/null and b/public/assets/images/img-null.png differ diff --git a/public/assets/images/kpy.png b/public/assets/images/kpy.png new file mode 100644 index 0000000..7bfb091 Binary files /dev/null and b/public/assets/images/kpy.png differ diff --git a/public/assets/images/logo-black.svg b/public/assets/images/logo-black.svg new file mode 100644 index 0000000..9ed065a --- /dev/null +++ b/public/assets/images/logo-black.svg @@ -0,0 +1,17 @@ + + + + logo-black + Created with Sketch. + + \ No newline at end of file diff --git a/public/assets/images/logob-en.png b/public/assets/images/logob-en.png new file mode 100644 index 0000000..641e2f1 Binary files /dev/null and b/public/assets/images/logob-en.png differ diff --git a/public/assets/images/logob.png b/public/assets/images/logob.png new file mode 100644 index 0000000..02c70cc Binary files /dev/null and b/public/assets/images/logob.png differ diff --git a/public/assets/images/logow-en.png b/public/assets/images/logow-en.png new file mode 100644 index 0000000..b11f697 Binary files /dev/null and b/public/assets/images/logow-en.png differ diff --git a/public/assets/images/logow.png b/public/assets/images/logow.png new file mode 100644 index 0000000..7ca2f66 Binary files /dev/null and b/public/assets/images/logow.png differ diff --git a/public/assets/images/man1.png b/public/assets/images/man1.png new file mode 100644 index 0000000..70ea65e Binary files /dev/null and b/public/assets/images/man1.png differ diff --git a/public/assets/images/man2.png b/public/assets/images/man2.png new file mode 100644 index 0000000..41a63b4 Binary files /dev/null and b/public/assets/images/man2.png differ diff --git a/public/assets/images/man3.png b/public/assets/images/man3.png new file mode 100644 index 0000000..4b7c10f Binary files /dev/null and b/public/assets/images/man3.png differ diff --git a/public/assets/images/man4.png b/public/assets/images/man4.png new file mode 100644 index 0000000..7d84793 Binary files /dev/null and b/public/assets/images/man4.png differ diff --git a/public/assets/images/pc.png b/public/assets/images/pc.png new file mode 100644 index 0000000..c0037b2 Binary files /dev/null and b/public/assets/images/pc.png differ diff --git a/public/assets/images/qrcode.png b/public/assets/images/qrcode.png new file mode 100644 index 0000000..47d48a7 Binary files /dev/null and b/public/assets/images/qrcode.png differ diff --git a/public/assets/images/user.png b/public/assets/images/user.png new file mode 100644 index 0000000..2a0cd01 Binary files /dev/null and b/public/assets/images/user.png differ diff --git a/public/assets/images/userbg.png b/public/assets/images/userbg.png new file mode 100644 index 0000000..283f8c5 Binary files /dev/null and b/public/assets/images/userbg.png differ diff --git a/public/assets/images/ytkd.png b/public/assets/images/ytkd.png new file mode 100644 index 0000000..1660bcb Binary files /dev/null and b/public/assets/images/ytkd.png differ diff --git a/public/assets/images/zgdx.png b/public/assets/images/zgdx.png new file mode 100644 index 0000000..1bdce2a Binary files /dev/null and b/public/assets/images/zgdx.png differ diff --git a/public/assets/images/zgyd.png b/public/assets/images/zgyd.png new file mode 100644 index 0000000..77a5abe Binary files /dev/null and b/public/assets/images/zgyd.png differ diff --git a/public/assets/images/zsyh.png b/public/assets/images/zsyh.png new file mode 100644 index 0000000..163d7c8 Binary files /dev/null and b/public/assets/images/zsyh.png differ diff --git a/public/assets/images/优酷.png b/public/assets/images/优酷.png new file mode 100644 index 0000000..9702aef Binary files /dev/null and b/public/assets/images/优酷.png differ diff --git a/public/assets/images/快手.png b/public/assets/images/快手.png new file mode 100644 index 0000000..e3c5265 Binary files /dev/null and b/public/assets/images/快手.png differ diff --git a/public/assets/images/抖音.png b/public/assets/images/抖音.png new file mode 100644 index 0000000..5f5aef2 Binary files /dev/null and b/public/assets/images/抖音.png differ diff --git a/public/assets/images/腾讯视频.png b/public/assets/images/腾讯视频.png new file mode 100644 index 0000000..7a2dfaf Binary files /dev/null and b/public/assets/images/腾讯视频.png differ diff --git a/public/assets/lut-images/bearch.png b/public/assets/lut-images/bearch.png new file mode 100644 index 0000000..21b7af3 Binary files /dev/null and b/public/assets/lut-images/bearch.png differ diff --git a/public/assets/lut-images/candlelight.png b/public/assets/lut-images/candlelight.png new file mode 100644 index 0000000..128b848 Binary files /dev/null and b/public/assets/lut-images/candlelight.png differ diff --git a/public/assets/lut-images/clean.png b/public/assets/lut-images/clean.png new file mode 100644 index 0000000..8b41ba3 Binary files /dev/null and b/public/assets/lut-images/clean.png differ diff --git a/public/assets/lut-images/coral.png b/public/assets/lut-images/coral.png new file mode 100644 index 0000000..92aca62 Binary files /dev/null and b/public/assets/lut-images/coral.png differ diff --git a/public/assets/lut-images/crisp_warm.png b/public/assets/lut-images/crisp_warm.png new file mode 100644 index 0000000..2347bd1 Binary files /dev/null and b/public/assets/lut-images/crisp_warm.png differ diff --git a/public/assets/lut-images/delicious.png b/public/assets/lut-images/delicious.png new file mode 100644 index 0000000..835a209 Binary files /dev/null and b/public/assets/lut-images/delicious.png differ diff --git a/public/assets/lut-images/drop_blues.png b/public/assets/lut-images/drop_blues.png new file mode 100644 index 0000000..b525bf8 Binary files /dev/null and b/public/assets/lut-images/drop_blues.png differ diff --git a/public/assets/lut-images/edgy_amber.png b/public/assets/lut-images/edgy_amber.png new file mode 100644 index 0000000..c142a2e Binary files /dev/null and b/public/assets/lut-images/edgy_amber.png differ diff --git a/public/assets/lut-images/filmstock_50.png b/public/assets/lut-images/filmstock_50.png new file mode 100644 index 0000000..5bd2d4c Binary files /dev/null and b/public/assets/lut-images/filmstock_50.png differ diff --git a/public/assets/lut-images/first_love.png b/public/assets/lut-images/first_love.png new file mode 100644 index 0000000..206f782 Binary files /dev/null and b/public/assets/lut-images/first_love.png differ diff --git a/public/assets/lut-images/foggy_night.png b/public/assets/lut-images/foggy_night.png new file mode 100644 index 0000000..c8a23cc Binary files /dev/null and b/public/assets/lut-images/foggy_night.png differ diff --git a/public/assets/lut-images/forest.png b/public/assets/lut-images/forest.png new file mode 100644 index 0000000..0b4d34f Binary files /dev/null and b/public/assets/lut-images/forest.png differ diff --git a/public/assets/lut-images/fresh.png b/public/assets/lut-images/fresh.png new file mode 100644 index 0000000..c5e278c Binary files /dev/null and b/public/assets/lut-images/fresh.png differ diff --git a/public/assets/lut-images/fuji_eterna_250d_fuji_3510.png b/public/assets/lut-images/fuji_eterna_250d_fuji_3510.png new file mode 100644 index 0000000..715b626 Binary files /dev/null and b/public/assets/lut-images/fuji_eterna_250d_fuji_3510.png differ diff --git a/public/assets/lut-images/fuji_eterna_250d_kodak_2395.png b/public/assets/lut-images/fuji_eterna_250d_kodak_2395.png new file mode 100644 index 0000000..ddd85db Binary files /dev/null and b/public/assets/lut-images/fuji_eterna_250d_kodak_2395.png differ diff --git a/public/assets/lut-images/fuji_f125_kodak_2393.png b/public/assets/lut-images/fuji_f125_kodak_2393.png new file mode 100644 index 0000000..f75d5b7 Binary files /dev/null and b/public/assets/lut-images/fuji_f125_kodak_2393.png differ diff --git a/public/assets/lut-images/fuji_f125_kodak_2395.png b/public/assets/lut-images/fuji_f125_kodak_2395.png new file mode 100644 index 0000000..c8d9e17 Binary files /dev/null and b/public/assets/lut-images/fuji_f125_kodak_2395.png differ diff --git a/public/assets/lut-images/fuji_reala_500d_kodak_2393.png b/public/assets/lut-images/fuji_reala_500d_kodak_2393.png new file mode 100644 index 0000000..cfbc8d6 Binary files /dev/null and b/public/assets/lut-images/fuji_reala_500d_kodak_2393.png differ diff --git a/public/assets/lut-images/futuristic_bleak.png b/public/assets/lut-images/futuristic_bleak.png new file mode 100644 index 0000000..4797068 Binary files /dev/null and b/public/assets/lut-images/futuristic_bleak.png differ diff --git a/public/assets/lut-images/glossy.png b/public/assets/lut-images/glossy.png new file mode 100644 index 0000000..be73fa6 Binary files /dev/null and b/public/assets/lut-images/glossy.png differ diff --git a/public/assets/lut-images/grass.png b/public/assets/lut-images/grass.png new file mode 100644 index 0000000..6228dbb Binary files /dev/null and b/public/assets/lut-images/grass.png differ diff --git a/public/assets/lut-images/hackmanite.png b/public/assets/lut-images/hackmanite.png new file mode 100644 index 0000000..b2c2b2b Binary files /dev/null and b/public/assets/lut-images/hackmanite.png differ diff --git a/public/assets/lut-images/herderite.png b/public/assets/lut-images/herderite.png new file mode 100644 index 0000000..b84c67c Binary files /dev/null and b/public/assets/lut-images/herderite.png differ diff --git a/public/assets/lut-images/heulandite.png b/public/assets/lut-images/heulandite.png new file mode 100644 index 0000000..557337f Binary files /dev/null and b/public/assets/lut-images/heulandite.png differ diff --git a/public/assets/lut-images/hiddenite.png b/public/assets/lut-images/hiddenite.png new file mode 100644 index 0000000..f888787 Binary files /dev/null and b/public/assets/lut-images/hiddenite.png differ diff --git a/public/assets/lut-images/hilutite.png b/public/assets/lut-images/hilutite.png new file mode 100644 index 0000000..4fc2715 Binary files /dev/null and b/public/assets/lut-images/hilutite.png differ diff --git a/public/assets/lut-images/holiday.png b/public/assets/lut-images/holiday.png new file mode 100644 index 0000000..6f89163 Binary files /dev/null and b/public/assets/lut-images/holiday.png differ diff --git a/public/assets/lut-images/horror_blue.png b/public/assets/lut-images/horror_blue.png new file mode 100644 index 0000000..e3f7849 Binary files /dev/null and b/public/assets/lut-images/horror_blue.png differ diff --git a/public/assets/lut-images/howlite.png b/public/assets/lut-images/howlite.png new file mode 100644 index 0000000..2feeba2 Binary files /dev/null and b/public/assets/lut-images/howlite.png differ diff --git a/public/assets/lut-images/hypersthene.png b/public/assets/lut-images/hypersthene.png new file mode 100644 index 0000000..a9ade85 Binary files /dev/null and b/public/assets/lut-images/hypersthene.png differ diff --git a/public/assets/lut-images/icream.png b/public/assets/lut-images/icream.png new file mode 100644 index 0000000..962a9f8 Binary files /dev/null and b/public/assets/lut-images/icream.png differ diff --git a/public/assets/lut-images/infra-false-color.png b/public/assets/lut-images/infra-false-color.png new file mode 100644 index 0000000..b945039 Binary files /dev/null and b/public/assets/lut-images/infra-false-color.png differ diff --git a/public/assets/lut-images/jugeng.png b/public/assets/lut-images/jugeng.png new file mode 100644 index 0000000..dbe5c6b Binary files /dev/null and b/public/assets/lut-images/jugeng.png differ diff --git a/public/assets/lut-images/kisskiss.png b/public/assets/lut-images/kisskiss.png new file mode 100644 index 0000000..f2010e9 Binary files /dev/null and b/public/assets/lut-images/kisskiss.png differ diff --git a/public/assets/lut-images/kodak_5218_kodak_2383.png b/public/assets/lut-images/kodak_5218_kodak_2383.png new file mode 100644 index 0000000..1918680 Binary files /dev/null and b/public/assets/lut-images/kodak_5218_kodak_2383.png differ diff --git a/public/assets/lut-images/kodak_5218_kodak_2395.png b/public/assets/lut-images/kodak_5218_kodak_2395.png new file mode 100644 index 0000000..3ac1819 Binary files /dev/null and b/public/assets/lut-images/kodak_5218_kodak_2395.png differ diff --git a/public/assets/lut-images/kodak_5295_fuji_3510.png b/public/assets/lut-images/kodak_5295_fuji_3510.png new file mode 100644 index 0000000..a06ef1a Binary files /dev/null and b/public/assets/lut-images/kodak_5295_fuji_3510.png differ diff --git a/public/assets/lut-images/late_sunset.png b/public/assets/lut-images/late_sunset.png new file mode 100644 index 0000000..0f6a528 Binary files /dev/null and b/public/assets/lut-images/late_sunset.png differ diff --git a/public/assets/lut-images/lolita.png b/public/assets/lut-images/lolita.png new file mode 100644 index 0000000..878fef3 Binary files /dev/null and b/public/assets/lut-images/lolita.png differ diff --git a/public/assets/lut-images/lookup_B612-breeze.png b/public/assets/lut-images/lookup_B612-breeze.png new file mode 100644 index 0000000..6c6b9a9 Binary files /dev/null and b/public/assets/lut-images/lookup_B612-breeze.png differ diff --git a/public/assets/lut-images/lookup_B612-happy.png b/public/assets/lut-images/lookup_B612-happy.png new file mode 100644 index 0000000..8e7d597 Binary files /dev/null and b/public/assets/lut-images/lookup_B612-happy.png differ diff --git a/public/assets/lut-images/lookup_INS_17x-proII.png b/public/assets/lut-images/lookup_INS_17x-proII.png new file mode 100644 index 0000000..39a7bb4 Binary files /dev/null and b/public/assets/lut-images/lookup_INS_17x-proII.png differ diff --git a/public/assets/lut-images/lookup_INS_1clarendon.png b/public/assets/lut-images/lookup_INS_1clarendon.png new file mode 100644 index 0000000..04a0200 Binary files /dev/null and b/public/assets/lut-images/lookup_INS_1clarendon.png differ diff --git a/public/assets/lut-images/lookup_INS_23inkwell.png b/public/assets/lut-images/lookup_INS_23inkwell.png new file mode 100644 index 0000000..8e696dc Binary files /dev/null and b/public/assets/lut-images/lookup_INS_23inkwell.png differ diff --git a/public/assets/lut-images/lookup_INS_2gingham.png b/public/assets/lut-images/lookup_INS_2gingham.png new file mode 100644 index 0000000..3fdc8c9 Binary files /dev/null and b/public/assets/lut-images/lookup_INS_2gingham.png differ diff --git a/public/assets/lut-images/lookup_INS_3moon.png b/public/assets/lut-images/lookup_INS_3moon.png new file mode 100644 index 0000000..53dccc5 Binary files /dev/null and b/public/assets/lut-images/lookup_INS_3moon.png differ diff --git a/public/assets/lut-images/lookup_INS_4lark.png b/public/assets/lut-images/lookup_INS_4lark.png new file mode 100644 index 0000000..78d6648 Binary files /dev/null and b/public/assets/lut-images/lookup_INS_4lark.png differ diff --git a/public/assets/lut-images/lookup_INS_6juno.png b/public/assets/lut-images/lookup_INS_6juno.png new file mode 100644 index 0000000..b41f68a Binary files /dev/null and b/public/assets/lut-images/lookup_INS_6juno.png differ diff --git a/public/assets/lut-images/lookup_VSCO_T1.csp.png b/public/assets/lut-images/lookup_VSCO_T1.csp.png new file mode 100644 index 0000000..e9aa623 Binary files /dev/null and b/public/assets/lut-images/lookup_VSCO_T1.csp.png differ diff --git a/public/assets/lut-images/lookup_b612youth.png b/public/assets/lut-images/lookup_b612youth.png new file mode 100644 index 0000000..1d3fac7 Binary files /dev/null and b/public/assets/lut-images/lookup_b612youth.png differ diff --git a/public/assets/lut-images/lookup_foodie-tr3.png b/public/assets/lut-images/lookup_foodie-tr3.png new file mode 100644 index 0000000..19bfac5 Binary files /dev/null and b/public/assets/lut-images/lookup_foodie-tr3.png differ diff --git a/public/assets/lut-images/lookup_foodie-yum1.png b/public/assets/lut-images/lookup_foodie-yum1.png new file mode 100644 index 0000000..02c045c Binary files /dev/null and b/public/assets/lut-images/lookup_foodie-yum1.png differ diff --git a/public/assets/lut-images/lookup_foodie-yum2.png b/public/assets/lut-images/lookup_foodie-yum2.png new file mode 100644 index 0000000..a08c924 Binary files /dev/null and b/public/assets/lut-images/lookup_foodie-yum2.png differ diff --git a/public/assets/lut-images/lookup_meitu-ephemeral.png b/public/assets/lut-images/lookup_meitu-ephemeral.png new file mode 100644 index 0000000..50b45d6 Binary files /dev/null and b/public/assets/lut-images/lookup_meitu-ephemeral.png differ diff --git a/public/assets/lut-images/lookup_meitu-twilight.png b/public/assets/lut-images/lookup_meitu-twilight.png new file mode 100644 index 0000000..ca3d921 Binary files /dev/null and b/public/assets/lut-images/lookup_meitu-twilight.png differ diff --git a/public/assets/lut-images/lookup_table_64_light.png b/public/assets/lut-images/lookup_table_64_light.png new file mode 100644 index 0000000..6519b20 Binary files /dev/null and b/public/assets/lut-images/lookup_table_64_light.png differ diff --git a/public/assets/lut-images/lookup_vscocam.A6.png b/public/assets/lut-images/lookup_vscocam.A6.png new file mode 100644 index 0000000..ab5b786 Binary files /dev/null and b/public/assets/lut-images/lookup_vscocam.A6.png differ diff --git a/public/assets/lut-images/lookup_vscocam.F2.png b/public/assets/lut-images/lookup_vscocam.F2.png new file mode 100644 index 0000000..a168b39 Binary files /dev/null and b/public/assets/lut-images/lookup_vscocam.F2.png differ diff --git a/public/assets/lut-images/lookup_vscocam.HB1.png b/public/assets/lut-images/lookup_vscocam.HB1.png new file mode 100644 index 0000000..2644d06 Binary files /dev/null and b/public/assets/lut-images/lookup_vscocam.HB1.png differ diff --git a/public/assets/lut-images/makalong.png b/public/assets/lut-images/makalong.png new file mode 100644 index 0000000..fd1ba5e Binary files /dev/null and b/public/assets/lut-images/makalong.png differ diff --git a/public/assets/lut-images/moonlight.png b/public/assets/lut-images/moonlight.png new file mode 100644 index 0000000..59a630c Binary files /dev/null and b/public/assets/lut-images/moonlight.png differ diff --git a/public/assets/lut-images/music.png b/public/assets/lut-images/music.png new file mode 100644 index 0000000..42babb2 Binary files /dev/null and b/public/assets/lut-images/music.png differ diff --git a/public/assets/lut-images/nature.png b/public/assets/lut-images/nature.png new file mode 100644 index 0000000..784bac5 Binary files /dev/null and b/public/assets/lut-images/nature.png differ diff --git a/public/assets/lut-images/neutral.png b/public/assets/lut-images/neutral.png new file mode 100644 index 0000000..d43e0a8 Binary files /dev/null and b/public/assets/lut-images/neutral.png differ diff --git a/public/assets/lut-images/night_from_day.png b/public/assets/lut-images/night_from_day.png new file mode 100644 index 0000000..5a3ae9a Binary files /dev/null and b/public/assets/lut-images/night_from_day.png differ diff --git a/public/assets/lut-images/origin.png b/public/assets/lut-images/origin.png new file mode 100644 index 0000000..2a2ad12 Binary files /dev/null and b/public/assets/lut-images/origin.png differ diff --git a/public/assets/lut-images/oxygen.png b/public/assets/lut-images/oxygen.png new file mode 100644 index 0000000..2e1a168 Binary files /dev/null and b/public/assets/lut-images/oxygen.png differ diff --git a/public/assets/lut-images/pink.png b/public/assets/lut-images/pink.png new file mode 100644 index 0000000..a099d76 Binary files /dev/null and b/public/assets/lut-images/pink.png differ diff --git a/public/assets/lut-images/reds-only.png b/public/assets/lut-images/reds-only.png new file mode 100644 index 0000000..8d8bf00 Binary files /dev/null and b/public/assets/lut-images/reds-only.png differ diff --git a/public/assets/lut-images/remove-highlights.png b/public/assets/lut-images/remove-highlights.png new file mode 100644 index 0000000..c8f2765 Binary files /dev/null and b/public/assets/lut-images/remove-highlights.png differ diff --git a/public/assets/lut-images/snow.png b/public/assets/lut-images/snow.png new file mode 100644 index 0000000..80ffb84 Binary files /dev/null and b/public/assets/lut-images/snow.png differ diff --git a/public/assets/lut-images/solarize.png b/public/assets/lut-images/solarize.png new file mode 100644 index 0000000..3f7cec6 Binary files /dev/null and b/public/assets/lut-images/solarize.png differ diff --git a/public/assets/lut-images/sunset.png b/public/assets/lut-images/sunset.png new file mode 100644 index 0000000..edd4c5b Binary files /dev/null and b/public/assets/lut-images/sunset.png differ diff --git a/public/assets/lut-images/sweet.png b/public/assets/lut-images/sweet.png new file mode 100644 index 0000000..d499209 Binary files /dev/null and b/public/assets/lut-images/sweet.png differ diff --git a/public/assets/lut-images/sweety.png b/public/assets/lut-images/sweety.png new file mode 100644 index 0000000..f71edd1 Binary files /dev/null and b/public/assets/lut-images/sweety.png differ diff --git a/public/assets/lut-images/teal_orange_plus_contrast.png b/public/assets/lut-images/teal_orange_plus_contrast.png new file mode 100644 index 0000000..af3d87e Binary files /dev/null and b/public/assets/lut-images/teal_orange_plus_contrast.png differ diff --git a/public/assets/lut-images/tension_green.png b/public/assets/lut-images/tension_green.png new file mode 100644 index 0000000..994882d Binary files /dev/null and b/public/assets/lut-images/tension_green.png differ diff --git a/public/assets/lut-images/urban.png b/public/assets/lut-images/urban.png new file mode 100644 index 0000000..6164eb0 Binary files /dev/null and b/public/assets/lut-images/urban.png differ diff --git a/public/assets/lut-images/vintage.png b/public/assets/lut-images/vintage.png new file mode 100644 index 0000000..f963c1a Binary files /dev/null and b/public/assets/lut-images/vintage.png differ diff --git a/public/assets/lut-images/vivid.png b/public/assets/lut-images/vivid.png new file mode 100644 index 0000000..9dc3015 Binary files /dev/null and b/public/assets/lut-images/vivid.png differ diff --git a/public/assets/lut-images/xinxian.png b/public/assets/lut-images/xinxian.png new file mode 100644 index 0000000..d490971 Binary files /dev/null and b/public/assets/lut-images/xinxian.png differ diff --git a/public/assets/lut-images/yuanqi.png b/public/assets/lut-images/yuanqi.png new file mode 100644 index 0000000..fcc55fb Binary files /dev/null and b/public/assets/lut-images/yuanqi.png differ diff --git a/public/assets/mask/bianxing.png b/public/assets/mask/bianxing.png new file mode 100644 index 0000000..8743805 Binary files /dev/null and b/public/assets/mask/bianxing.png differ diff --git a/public/assets/mask/hear-full.png b/public/assets/mask/hear-full.png new file mode 100644 index 0000000..0202334 Binary files /dev/null and b/public/assets/mask/hear-full.png differ diff --git a/public/assets/mask/rect.png b/public/assets/mask/rect.png new file mode 100644 index 0000000..993e4f8 Binary files /dev/null and b/public/assets/mask/rect.png differ diff --git a/public/assets/mask/sanjiao.png b/public/assets/mask/sanjiao.png new file mode 100644 index 0000000..8e73d85 Binary files /dev/null and b/public/assets/mask/sanjiao.png differ diff --git a/public/assets/mask/shanxing.png b/public/assets/mask/shanxing.png new file mode 100644 index 0000000..ec3d159 Binary files /dev/null and b/public/assets/mask/shanxing.png differ diff --git a/public/assets/mask/star-full.png b/public/assets/mask/star-full.png new file mode 100644 index 0000000..47e468f Binary files /dev/null and b/public/assets/mask/star-full.png differ diff --git a/public/assets/mask/wubianxing.png b/public/assets/mask/wubianxing.png new file mode 100644 index 0000000..2fa85e3 Binary files /dev/null and b/public/assets/mask/wubianxing.png differ diff --git a/public/assets/mask/yuan.png b/public/assets/mask/yuan.png new file mode 100644 index 0000000..0635f2f Binary files /dev/null and b/public/assets/mask/yuan.png differ diff --git a/public/assets/medianinfo/index.js b/public/assets/medianinfo/index.js new file mode 100644 index 0000000..d863fdb --- /dev/null +++ b/public/assets/medianinfo/index.js @@ -0,0 +1,3494 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MediaInfo = {})); +})(this, (function (exports) { 'use strict'; + + function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; + } + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, + r, + i = _objectWithoutPropertiesLoose(e, t); + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); + } + return i; + } + function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + + function isError(error) { + return error !== null && typeof error === 'object' && Object.prototype.hasOwnProperty.call(error, 'message'); + } + function unknownToError(error) { + if (isError(error)) { + return error; + } + return new Error(typeof error === 'string' ? error : 'Unknown error'); + } + + // DO NOT EDIT! File generated using `generate-types` script. + + const INT_FIELDS = ['Active_Height', 'Active_Width', 'AudioCount', 'Audio_Channels_Total', 'BitDepth_Detected', 'BitDepth', 'BitDepth_Stored', 'Channels', 'Channels_Original', 'Chapters_Pos_Begin', 'Chapters_Pos_End', 'Comic_Position_Total', 'Count', 'DataSize', 'ElementCount', 'EPG_Positions_Begin', 'EPG_Positions_End', 'FirstPacketOrder', 'FooterSize', 'Format_Settings_GMC', 'Format_Settings_RefFrames', 'Format_Settings_SliceCount', 'FrameCount', 'FrameRate_Den', 'FrameRate_Num', 'GeneralCount', 'HeaderSize', 'Height_CleanAperture', 'Height', 'Height_Offset', 'Height_Original', 'ImageCount', 'Lines_MaxCharacterCount', 'Lines_MaxCountPerEvent', 'Matrix_Channels', 'MenuCount', 'OtherCount', 'Part_Position', 'Part_Position_Total', 'Played_Count', 'Reel_Position', 'Reel_Position_Total', 'Resolution', 'Sampled_Height', 'Sampled_Width', 'SamplingCount', 'Season_Position', 'Season_Position_Total', 'Source_FrameCount', 'Source_SamplingCount', 'Source_StreamSize_Encoded', 'Source_StreamSize', 'Status', 'Stored_Height', 'Stored_Width', 'StreamCount', 'StreamKindID', 'StreamKindPos', 'StreamSize_Demuxed', 'StreamSize_Encoded', 'StreamSize', 'TextCount', 'Track_Position', 'Track_Position_Total', 'Video0_Delay', 'VideoCount', 'Width_CleanAperture', 'Width', 'Width_Offset', 'Width_Original']; + const FLOAT_FIELDS = ['Active_DisplayAspectRatio', 'BitRate_Encoded', 'BitRate_Maximum', 'BitRate_Minimum', 'BitRate', 'BitRate_Nominal', 'Bits-Pixel_Frame', 'BitsPixel_Frame', 'Compression_Ratio', 'Delay', 'Delay_Original', 'DisplayAspectRatio_CleanAperture', 'DisplayAspectRatio', 'DisplayAspectRatio_Original', 'Duration_End_Command', 'Duration_End', 'Duration_FirstFrame', 'Duration_LastFrame', 'Duration', 'Duration_Start2End', 'Duration_Start_Command', 'Duration_Start', 'Events_MinDuration', 'FrameRate_Maximum', 'FrameRate_Minimum', 'FrameRate', 'FrameRate_Nominal', 'FrameRate_Original_Den', 'FrameRate_Original', 'FrameRate_Original_Num', 'FrameRate_Real', 'Interleave_Duration', 'Interleave_Preload', 'Interleave_VideoFrames', 'OverallBitRate_Maximum', 'OverallBitRate_Minimum', 'OverallBitRate', 'OverallBitRate_Nominal', 'PixelAspectRatio_CleanAperture', 'PixelAspectRatio', 'PixelAspectRatio_Original', 'SamplesPerFrame', 'SamplingRate', 'Source_Duration_FirstFrame', 'Source_Duration_LastFrame', 'Source_Duration', 'TimeStamp_FirstFrame', 'Video_Delay']; + + const MAX_UINT32_PLUS_ONE = 2 ** 32; + const DEFAULT_OPTIONS = { + coverData: false, + chunkSize: 256 * 1024, + format: 'object', + full: false + }; + /** + * Wrapper for the MediaInfoLib WASM module. + * + * This class should not be instantiated directly. Use the {@link mediaInfoFactory} function + * to create instances of `MediaInfo`. + * + * @typeParam TFormat - The format type, defaults to `object`. + */ + class MediaInfo { + /** @group General Use */ + + /** + * The constructor should not be called directly, instead use {@link mediaInfoFactory}. + * + * @hidden + * @param mediainfoModule WASM module + * @param options User options + */ + constructor(mediainfoModule, options) { + this.mediainfoModule = mediainfoModule; + this.options = options; + + // Instantiate + this.mediainfoModuleInstance = new mediainfoModule.MediaInfo(options.format === 'object' ? 'JSON' : options.format, options.coverData, options.full); + } + + /** + * Convenience method for analyzing a buffer chunk by chunk. + * + * @param size Return total buffer size in bytes. + * @param readChunk Read chunk of data and return an {@link Uint8Array}. + * @group General Use + */ + + /** + * Convenience method for analyzing a buffer chunk by chunk. + * + * @param size Return total buffer size in bytes. + * @param readChunk Read chunk of data and return an {@link Uint8Array}. + * @param callback Function that is called once the processing is done + * @group General Use + */ + + analyzeData(size, readChunk, callback) { + // Support promise signature + if (callback === undefined) { + return new Promise((resolve, reject) => { + const resultCb = (result, error) => { + if (error || !result) { + reject(unknownToError(error)); + } else { + resolve(result); + } + }; + this.analyzeData(size, readChunk, resultCb); + }); + } + const finalize = () => { + this.openBufferFinalize(); + const result = this.inform(); + if (this.options.format === 'object') { + callback(this.parseResultJson(result)); + } else { + callback(result); + } + }; + let offset = 0; + const runReadDataLoop = fileSize => { + const readNextChunk = data => { + if (continueBuffer(data)) { + getChunk(); + } else { + finalize(); + } + }; + const getChunk = () => { + let dataValue; + try { + const safeSize = Math.min(this.options.chunkSize, fileSize - offset); + dataValue = readChunk(safeSize, offset); + } catch (error) { + callback('', unknownToError(error)); + return; + } + if (dataValue instanceof Promise) { + dataValue.then(readNextChunk).catch(error => { + callback('', unknownToError(error)); + }); + } else { + readNextChunk(dataValue); + } + }; + const continueBuffer = data => { + if (data.length === 0 || this.openBufferContinue(data, data.length)) { + return false; + } + const seekTo = this.openBufferContinueGotoGet(); + if (seekTo === -1) { + offset += data.length; + } else { + offset = seekTo; + this.openBufferInit(fileSize, seekTo); + } + return true; + }; + this.openBufferInit(fileSize, offset); + getChunk(); + }; + const fileSizeValue = size instanceof Function ? size() : size; + if (fileSizeValue instanceof Promise) { + fileSizeValue.then(runReadDataLoop).catch(error => { + callback(null, unknownToError(error)); + }); + } else { + runReadDataLoop(fileSizeValue); + } + } + + /** + * Close the MediaInfoLib WASM instance. + * + * @group General Use + */ + close() { + if (typeof this.mediainfoModuleInstance.close === 'function') { + this.mediainfoModuleInstance.close(); + } + if (typeof this.mediainfoModule.destroy === 'function') { + this.mediainfoModule.destroy(this.mediainfoModuleInstance); + } + } + + /** + * Receive result data from the WASM instance. + * + * (This is a low-level MediaInfoLib function.) + * + * @returns Result data (format can be configured in options) + * @group Low-level + */ + inform() { + return this.mediainfoModuleInstance.inform(); + } + + /** + * Send more data to the WASM instance. + * + * (This is a low-level MediaInfoLib function.) + * + * @param data Data buffer + * @param size Buffer size + * @returns Processing state: `0` (no bits set) = not finished, Bit `0` set = enough data read for providing information + * @group Low-level + */ + openBufferContinue(data, size) { + // bit 3 set -> done + return !!(this.mediainfoModuleInstance.open_buffer_continue(data, size) & 0x08); + } + + /** + * Retrieve seek position from WASM instance. + * The MediaInfoLib function `Open_Buffer_GoTo` returns an integer with 64 bit precision. + * It would be cut at 32 bit due to the JavaScript bindings. Here we transport the low and high + * parts separately and put them together. + * + * (This is a low-level MediaInfoLib function.) + * + * @returns Seek position (where MediaInfoLib wants go in the data buffer) + * @group Low-level + */ + openBufferContinueGotoGet() { + // JS bindings don't support 64 bit int + // https://github.com/buzz/mediainfo.js/issues/11 + let seekTo = -1; + const seekToLow = this.mediainfoModuleInstance.open_buffer_continue_goto_get_lower(); + const seekToHigh = this.mediainfoModuleInstance.open_buffer_continue_goto_get_upper(); + if (seekToLow == -1 && seekToHigh == -1) { + seekTo = -1; + } else if (seekToLow < 0) { + seekTo = seekToLow + MAX_UINT32_PLUS_ONE + seekToHigh * MAX_UINT32_PLUS_ONE; + } else { + seekTo = seekToLow + seekToHigh * MAX_UINT32_PLUS_ONE; + } + return seekTo; + } + + /** + * Inform MediaInfoLib that no more data is being read. + * + * (This is a low-level MediaInfoLib function.) + * + * @group Low-level + */ + openBufferFinalize() { + this.mediainfoModuleInstance.open_buffer_finalize(); + } + + /** + * Prepare MediaInfoLib to process a data buffer. + * + * (This is a low-level MediaInfoLib function.) + * + * @param size Expected buffer size + * @param offset Buffer offset + * @group Low-level + */ + openBufferInit(size, offset) { + this.mediainfoModuleInstance.open_buffer_init(size, offset); + } + + /** + * Parse result JSON. Convert integer/float fields. + * + * @param result Serialized JSON from MediaInfo + * @returns Parsed JSON object + */ + parseResultJson(resultString) { + const intFields = INT_FIELDS; + const floatFields = FLOAT_FIELDS; + + // Parse JSON + const result = JSON.parse(resultString); + if (result.media) { + const newMedia = _objectSpread2(_objectSpread2({}, result.media), {}, { + track: [] + }); + if (Array.isArray(result.media.track)) { + for (const track of result.media.track) { + let newTrack = { + '@type': track['@type'] + }; + for (const [key, val] of Object.entries(track)) { + if (key === '@type') { + continue; + } + if (typeof val === 'string' && intFields.includes(key)) { + newTrack = _objectSpread2(_objectSpread2({}, newTrack), {}, { + [key]: Number.parseInt(val, 10) + }); + } else if (typeof val === 'string' && floatFields.includes(key)) { + newTrack = _objectSpread2(_objectSpread2({}, newTrack), {}, { + [key]: Number.parseFloat(val) + }); + } else { + newTrack = _objectSpread2(_objectSpread2({}, newTrack), {}, { + [key]: val + }); + } + } + newMedia.track.push(newTrack); + } + } + return _objectSpread2(_objectSpread2({}, result), {}, { + media: newMedia + }); + } + return result; + } + } + + var Module = (() => { + var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined; + + return function (moduleArg = {}) { + var moduleRtn; + + // include: shell.js + // The Module object: Our interface to the outside world. We import + // and export values on it. There are various ways Module can be used: + // 1. Not defined. We create it here + // 2. A function parameter, function(moduleArg) => Promise + // 3. pre-run appended it, var Module = {}; ..generated code.. + // 4. External script tag defines var Module. + // We need to check if Module already exists (e.g. case 3 above). + // Substitution will be replaced with actual code on later stage of the build, + // this way Closure Compiler will not mangle it (e.g. case 4. above). + // Note that if you want to run closure, and also to use Module + // after the generated code, you will need to define var Module = {}; + // before the code. Then that object will be used in the code, and you + // can continue to use Module afterwards as well. + var Module = Object.assign({}, moduleArg); + + // Set up the promise that indicates the Module is initialized + var readyPromiseResolve, readyPromiseReject; + var readyPromise = new Promise((resolve, reject) => { + readyPromiseResolve = resolve; + readyPromiseReject = reject; + }); + + // --pre-jses are emitted after the Module integration code, so that they can + // refer to Module (if they choose; they can also define Module) + + // Sometimes an existing Module object exists with properties + // meant to overwrite the default module functionality. Here + // we collect those properties and reapply _after_ we configure + // the current environment's defaults to avoid having to be so + // defensive during initialization. + var moduleOverrides = Object.assign({}, Module); + var thisProgram = './this.program'; + + // `/` should be present at the end if `scriptDirectory` is not empty + var scriptDirectory = ''; + function locateFile(path) { + if (Module['locateFile']) { + return Module['locateFile'](path, scriptDirectory) + } + return scriptDirectory + path + } + + // Note that this includes Node.js workers when relevant (pthreads is enabled). + // Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and + // ENVIRONMENT_IS_NODE. + { + if (typeof document != 'undefined' && document.currentScript) { + // web + scriptDirectory = document.currentScript.src; + } + // When MODULARIZE, this JS may be executed later, after document.currentScript + // is gone, so we saved it, and we use it here instead of any other info. + if (_scriptName) { + scriptDirectory = _scriptName; + } + // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them. + // otherwise, slice off the final part of the url to find the script directory. + // if scriptDirectory does not contain a slash, lastIndexOf will return -1, + // and scriptDirectory will correctly be replaced with an empty string. + // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #), + // they are removed because they could contain a slash. + if (scriptDirectory.startsWith('blob:')) { + scriptDirectory = ''; + } else { + scriptDirectory = scriptDirectory.substr( + 0, + scriptDirectory.replace(/[?#].*/, '').lastIndexOf('/') + 1 + ); + } + } + + console.log.bind(console); + var err = console.error.bind(console); + + // Merge back in the overrides + Object.assign(Module, moduleOverrides); + // Free the object hierarchy contained in the overrides, this lets the GC + // reclaim data used. + moduleOverrides = null; + + // Emit code to handle expected values on the Module object. This applies Module.x + // to the proper local x. This has two benefits: first, we only emit it if it is + // expected to arrive, and second, by using a local everywhere else that can be + // minified. + + // perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message + // end include: shell.js + + // include: preamble.js + // === Preamble library stuff === + + // Documentation for the public APIs defined in this file must be updated in: + // site/source/docs/api_reference/preamble.js.rst + // A prebuilt local version of the documentation is available at: + // site/build/text/docs/api_reference/preamble.js.txt + // You can also build docs locally as HTML or other formats in site/ + // An online HTML version (which may be of a different version of Emscripten) + // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html + + var wasmBinary; + + // Wasm globals + + var wasmMemory; + + //======================================== + // Runtime essentials + //======================================== + + // whether we are quitting the application. no code should run after this. + // set in exit() and abort() + var ABORT = false; + + // Memory management + + var /** @type {!Int8Array} */ + HEAP8, + /** @type {!Uint8Array} */ + HEAPU8, + /** @type {!Int16Array} */ + HEAP16, + /** @type {!Uint16Array} */ + HEAPU16, + /** @type {!Int32Array} */ + HEAP32, + /** @type {!Uint32Array} */ + HEAPU32, + /** @type {!Float32Array} */ + HEAPF32, + /** @type {!Float64Array} */ + HEAPF64; + + // include: runtime_shared.js + function updateMemoryViews() { + var b = wasmMemory.buffer; + Module['HEAP8'] = HEAP8 = new Int8Array(b); + Module['HEAP16'] = HEAP16 = new Int16Array(b); + Module['HEAPU8'] = HEAPU8 = new Uint8Array(b); + Module['HEAPU16'] = HEAPU16 = new Uint16Array(b); + Module['HEAP32'] = HEAP32 = new Int32Array(b); + Module['HEAPU32'] = HEAPU32 = new Uint32Array(b); + Module['HEAPF32'] = HEAPF32 = new Float32Array(b); + Module['HEAPF64'] = HEAPF64 = new Float64Array(b); + } + // end include: runtime_shared.js + // include: runtime_stack_check.js + // end include: runtime_stack_check.js + // include: runtime_assertions.js + // end include: runtime_assertions.js + var __ATPRERUN__ = []; // functions called before the runtime is initialized + var __ATINIT__ = []; // functions called during startup + var __ATPOSTRUN__ = []; // functions called after the main() is called + + function preRun() { + callRuntimeCallbacks(__ATPRERUN__); + } + + function initRuntime() { + + callRuntimeCallbacks(__ATINIT__); + } + + function postRun() { + callRuntimeCallbacks(__ATPOSTRUN__); + } + + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + + // include: runtime_math.js + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc + + // end include: runtime_math.js + // A counter of dependencies for calling run(). If we need to + // do asynchronous work before running, increment this and + // decrement it. Incrementing must happen in a place like + // Module.preRun (used by emcc to add file preloading). + // Note that you can add dependencies in preRun, even though + // it happens right before run - run will be postponed until + // the dependencies are met. + var runDependencies = 0; + var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled + + function addRunDependency(id) { + runDependencies++; + } + + function removeRunDependency(id) { + runDependencies--; + + if (runDependencies == 0) { + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled + } + } + } + + /** @param {string|number=} what */ + function abort(what) { + what = 'Aborted(' + what + ')'; + // TODO(sbc): Should we remove printing and leave it up to whoever + // catches the exception? + err(what); + + ABORT = true; + + what += '. Build with -sASSERTIONS for more info.'; + + // Use a wasm runtime error, because a JS error might be seen as a foreign + // exception, which means we'd run destructors on it. We need the error to + // simply make the program stop. + // FIXME This approach does not work in Wasm EH because it currently does not assume + // all RuntimeErrors are from traps; it decides whether a RuntimeError is from + // a trap or not based on a hidden field within the object. So at the moment + // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that + // allows this in the wasm spec. + + // Suppress closure compiler warning here. Closure compiler's builtin extern + // definition for WebAssembly.RuntimeError claims it takes no arguments even + // though it can. + // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. + /** @suppress {checkTypes} */ + var e = new WebAssembly.RuntimeError(what); + + readyPromiseReject(e); + // Throw the error whether or not MODULARIZE is set because abort is used + // in code paths apart from instantiation where an exception is expected + // to be thrown when abort is called. + throw e + } + + // include: memoryprofiler.js + // end include: memoryprofiler.js + // include: URIUtils.js + // Prefix of data URIs emitted by SINGLE_FILE and related options. + var dataURIPrefix = 'data:application/octet-stream;base64,'; + + /** + * Indicates whether filename is a base64 data URI. + * @noinline + */ + var isDataURI = (filename) => filename.startsWith(dataURIPrefix); + // end include: URIUtils.js + // include: runtime_exceptions.js + // end include: runtime_exceptions.js + function findWasmBinary() { + var f = 'MediaInfoModule.wasm'; + if (!isDataURI(f)) { + return locateFile(f) + } + return f + } + + var wasmBinaryFile; + + function getBinarySync(file) { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary) + } + throw 'both async and sync fetching of the wasm failed' + } + + function getBinaryPromise(binaryFile) { + // If we don't have the binary yet, try to load it asynchronously. + // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url. + // See https://github.com/github/fetch/pull/92#issuecomment-140665932 + // Cordova or Electron apps are typically loaded from a file:// url. + // So use fetch if it is available and the url is not a file, otherwise fall back to XHR. + { + if (typeof fetch == 'function') { + return fetch(binaryFile, { credentials: 'same-origin' }) + .then((response) => { + if (!response['ok']) { + throw `failed to load wasm binary file at '${binaryFile}'` + } + return response['arrayBuffer']() + }) + .catch(() => getBinarySync(binaryFile)) + } + } + + // Otherwise, getBinarySync should be able to get it synchronously + return Promise.resolve().then(() => getBinarySync(binaryFile)) + } + + function instantiateArrayBuffer(binaryFile, imports, receiver) { + return getBinaryPromise(binaryFile) + .then((binary) => { + return WebAssembly.instantiate(binary, imports) + }) + .then(receiver, (reason) => { + err(`failed to asynchronously prepare wasm: ${reason}`); + + abort(reason); + }) + } + + function instantiateAsync(binary, binaryFile, imports, callback) { + if ( + typeof WebAssembly.instantiateStreaming == 'function' && + !isDataURI(binaryFile) && + typeof fetch == 'function' + ) { + return fetch(binaryFile, { credentials: 'same-origin' }).then((response) => { + // Suppress closure warning here since the upstream definition for + // instantiateStreaming only allows Promise rather than + // an actual Response. + // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed. + /** @suppress {checkTypes} */ + var result = WebAssembly.instantiateStreaming(response, imports); + + return result.then(callback, function (reason) { + // We expect the most common failure cause to be a bad MIME type for the binary, + // in which case falling back to ArrayBuffer instantiation should work. + err(`wasm streaming compile failed: ${reason}`); + err('falling back to ArrayBuffer instantiation'); + return instantiateArrayBuffer(binaryFile, imports, callback) + }) + }) + } + return instantiateArrayBuffer(binaryFile, imports, callback) + } + + function getWasmImports() { + // prepare imports + return { + env: wasmImports, + wasi_snapshot_preview1: wasmImports, + } + } + + // Create the wasm instance. + // Receives the wasm imports, returns the exports. + function createWasm() { + var info = getWasmImports(); + // Load the wasm module and create an instance of using native support in the JS engine. + // handle a generated wasm instance, receiving its exports and + // performing other necessary setup + /** @param {WebAssembly.Module=} module*/ + function receiveInstance(instance, module) { + wasmExports = instance.exports; + + wasmMemory = wasmExports['memory']; + + updateMemoryViews(); + + wasmTable = wasmExports['__indirect_function_table']; + + addOnInit(wasmExports['__wasm_call_ctors']); + + removeRunDependency(); + return wasmExports + } + // wait for the pthread pool (if any) + addRunDependency(); + + // Prefer streaming instantiation if available. + function receiveInstantiationResult(result) { + // 'result' is a ResultObject object which has both the module and instance. + // receiveInstance() will swap in the exports (to Module.asm) so they can be called + // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line. + // When the regression is fixed, can restore the above PTHREADS-enabled path. + receiveInstance(result['instance']); + } + + if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary(); + + // If instantiation fails, reject the module ready promise. + instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch( + readyPromiseReject + ); + return {} // no exports yet; we'll fill them in later + } + + var callRuntimeCallbacks = (callbacks) => { + while (callbacks.length > 0) { + // Pass the module as the first argument. + callbacks.shift()(Module); + } + }; + + var __abort_js = () => { + abort(''); + }; + + var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {}; + + var embind_init_charCodes = () => { + var codes = new Array(256); + for (var i = 0; i < 256; ++i) { + codes[i] = String.fromCharCode(i); + } + embind_charCodes = codes; + }; + var embind_charCodes; + var readLatin1String = (ptr) => { + var ret = ''; + var c = ptr; + while (HEAPU8[c]) { + ret += embind_charCodes[HEAPU8[c++]]; + } + return ret + }; + + var awaitingDependencies = {}; + + var registeredTypes = {}; + + var typeDependencies = {}; + + var BindingError; + var throwBindingError = (message) => { + throw new BindingError(message) + }; + + var InternalError; + var throwInternalError = (message) => { + throw new InternalError(message) + }; + var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => { + myTypes.forEach(function (type) { + typeDependencies[type] = dependentTypes; + }); + + function onComplete(typeConverters) { + var myTypeConverters = getTypeConverters(typeConverters); + if (myTypeConverters.length !== myTypes.length) { + throwInternalError('Mismatched type converter count'); + } + for (var i = 0; i < myTypes.length; ++i) { + registerType(myTypes[i], myTypeConverters[i]); + } + } + + var typeConverters = new Array(dependentTypes.length); + var unregisteredTypes = []; + var registered = 0; + dependentTypes.forEach((dt, i) => { + if (registeredTypes.hasOwnProperty(dt)) { + typeConverters[i] = registeredTypes[dt]; + } else { + unregisteredTypes.push(dt); + if (!awaitingDependencies.hasOwnProperty(dt)) { + awaitingDependencies[dt] = []; + } + awaitingDependencies[dt].push(() => { + typeConverters[i] = registeredTypes[dt]; + ++registered; + if (registered === unregisteredTypes.length) { + onComplete(typeConverters); + } + }); + } + }); + if (0 === unregisteredTypes.length) { + onComplete(typeConverters); + } + }; + /** @param {Object=} options */ + function sharedRegisterType(rawType, registeredInstance, options = {}) { + var name = registeredInstance.name; + if (!rawType) { + throwBindingError(`type "${name}" must have a positive integer typeid pointer`); + } + if (registeredTypes.hasOwnProperty(rawType)) { + if (options.ignoreDuplicateRegistrations) { + return + } else { + throwBindingError(`Cannot register type '${name}' twice`); + } + } + + registeredTypes[rawType] = registeredInstance; + delete typeDependencies[rawType]; + + if (awaitingDependencies.hasOwnProperty(rawType)) { + var callbacks = awaitingDependencies[rawType]; + delete awaitingDependencies[rawType]; + callbacks.forEach((cb) => cb()); + } + } + /** @param {Object=} options */ + function registerType(rawType, registeredInstance, options = {}) { + if (!('argPackAdvance' in registeredInstance)) { + throw new TypeError('registerType registeredInstance requires argPackAdvance') + } + return sharedRegisterType(rawType, registeredInstance, options) + } + + var GenericWireTypeSize = 8; + /** @suppress {globalThis} */ + var __embind_register_bool = (rawType, name, trueValue, falseValue) => { + name = readLatin1String(name); + registerType(rawType, { + name, + fromWireType: function (wt) { + // ambiguous emscripten ABI: sometimes return values are + // true or false, and sometimes integers (0 or 1) + return !!wt + }, + toWireType: function (destructors, o) { + return o ? trueValue : falseValue + }, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: function (pointer) { + return this['fromWireType'](HEAPU8[pointer]) + }, + destructorFunction: null, // This type does not need a destructor + }); + }; + + var shallowCopyInternalPointer = (o) => { + return { + count: o.count, + deleteScheduled: o.deleteScheduled, + preservePointerOnDelete: o.preservePointerOnDelete, + ptr: o.ptr, + ptrType: o.ptrType, + smartPtr: o.smartPtr, + smartPtrType: o.smartPtrType, + } + }; + + var throwInstanceAlreadyDeleted = (obj) => { + function getInstanceTypeName(handle) { + return handle.$$.ptrType.registeredClass.name + } + throwBindingError(getInstanceTypeName(obj) + ' instance already deleted'); + }; + + var finalizationRegistry = false; + + var detachFinalizer = (handle) => {}; + + var runDestructor = ($$) => { + if ($$.smartPtr) { + $$.smartPtrType.rawDestructor($$.smartPtr); + } else { + $$.ptrType.registeredClass.rawDestructor($$.ptr); + } + }; + var releaseClassHandle = ($$) => { + $$.count.value -= 1; + var toDelete = 0 === $$.count.value; + if (toDelete) { + runDestructor($$); + } + }; + + var downcastPointer = (ptr, ptrClass, desiredClass) => { + if (ptrClass === desiredClass) { + return ptr + } + if (undefined === desiredClass.baseClass) { + return null // no conversion + } + + var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass); + if (rv === null) { + return null + } + return desiredClass.downcast(rv) + }; + + var registeredPointers = {}; + + var getInheritedInstanceCount = () => Object.keys(registeredInstances).length; + + var getLiveInheritedInstances = () => { + var rv = []; + for (var k in registeredInstances) { + if (registeredInstances.hasOwnProperty(k)) { + rv.push(registeredInstances[k]); + } + } + return rv + }; + + var deletionQueue = []; + var flushPendingDeletes = () => { + while (deletionQueue.length) { + var obj = deletionQueue.pop(); + obj.$$.deleteScheduled = false; + obj['delete'](); + } + }; + + var delayFunction; + + var setDelayFunction = (fn) => { + delayFunction = fn; + if (deletionQueue.length && delayFunction) { + delayFunction(flushPendingDeletes); + } + }; + var init_embind = () => { + Module['getInheritedInstanceCount'] = getInheritedInstanceCount; + Module['getLiveInheritedInstances'] = getLiveInheritedInstances; + Module['flushPendingDeletes'] = flushPendingDeletes; + Module['setDelayFunction'] = setDelayFunction; + }; + var registeredInstances = {}; + + var getBasestPointer = (class_, ptr) => { + if (ptr === undefined) { + throwBindingError('ptr should not be undefined'); + } + while (class_.baseClass) { + ptr = class_.upcast(ptr); + class_ = class_.baseClass; + } + return ptr + }; + var getInheritedInstance = (class_, ptr) => { + ptr = getBasestPointer(class_, ptr); + return registeredInstances[ptr] + }; + + var makeClassHandle = (prototype, record) => { + if (!record.ptrType || !record.ptr) { + throwInternalError('makeClassHandle requires ptr and ptrType'); + } + var hasSmartPtrType = !!record.smartPtrType; + var hasSmartPtr = !!record.smartPtr; + if (hasSmartPtrType !== hasSmartPtr) { + throwInternalError('Both smartPtrType and smartPtr must be specified'); + } + record.count = { value: 1 }; + return attachFinalizer( + Object.create(prototype, { + $$: { + value: record, + writable: true, + }, + }) + ) + }; + /** @suppress {globalThis} */ + function RegisteredPointer_fromWireType(ptr) { + // ptr is a raw pointer (or a raw smartpointer) + + // rawPointer is a maybe-null raw pointer + var rawPointer = this.getPointee(ptr); + if (!rawPointer) { + this.destructor(ptr); + return null + } + + var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer); + if (undefined !== registeredInstance) { + // JS object has been neutered, time to repopulate it + if (0 === registeredInstance.$$.count.value) { + registeredInstance.$$.ptr = rawPointer; + registeredInstance.$$.smartPtr = ptr; + return registeredInstance['clone']() + } else { + // else, just increment reference count on existing object + // it already has a reference to the smart pointer + var rv = registeredInstance['clone'](); + this.destructor(ptr); + return rv + } + } + + function makeDefaultHandle() { + if (this.isSmartPointer) { + return makeClassHandle(this.registeredClass.instancePrototype, { + ptrType: this.pointeeType, + ptr: rawPointer, + smartPtrType: this, + smartPtr: ptr, + }) + } else { + return makeClassHandle(this.registeredClass.instancePrototype, { + ptrType: this, + ptr, + }) + } + } + + var actualType = this.registeredClass.getActualType(rawPointer); + var registeredPointerRecord = registeredPointers[actualType]; + if (!registeredPointerRecord) { + return makeDefaultHandle.call(this) + } + + var toType; + if (this.isConst) { + toType = registeredPointerRecord.constPointerType; + } else { + toType = registeredPointerRecord.pointerType; + } + var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass); + if (dp === null) { + return makeDefaultHandle.call(this) + } + if (this.isSmartPointer) { + return makeClassHandle(toType.registeredClass.instancePrototype, { + ptrType: toType, + ptr: dp, + smartPtrType: this, + smartPtr: ptr, + }) + } else { + return makeClassHandle(toType.registeredClass.instancePrototype, { + ptrType: toType, + ptr: dp, + }) + } + } + var attachFinalizer = (handle) => { + if ('undefined' === typeof FinalizationRegistry) { + attachFinalizer = (handle) => handle; + return handle + } + // If the running environment has a FinalizationRegistry (see + // https://github.com/tc39/proposal-weakrefs), then attach finalizers + // for class handles. We check for the presence of FinalizationRegistry + // at run-time, not build-time. + finalizationRegistry = new FinalizationRegistry((info) => { + releaseClassHandle(info.$$); + }); + attachFinalizer = (handle) => { + var $$ = handle.$$; + var hasSmartPtr = !!$$.smartPtr; + if (hasSmartPtr) { + // We should not call the destructor on raw pointers in case other code expects the pointee to live + var info = { $$: $$ }; + finalizationRegistry.register(handle, info, handle); + } + return handle + }; + detachFinalizer = (handle) => finalizationRegistry.unregister(handle); + return attachFinalizer(handle) + }; + + var init_ClassHandle = () => { + Object.assign(ClassHandle.prototype, { + isAliasOf(other) { + if (!(this instanceof ClassHandle)) { + return false + } + if (!(other instanceof ClassHandle)) { + return false + } + + var leftClass = this.$$.ptrType.registeredClass; + var left = this.$$.ptr; + other.$$ = /** @type {Object} */ (other.$$); + var rightClass = other.$$.ptrType.registeredClass; + var right = other.$$.ptr; + + while (leftClass.baseClass) { + left = leftClass.upcast(left); + leftClass = leftClass.baseClass; + } + + while (rightClass.baseClass) { + right = rightClass.upcast(right); + rightClass = rightClass.baseClass; + } + + return leftClass === rightClass && left === right + }, + + clone() { + if (!this.$$.ptr) { + throwInstanceAlreadyDeleted(this); + } + + if (this.$$.preservePointerOnDelete) { + this.$$.count.value += 1; + return this + } else { + var clone = attachFinalizer( + Object.create(Object.getPrototypeOf(this), { + $$: { + value: shallowCopyInternalPointer(this.$$), + }, + }) + ); + + clone.$$.count.value += 1; + clone.$$.deleteScheduled = false; + return clone + } + }, + + delete() { + if (!this.$$.ptr) { + throwInstanceAlreadyDeleted(this); + } + + if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { + throwBindingError('Object already scheduled for deletion'); + } + + detachFinalizer(this); + releaseClassHandle(this.$$); + + if (!this.$$.preservePointerOnDelete) { + this.$$.smartPtr = undefined; + this.$$.ptr = undefined; + } + }, + + isDeleted() { + return !this.$$.ptr + }, + + deleteLater() { + if (!this.$$.ptr) { + throwInstanceAlreadyDeleted(this); + } + if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { + throwBindingError('Object already scheduled for deletion'); + } + deletionQueue.push(this); + if (deletionQueue.length === 1 && delayFunction) { + delayFunction(flushPendingDeletes); + } + this.$$.deleteScheduled = true; + return this + }, + }); + }; + /** @constructor */ + function ClassHandle() {} + + var createNamedFunction = (name, body) => + Object.defineProperty(body, 'name', { + value: name, + }); + + var ensureOverloadTable = (proto, methodName, humanName) => { + if (undefined === proto[methodName].overloadTable) { + var prevFunc = proto[methodName]; + // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. + proto[methodName] = function (...args) { + // TODO This check can be removed in -O3 level "unsafe" optimizations. + if (!proto[methodName].overloadTable.hasOwnProperty(args.length)) { + throwBindingError( + `Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!` + ); + } + return proto[methodName].overloadTable[args.length].apply(this, args) + }; + // Move the previous function into the overload table. + proto[methodName].overloadTable = []; + proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; + } + }; + + /** @param {number=} numArguments */ + var exposePublicSymbol = (name, value, numArguments) => { + if (Module.hasOwnProperty(name)) { + { + throwBindingError(`Cannot register public name '${name}' twice`); + } + + // We are exposing a function with the same name as an existing function. Create an overload table and a function selector + // that routes between the two. + ensureOverloadTable(Module, name, name); + if (Module.hasOwnProperty(numArguments)) { + throwBindingError( + `Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!` + ); + } + // Add the new function into the overload table. + Module[name].overloadTable[numArguments] = value; + } else { + Module[name] = value; + } + }; + + var char_0 = 48; + + var char_9 = 57; + var makeLegalFunctionName = (name) => { + if (undefined === name) { + return '_unknown' + } + name = name.replace(/[^a-zA-Z0-9_]/g, '$'); + var f = name.charCodeAt(0); + if (f >= char_0 && f <= char_9) { + return `_${name}` + } + return name + }; + + /** @constructor */ + function RegisteredClass( + name, + constructor, + instancePrototype, + rawDestructor, + baseClass, + getActualType, + upcast, + downcast + ) { + this.name = name; + this.constructor = constructor; + this.instancePrototype = instancePrototype; + this.rawDestructor = rawDestructor; + this.baseClass = baseClass; + this.getActualType = getActualType; + this.upcast = upcast; + this.downcast = downcast; + this.pureVirtualFunctions = []; + } + + var upcastPointer = (ptr, ptrClass, desiredClass) => { + while (ptrClass !== desiredClass) { + if (!ptrClass.upcast) { + throwBindingError( + `Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}` + ); + } + ptr = ptrClass.upcast(ptr); + ptrClass = ptrClass.baseClass; + } + return ptr + }; + /** @suppress {globalThis} */ + function constNoSmartPtrRawPointerToWireType(destructors, handle) { + if (handle === null) { + if (this.isReference) { + throwBindingError(`null is not a valid ${this.name}`); + } + return 0 + } + + if (!handle.$$) { + throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`); + } + if (!handle.$$.ptr) { + throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`); + } + var handleClass = handle.$$.ptrType.registeredClass; + var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); + return ptr + } + + /** @suppress {globalThis} */ + function genericPointerToWireType(destructors, handle) { + var ptr; + if (handle === null) { + if (this.isReference) { + throwBindingError(`null is not a valid ${this.name}`); + } + + if (this.isSmartPointer) { + ptr = this.rawConstructor(); + if (destructors !== null) { + destructors.push(this.rawDestructor, ptr); + } + return ptr + } else { + return 0 + } + } + + if (!handle || !handle.$$) { + throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`); + } + if (!handle.$$.ptr) { + throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`); + } + if (!this.isConst && handle.$$.ptrType.isConst) { + throwBindingError( + `Cannot convert argument of type ${handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name} to parameter type ${this.name}` + ); + } + var handleClass = handle.$$.ptrType.registeredClass; + ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); + + if (this.isSmartPointer) { + // TODO: this is not strictly true + // We could support BY_EMVAL conversions from raw pointers to smart pointers + // because the smart pointer can hold a reference to the handle + if (undefined === handle.$$.smartPtr) { + throwBindingError('Passing raw pointer to smart pointer is illegal'); + } + + switch (this.sharingPolicy) { + case 0: // NONE + // no upcasting + if (handle.$$.smartPtrType === this) { + ptr = handle.$$.smartPtr; + } else { + throwBindingError( + `Cannot convert argument of type ${handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name} to parameter type ${this.name}` + ); + } + break + + case 1: // INTRUSIVE + ptr = handle.$$.smartPtr; + break + + case 2: // BY_EMVAL + if (handle.$$.smartPtrType === this) { + ptr = handle.$$.smartPtr; + } else { + var clonedHandle = handle['clone'](); + ptr = this.rawShare( + ptr, + Emval.toHandle(() => clonedHandle['delete']()) + ); + if (destructors !== null) { + destructors.push(this.rawDestructor, ptr); + } + } + break + + default: + throwBindingError('Unsupporting sharing policy'); + } + } + return ptr + } + + /** @suppress {globalThis} */ + function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) { + if (handle === null) { + if (this.isReference) { + throwBindingError(`null is not a valid ${this.name}`); + } + return 0 + } + + if (!handle.$$) { + throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`); + } + if (!handle.$$.ptr) { + throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`); + } + if (handle.$$.ptrType.isConst) { + throwBindingError( + `Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}` + ); + } + var handleClass = handle.$$.ptrType.registeredClass; + var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); + return ptr + } + + /** @suppress {globalThis} */ + function readPointer(pointer) { + return this['fromWireType'](HEAPU32[pointer >> 2]) + } + + var init_RegisteredPointer = () => { + Object.assign(RegisteredPointer.prototype, { + getPointee(ptr) { + if (this.rawGetPointee) { + ptr = this.rawGetPointee(ptr); + } + return ptr + }, + destructor(ptr) { + this.rawDestructor?.(ptr); + }, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: readPointer, + fromWireType: RegisteredPointer_fromWireType, + }); + }; + /** @constructor + @param {*=} pointeeType, + @param {*=} sharingPolicy, + @param {*=} rawGetPointee, + @param {*=} rawConstructor, + @param {*=} rawShare, + @param {*=} rawDestructor, + */ + function RegisteredPointer( + name, + registeredClass, + isReference, + isConst, + + // smart pointer properties + isSmartPointer, + pointeeType, + sharingPolicy, + rawGetPointee, + rawConstructor, + rawShare, + rawDestructor + ) { + this.name = name; + this.registeredClass = registeredClass; + this.isReference = isReference; + this.isConst = isConst; + + // smart pointer properties + this.isSmartPointer = isSmartPointer; + this.pointeeType = pointeeType; + this.sharingPolicy = sharingPolicy; + this.rawGetPointee = rawGetPointee; + this.rawConstructor = rawConstructor; + this.rawShare = rawShare; + this.rawDestructor = rawDestructor; + + if (!isSmartPointer && registeredClass.baseClass === undefined) { + if (isConst) { + this['toWireType'] = constNoSmartPtrRawPointerToWireType; + this.destructorFunction = null; + } else { + this['toWireType'] = nonConstNoSmartPtrRawPointerToWireType; + this.destructorFunction = null; + } + } else { + this['toWireType'] = genericPointerToWireType; + // Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns + // a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time. + // TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in + // craftInvokerFunction altogether. + } + } + + /** @param {number=} numArguments */ + var replacePublicSymbol = (name, value, numArguments) => { + if (!Module.hasOwnProperty(name)) { + throwInternalError('Replacing nonexistent public symbol'); + } + // If there's an overload table for this symbol, replace the symbol in the overload table instead. + if (undefined !== Module[name].overloadTable && undefined !== numArguments) { + Module[name].overloadTable[numArguments] = value; + } else { + Module[name] = value; + Module[name].argCount = numArguments; + } + }; + + var dynCallLegacy = (sig, ptr, args) => { + sig = sig.replace(/p/g, 'i'); + var f = Module['dynCall_' + sig]; + return f(ptr, ...args) + }; + + var wasmTableMirror = []; + + /** @type {WebAssembly.Table} */ + var wasmTable; + var getWasmTableEntry = (funcPtr) => { + var func = wasmTableMirror[funcPtr]; + if (!func) { + if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1; + wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); + } + return func + }; + + var dynCall = (sig, ptr, args = []) => { + // Without WASM_BIGINT support we cannot directly call function with i64 as + // part of their signature, so we rely on the dynCall functions generated by + // wasm-emscripten-finalize + if (sig.includes('j')) { + return dynCallLegacy(sig, ptr, args) + } + var rtn = getWasmTableEntry(ptr)(...args); + return rtn + }; + var getDynCaller = (sig, ptr) => { + return (...args) => dynCall(sig, ptr, args) + }; + + var embind__requireFunction = (signature, rawFunction) => { + signature = readLatin1String(signature); + + function makeDynCaller() { + if (signature.includes('j')) { + return getDynCaller(signature, rawFunction) + } + return getWasmTableEntry(rawFunction) + } + + var fp = makeDynCaller(); + if (typeof fp != 'function') { + throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`); + } + return fp + }; + + var extendError = (baseErrorType, errorName) => { + var errorClass = createNamedFunction(errorName, function (message) { + this.name = errorName; + this.message = message; + + var stack = new Error(message).stack; + if (stack !== undefined) { + this.stack = this.toString() + '\n' + stack.replace(/^Error(:[^\n]*)?\n/, ''); + } + }); + errorClass.prototype = Object.create(baseErrorType.prototype); + errorClass.prototype.constructor = errorClass; + errorClass.prototype.toString = function () { + if (this.message === undefined) { + return this.name + } else { + return `${this.name}: ${this.message}` + } + }; + + return errorClass + }; + var UnboundTypeError; + + var getTypeName = (type) => { + var ptr = ___getTypeName(type); + var rv = readLatin1String(ptr); + _free(ptr); + return rv + }; + var throwUnboundTypeError = (message, types) => { + var unboundTypes = []; + var seen = {}; + function visit(type) { + if (seen[type]) { + return + } + if (registeredTypes[type]) { + return + } + if (typeDependencies[type]) { + typeDependencies[type].forEach(visit); + return + } + unboundTypes.push(type); + seen[type] = true; + } + types.forEach(visit); + + throw new UnboundTypeError(`${message}: ` + unboundTypes.map(getTypeName).join([', '])) + }; + + var __embind_register_class = ( + rawType, + rawPointerType, + rawConstPointerType, + baseClassRawType, + getActualTypeSignature, + getActualType, + upcastSignature, + upcast, + downcastSignature, + downcast, + name, + destructorSignature, + rawDestructor + ) => { + name = readLatin1String(name); + getActualType = embind__requireFunction(getActualTypeSignature, getActualType); + upcast &&= embind__requireFunction(upcastSignature, upcast); + downcast &&= embind__requireFunction(downcastSignature, downcast); + rawDestructor = embind__requireFunction(destructorSignature, rawDestructor); + var legalFunctionName = makeLegalFunctionName(name); + + exposePublicSymbol(legalFunctionName, function () { + // this code cannot run if baseClassRawType is zero + throwUnboundTypeError(`Cannot construct ${name} due to unbound types`, [baseClassRawType]); + }); + + whenDependentTypesAreResolved( + [rawType, rawPointerType, rawConstPointerType], + baseClassRawType ? [baseClassRawType] : [], + (base) => { + base = base[0]; + + var baseClass; + var basePrototype; + if (baseClassRawType) { + baseClass = base.registeredClass; + basePrototype = baseClass.instancePrototype; + } else { + basePrototype = ClassHandle.prototype; + } + + var constructor = createNamedFunction(name, function (...args) { + if (Object.getPrototypeOf(this) !== instancePrototype) { + throw new BindingError("Use 'new' to construct " + name) + } + if (undefined === registeredClass.constructor_body) { + throw new BindingError(name + ' has no accessible constructor') + } + var body = registeredClass.constructor_body[args.length]; + if (undefined === body) { + throw new BindingError( + `Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!` + ) + } + return body.apply(this, args) + }); + + var instancePrototype = Object.create(basePrototype, { + constructor: { value: constructor }, + }); + + constructor.prototype = instancePrototype; + + var registeredClass = new RegisteredClass( + name, + constructor, + instancePrototype, + rawDestructor, + baseClass, + getActualType, + upcast, + downcast + ); + + if (registeredClass.baseClass) { + // Keep track of class hierarchy. Used to allow sub-classes to inherit class functions. + registeredClass.baseClass.__derivedClasses ??= []; + + registeredClass.baseClass.__derivedClasses.push(registeredClass); + } + + var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false); + + var pointerConverter = new RegisteredPointer( + name + '*', + registeredClass, + false, + false, + false + ); + + var constPointerConverter = new RegisteredPointer( + name + ' const*', + registeredClass, + false, + true, + false + ); + + registeredPointers[rawType] = { + pointerType: pointerConverter, + constPointerType: constPointerConverter, + }; + + replacePublicSymbol(legalFunctionName, constructor); + + return [referenceConverter, pointerConverter, constPointerConverter] + } + ); + }; + + var heap32VectorToArray = (count, firstElement) => { + var array = []; + for (var i = 0; i < count; i++) { + // TODO(https://github.com/emscripten-core/emscripten/issues/17310): + // Find a way to hoist the `>> 2` or `>> 3` out of this loop. + array.push(HEAPU32[(firstElement + i * 4) >> 2]); + } + return array + }; + + var runDestructors = (destructors) => { + while (destructors.length) { + var ptr = destructors.pop(); + var del = destructors.pop(); + del(ptr); + } + }; + + function usesDestructorStack(argTypes) { + // Skip return value at index 0 - it's not deleted here. + for (var i = 1; i < argTypes.length; ++i) { + // The type does not define a destructor function - must use dynamic stack + if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { + return true + } + } + return false + } + + function newFunc(constructor, argumentList) { + if (!(constructor instanceof Function)) { + throw new TypeError( + `new_ called with constructor type ${typeof constructor} which is not a function` + ) + } + /* + * Previously, the following line was just: + * function dummy() {}; + * Unfortunately, Chrome was preserving 'dummy' as the object's name, even + * though at creation, the 'dummy' has the correct constructor name. Thus, + * objects created with IMVU.new would show up in the debugger as 'dummy', + * which isn't very helpful. Using IMVU.createNamedFunction addresses the + * issue. Doubly-unfortunately, there's no way to write a test for this + * behavior. -NRD 2013.02.22 + */ + var dummy = createNamedFunction(constructor.name || 'unknownFunctionName', function () {}); + dummy.prototype = constructor.prototype; + var obj = new dummy(); + + var r = constructor.apply(obj, argumentList); + return r instanceof Object ? r : obj + } + + function createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync) { + var needsDestructorStack = usesDestructorStack(argTypes); + var argCount = argTypes.length; + var argsList = ''; + var argsListWired = ''; + for (var i = 0; i < argCount - 2; ++i) { + argsList += (i !== 0 ? ', ' : '') + 'arg' + i; + argsListWired += (i !== 0 ? ', ' : '') + 'arg' + i + 'Wired'; + } + + var invokerFnBody = ` + return function (${argsList}) { + if (arguments.length !== ${argCount - 2}) { + throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${argCount - 2}'); + }`; + + if (needsDestructorStack) { + invokerFnBody += 'var destructors = [];\n'; + } + + var dtorStack = needsDestructorStack ? 'destructors' : 'null'; + var args1 = [ + 'humanName', + 'throwBindingError', + 'invoker', + 'fn', + 'runDestructors', + 'retType', + 'classParam', + ]; + + if (isClassMethodFunc) { + invokerFnBody += "var thisWired = classParam['toWireType'](" + dtorStack + ', this);\n'; + } + + for (var i = 0; i < argCount - 2; ++i) { + invokerFnBody += + 'var arg' + + i + + 'Wired = argType' + + i + + "['toWireType'](" + + dtorStack + + ', arg' + + i + + ');\n'; + args1.push('argType' + i); + } + + if (isClassMethodFunc) { + argsListWired = 'thisWired' + (argsListWired.length > 0 ? ', ' : '') + argsListWired; + } + + invokerFnBody += + (returns || isAsync ? 'var rv = ' : '') + + 'invoker(fn' + + (argsListWired.length > 0 ? ', ' : '') + + argsListWired + + ');\n'; + + if (needsDestructorStack) { + invokerFnBody += 'runDestructors(destructors);\n'; + } else { + for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { + // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. + var paramName = i === 1 ? 'thisWired' : 'arg' + (i - 2) + 'Wired'; + if (argTypes[i].destructorFunction !== null) { + invokerFnBody += `${paramName}_dtor(${paramName});\n`; + args1.push(`${paramName}_dtor`); + } + } + } + + if (returns) { + invokerFnBody += "var ret = retType['fromWireType'](rv);\n" + 'return ret;\n'; + } + + invokerFnBody += '}\n'; + + return [args1, invokerFnBody] + } + function craftInvokerFunction( + humanName, + argTypes, + classType, + cppInvokerFunc, + cppTargetFunc, + /** boolean= */ isAsync + ) { + // humanName: a human-readable string name for the function to be generated. + // argTypes: An array that contains the embind type objects for all types in the function signature. + // argTypes[0] is the type object for the function return value. + // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method. + // argTypes[2...] are the actual function parameters. + // classType: The embind type object for the class to be bound, or null if this is not a method of a class. + // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code. + // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling. + // isAsync: Optional. If true, returns an async function. Async bindings are only supported with JSPI. + var argCount = argTypes.length; + + if (argCount < 2) { + throwBindingError( + "argTypes array size mismatch! Must at least get return value and 'this' types!" + ); + } + + var isClassMethodFunc = argTypes[1] !== null && classType !== null; + + // Free functions with signature "void function()" do not need an invoker that marshalls between wire types. + // TODO: This omits argument count check - enable only at -O3 or similar. + // if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) { + // return FUNCTION_TABLE[fn]; + // } + + // Determine if we need to use a dynamic stack to store the destructors for the function parameters. + // TODO: Remove this completely once all function invokers are being dynamically generated. + var needsDestructorStack = usesDestructorStack(argTypes); + + var returns = argTypes[0].name !== 'void'; + + // Builld the arguments that will be passed into the closure around the invoker + // function. + var closureArgs = [ + humanName, + throwBindingError, + cppInvokerFunc, + cppTargetFunc, + runDestructors, + argTypes[0], + argTypes[1], + ]; + for (var i = 0; i < argCount - 2; ++i) { + closureArgs.push(argTypes[i + 2]); + } + if (!needsDestructorStack) { + for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { + // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. + if (argTypes[i].destructorFunction !== null) { + closureArgs.push(argTypes[i].destructorFunction); + } + } + } + + let [args, invokerFnBody] = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync); + args.push(invokerFnBody); + var invokerFn = newFunc(Function, args)(...closureArgs); + return createNamedFunction(humanName, invokerFn) + } + var __embind_register_class_constructor = ( + rawClassType, + argCount, + rawArgTypesAddr, + invokerSignature, + invoker, + rawConstructor + ) => { + var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); + invoker = embind__requireFunction(invokerSignature, invoker); + + whenDependentTypesAreResolved([], [rawClassType], (classType) => { + classType = classType[0]; + var humanName = `constructor ${classType.name}`; + + if (undefined === classType.registeredClass.constructor_body) { + classType.registeredClass.constructor_body = []; + } + if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) { + throw new BindingError( + `Cannot register multiple constructors with identical number of parameters (${argCount - 1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!` + ) + } + classType.registeredClass.constructor_body[argCount - 1] = () => { + throwUnboundTypeError( + `Cannot construct ${classType.name} due to unbound types`, + rawArgTypes + ); + }; + + whenDependentTypesAreResolved([], rawArgTypes, (argTypes) => { + // Insert empty slot for context type (argTypes[1]). + argTypes.splice(1, 0, null); + classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction( + humanName, + argTypes, + null, + invoker, + rawConstructor + ); + return [] + }); + return [] + }); + }; + + var getFunctionName = (signature) => { + signature = signature.trim(); + const argsIndex = signature.indexOf('('); + if (argsIndex !== -1) { + return signature.substr(0, argsIndex) + } else { + return signature + } + }; + var __embind_register_class_function = ( + rawClassType, + methodName, + argCount, + rawArgTypesAddr, // [ReturnType, ThisType, Args...] + invokerSignature, + rawInvoker, + context, + isPureVirtual, + isAsync + ) => { + var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); + methodName = readLatin1String(methodName); + methodName = getFunctionName(methodName); + rawInvoker = embind__requireFunction(invokerSignature, rawInvoker); + + whenDependentTypesAreResolved([], [rawClassType], (classType) => { + classType = classType[0]; + var humanName = `${classType.name}.${methodName}`; + + if (methodName.startsWith('@@')) { + methodName = Symbol[methodName.substring(2)]; + } + + if (isPureVirtual) { + classType.registeredClass.pureVirtualFunctions.push(methodName); + } + + function unboundTypesHandler() { + throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`, rawArgTypes); + } + + var proto = classType.registeredClass.instancePrototype; + var method = proto[methodName]; + if ( + undefined === method || + (undefined === method.overloadTable && + method.className !== classType.name && + method.argCount === argCount - 2) + ) { + // This is the first overload to be registered, OR we are replacing a + // function in the base class with a function in the derived class. + unboundTypesHandler.argCount = argCount - 2; + unboundTypesHandler.className = classType.name; + proto[methodName] = unboundTypesHandler; + } else { + // There was an existing function with the same name registered. Set up + // a function overload routing table. + ensureOverloadTable(proto, methodName, humanName); + proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler; + } + + whenDependentTypesAreResolved([], rawArgTypes, (argTypes) => { + var memberFunction = craftInvokerFunction( + humanName, + argTypes, + classType, + rawInvoker, + context, + isAsync + ); + + // Replace the initial unbound-handler-stub function with the + // appropriate member function, now that all types are resolved. If + // multiple overloads are registered for this function, the function + // goes into an overload table. + if (undefined === proto[methodName].overloadTable) { + // Set argCount in case an overload is registered later + memberFunction.argCount = argCount - 2; + proto[methodName] = memberFunction; + } else { + proto[methodName].overloadTable[argCount - 2] = memberFunction; + } + + return [] + }); + return [] + }); + }; + + var emval_freelist = []; + + var emval_handles = []; + var __emval_decref = (handle) => { + if (handle > 9 && 0 === --emval_handles[handle + 1]) { + emval_handles[handle] = undefined; + emval_freelist.push(handle); + } + }; + + var count_emval_handles = () => { + return emval_handles.length / 2 - 5 - emval_freelist.length + }; + + var init_emval = () => { + // reserve 0 and some special values. These never get de-allocated. + emval_handles.push(0, 1, undefined, 1, null, 1, true, 1, false, 1); + Module['count_emval_handles'] = count_emval_handles; + }; + var Emval = { + toValue: (handle) => { + if (!handle) { + throwBindingError('Cannot use deleted val. handle = ' + handle); + } + return emval_handles[handle] + }, + toHandle: (value) => { + switch (value) { + case undefined: + return 2 + case null: + return 4 + case true: + return 6 + case false: + return 8 + default: { + const handle = emval_freelist.pop() || emval_handles.length; + emval_handles[handle] = value; + emval_handles[handle + 1] = 1; + return handle + } + } + }, + }; + + var EmValType = { + name: 'emscripten::val', + fromWireType: (handle) => { + var rv = Emval.toValue(handle); + __emval_decref(handle); + return rv + }, + toWireType: (destructors, value) => Emval.toHandle(value), + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: readPointer, + destructorFunction: null, // This type does not need a destructor + + // TODO: do we need a deleteObject here? write a test where + // emval is passed into JS via an interface + }; + var __embind_register_emval = (rawType) => registerType(rawType, EmValType); + + var embindRepr = (v) => { + if (v === null) { + return 'null' + } + var t = typeof v; + if (t === 'object' || t === 'array' || t === 'function') { + return v.toString() + } else { + return '' + v + } + }; + + var floatReadValueFromPointer = (name, width) => { + switch (width) { + case 4: + return function (pointer) { + return this['fromWireType'](HEAPF32[pointer >> 2]) + } + case 8: + return function (pointer) { + return this['fromWireType'](HEAPF64[pointer >> 3]) + } + default: + throw new TypeError(`invalid float width (${width}): ${name}`) + } + }; + + var __embind_register_float = (rawType, name, size) => { + name = readLatin1String(name); + registerType(rawType, { + name, + fromWireType: (value) => value, + toWireType: (destructors, value) => { + // The VM will perform JS to Wasm value conversion, according to the spec: + // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue + return value + }, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: floatReadValueFromPointer(name, size), + destructorFunction: null, // This type does not need a destructor + }); + }; + + var integerReadValueFromPointer = (name, width, signed) => { + // integers are quite common, so generate very specialized functions + switch (width) { + case 1: + return signed ? (pointer) => HEAP8[pointer] : (pointer) => HEAPU8[pointer] + case 2: + return signed ? (pointer) => HEAP16[pointer >> 1] : (pointer) => HEAPU16[pointer >> 1] + case 4: + return signed ? (pointer) => HEAP32[pointer >> 2] : (pointer) => HEAPU32[pointer >> 2] + default: + throw new TypeError(`invalid integer width (${width}): ${name}`) + } + }; + + /** @suppress {globalThis} */ + var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => { + name = readLatin1String(name); + + var fromWireType = (value) => value; + + if (minRange === 0) { + var bitshift = 32 - 8 * size; + fromWireType = (value) => (value << bitshift) >>> bitshift; + } + + var isUnsignedType = name.includes('unsigned'); + var checkAssertions = (value, toTypeName) => {}; + var toWireType; + if (isUnsignedType) { + toWireType = function (destructors, value) { + checkAssertions(value, this.name); + return value >>> 0 + }; + } else { + toWireType = function (destructors, value) { + checkAssertions(value, this.name); + // The VM will perform JS to Wasm value conversion, according to the spec: + // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue + return value + }; + } + registerType(primitiveType, { + name, + fromWireType: fromWireType, + toWireType: toWireType, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0), + destructorFunction: null, // This type does not need a destructor + }); + }; + + var __embind_register_memory_view = (rawType, dataTypeIndex, name) => { + var typeMapping = [ + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + ]; + + var TA = typeMapping[dataTypeIndex]; + + function decodeMemoryView(handle) { + var size = HEAPU32[handle >> 2]; + var data = HEAPU32[(handle + 4) >> 2]; + return new TA(HEAP8.buffer, data, size) + } + + name = readLatin1String(name); + registerType( + rawType, + { + name, + fromWireType: decodeMemoryView, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: decodeMemoryView, + }, + { + ignoreDuplicateRegistrations: true, + } + ); + }; + + var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => { + // Parameter maxBytesToWrite is not optional. Negative values, 0, null, + // undefined and false each don't write out any bytes. + if (!(maxBytesToWrite > 0)) return 0 + + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code + // unit, not a Unicode code point of the character! So decode + // UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description + // and https://www.ietf.org/rfc/rfc2279.txt + // and https://tools.ietf.org/html/rfc3629 + var u = str.charCodeAt(i); // possibly a lead surrogate + if (u >= 0xd800 && u <= 0xdfff) { + var u1 = str.charCodeAt(++i); + u = (0x10000 + ((u & 0x3ff) << 10)) | (u1 & 0x3ff); + } + if (u <= 0x7f) { + if (outIdx >= endIdx) break + heap[outIdx++] = u; + } else if (u <= 0x7ff) { + if (outIdx + 1 >= endIdx) break + heap[outIdx++] = 0xc0 | (u >> 6); + heap[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0xffff) { + if (outIdx + 2 >= endIdx) break + heap[outIdx++] = 0xe0 | (u >> 12); + heap[outIdx++] = 0x80 | ((u >> 6) & 63); + heap[outIdx++] = 0x80 | (u & 63); + } else { + if (outIdx + 3 >= endIdx) break + heap[outIdx++] = 0xf0 | (u >> 18); + heap[outIdx++] = 0x80 | ((u >> 12) & 63); + heap[outIdx++] = 0x80 | ((u >> 6) & 63); + heap[outIdx++] = 0x80 | (u & 63); + } + } + // Null-terminate the pointer to the buffer. + heap[outIdx] = 0; + return outIdx - startIdx + }; + var stringToUTF8 = (str, outPtr, maxBytesToWrite) => { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) + }; + + var lengthBytesUTF8 = (str) => { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code + // unit, not a Unicode code point of the character! So decode + // UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var c = str.charCodeAt(i); // possibly a lead surrogate + if (c <= 0x7f) { + len++; + } else if (c <= 0x7ff) { + len += 2; + } else if (c >= 0xd800 && c <= 0xdfff) { + len += 4; + ++i; + } else { + len += 3; + } + } + return len + }; + + var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined; + + /** + * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given + * array that contains uint8 values, returns a copy of that string as a + * Javascript String object. + * heapOrArray is either a regular array, or a JavaScript typed array view. + * @param {number} idx + * @param {number=} maxBytesToRead + * @return {string} + */ + var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + // TextDecoder needs to know the byte length in advance, it doesn't stop on + // null terminator by itself. Also, use the length info to avoid running tiny + // strings through TextDecoder, since .subarray() allocates garbage. + // (As a tiny code save trick, compare endPtr against endIdx using a negation, + // so that undefined means Infinity) + while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; + + if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { + return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)) + } + var str = ''; + // If building with TextDecoder, we have already computed the string length + // above, so test loop end condition against that + while (idx < endPtr) { + // For UTF8 byte structure, see: + // http://en.wikipedia.org/wiki/UTF-8#Description + // https://www.ietf.org/rfc/rfc2279.txt + // https://tools.ietf.org/html/rfc3629 + var u0 = heapOrArray[idx++]; + if (!(u0 & 0x80)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heapOrArray[idx++] & 63; + if ((u0 & 0xe0) == 0xc0) { + str += String.fromCharCode(((u0 & 31) << 6) | u1); + continue + } + var u2 = heapOrArray[idx++] & 63; + if ((u0 & 0xf0) == 0xe0) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63); + } + + if (u0 < 0x10000) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 0x10000; + str += String.fromCharCode(0xd800 | (ch >> 10), 0xdc00 | (ch & 0x3ff)); + } + } + return str + }; + + /** + * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the + * emscripten HEAP, returns a copy of that string as a Javascript String object. + * + * @param {number} ptr + * @param {number=} maxBytesToRead - An optional length that specifies the + * maximum number of bytes to read. You can omit this parameter to scan the + * string until the first 0 byte. If maxBytesToRead is passed, and the string + * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the + * string will cut short at that byte index (i.e. maxBytesToRead will not + * produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing + * frequent uses of UTF8ToString() with and without maxBytesToRead may throw + * JS JIT optimizations off, so it is worth to consider consistently using one + * @return {string} + */ + var UTF8ToString = (ptr, maxBytesToRead) => { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '' + }; + var __embind_register_std_string = (rawType, name) => { + name = readLatin1String(name); + var stdStringIsUTF8 = + //process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string + name === 'std::string'; + + registerType(rawType, { + name, + // For some method names we use string keys here since they are part of + // the public/external API and/or used by the runtime-generated code. + fromWireType(value) { + var length = HEAPU32[value >> 2]; + var payload = value + 4; + + var str; + if (stdStringIsUTF8) { + var decodeStartPtr = payload; + // Looping here to support possible embedded '0' bytes + for (var i = 0; i <= length; ++i) { + var currentBytePtr = payload + i; + if (i == length || HEAPU8[currentBytePtr] == 0) { + var maxRead = currentBytePtr - decodeStartPtr; + var stringSegment = UTF8ToString(decodeStartPtr, maxRead); + if (str === undefined) { + str = stringSegment; + } else { + str += String.fromCharCode(0); + str += stringSegment; + } + decodeStartPtr = currentBytePtr + 1; + } + } + } else { + var a = new Array(length); + for (var i = 0; i < length; ++i) { + a[i] = String.fromCharCode(HEAPU8[payload + i]); + } + str = a.join(''); + } + + _free(value); + + return str + }, + toWireType(destructors, value) { + if (value instanceof ArrayBuffer) { + value = new Uint8Array(value); + } + + var length; + var valueIsOfTypeString = typeof value == 'string'; + + if ( + !( + valueIsOfTypeString || + value instanceof Uint8Array || + value instanceof Uint8ClampedArray || + value instanceof Int8Array + ) + ) { + throwBindingError('Cannot pass non-string to std::string'); + } + if (stdStringIsUTF8 && valueIsOfTypeString) { + length = lengthBytesUTF8(value); + } else { + length = value.length; + } + + // assumes POINTER_SIZE alignment + var base = _malloc(4 + length + 1); + var ptr = base + 4; + HEAPU32[base >> 2] = length; + if (stdStringIsUTF8 && valueIsOfTypeString) { + stringToUTF8(value, ptr, length + 1); + } else { + if (valueIsOfTypeString) { + for (var i = 0; i < length; ++i) { + var charCode = value.charCodeAt(i); + if (charCode > 255) { + _free(ptr); + throwBindingError('String has UTF-16 code units that do not fit in 8 bits'); + } + HEAPU8[ptr + i] = charCode; + } + } else { + for (var i = 0; i < length; ++i) { + HEAPU8[ptr + i] = value[i]; + } + } + } + + if (destructors !== null) { + destructors.push(_free, base); + } + return base + }, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: readPointer, + destructorFunction(ptr) { + _free(ptr); + }, + }); + }; + + var UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined; + var UTF16ToString = (ptr, maxBytesToRead) => { + var endPtr = ptr; + // TextDecoder needs to know the byte length in advance, it doesn't stop on + // null terminator by itself. + // Also, use the length info to avoid running tiny strings through + // TextDecoder, since .subarray() allocates garbage. + var idx = endPtr >> 1; + var maxIdx = idx + maxBytesToRead / 2; + // If maxBytesToRead is not passed explicitly, it will be undefined, and this + // will always evaluate to true. This saves on code size. + while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx; + endPtr = idx << 1; + + if (endPtr - ptr > 32 && UTF16Decoder) + return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)) + + // Fallback: decode without UTF16Decoder + var str = ''; + + // If maxBytesToRead is not passed explicitly, it will be undefined, and the + // for-loop's condition will always evaluate to true. The loop is then + // terminated on the first null char. + for (var i = 0; !(i >= maxBytesToRead / 2); ++i) { + var codeUnit = HEAP16[(ptr + i * 2) >> 1]; + if (codeUnit == 0) break + // fromCharCode constructs a character from a UTF-16 code unit, so we can + // pass the UTF16 string right through. + str += String.fromCharCode(codeUnit); + } + + return str + }; + + var stringToUTF16 = (str, outPtr, maxBytesToWrite) => { + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + maxBytesToWrite ??= 0x7fffffff; + if (maxBytesToWrite < 2) return 0 + maxBytesToWrite -= 2; // Null terminator. + var startPtr = outPtr; + var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; + for (var i = 0; i < numCharsToWrite; ++i) { + // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP. + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + HEAP16[outPtr >> 1] = codeUnit; + outPtr += 2; + } + // Null-terminate the pointer to the HEAP. + HEAP16[outPtr >> 1] = 0; + return outPtr - startPtr + }; + + var lengthBytesUTF16 = (str) => { + return str.length * 2 + }; + + var UTF32ToString = (ptr, maxBytesToRead) => { + var i = 0; + + var str = ''; + // If maxBytesToRead is not passed explicitly, it will be undefined, and this + // will always evaluate to true. This saves on code size. + while (!(i >= maxBytesToRead / 4)) { + var utf32 = HEAP32[(ptr + i * 4) >> 2]; + if (utf32 == 0) break + ++i; + // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + if (utf32 >= 0x10000) { + var ch = utf32 - 0x10000; + str += String.fromCharCode(0xd800 | (ch >> 10), 0xdc00 | (ch & 0x3ff)); + } else { + str += String.fromCharCode(utf32); + } + } + return str + }; + + var stringToUTF32 = (str, outPtr, maxBytesToWrite) => { + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + maxBytesToWrite ??= 0x7fffffff; + if (maxBytesToWrite < 4) return 0 + var startPtr = outPtr; + var endPtr = startPtr + maxBytesToWrite - 4; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + if (codeUnit >= 0xd800 && codeUnit <= 0xdfff) { + var trailSurrogate = str.charCodeAt(++i); + codeUnit = (0x10000 + ((codeUnit & 0x3ff) << 10)) | (trailSurrogate & 0x3ff); + } + HEAP32[outPtr >> 2] = codeUnit; + outPtr += 4; + if (outPtr + 4 > endPtr) break + } + // Null-terminate the pointer to the HEAP. + HEAP32[outPtr >> 2] = 0; + return outPtr - startPtr + }; + + var lengthBytesUTF32 = (str) => { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); + if (codeUnit >= 0xd800 && codeUnit <= 0xdfff) ++i; // possibly a lead surrogate, so skip over the tail surrogate. + len += 4; + } + + return len + }; + var __embind_register_std_wstring = (rawType, charSize, name) => { + name = readLatin1String(name); + var decodeString, encodeString, readCharAt, lengthBytesUTF; + if (charSize === 2) { + decodeString = UTF16ToString; + encodeString = stringToUTF16; + lengthBytesUTF = lengthBytesUTF16; + readCharAt = (pointer) => HEAPU16[pointer >> 1]; + } else if (charSize === 4) { + decodeString = UTF32ToString; + encodeString = stringToUTF32; + lengthBytesUTF = lengthBytesUTF32; + readCharAt = (pointer) => HEAPU32[pointer >> 2]; + } + registerType(rawType, { + name, + fromWireType: (value) => { + // Code mostly taken from _embind_register_std_string fromWireType + var length = HEAPU32[value >> 2]; + var str; + + var decodeStartPtr = value + 4; + // Looping here to support possible embedded '0' bytes + for (var i = 0; i <= length; ++i) { + var currentBytePtr = value + 4 + i * charSize; + if (i == length || readCharAt(currentBytePtr) == 0) { + var maxReadBytes = currentBytePtr - decodeStartPtr; + var stringSegment = decodeString(decodeStartPtr, maxReadBytes); + if (str === undefined) { + str = stringSegment; + } else { + str += String.fromCharCode(0); + str += stringSegment; + } + decodeStartPtr = currentBytePtr + charSize; + } + } + + _free(value); + + return str + }, + toWireType: (destructors, value) => { + if (!(typeof value == 'string')) { + throwBindingError(`Cannot pass non-string to C++ string type ${name}`); + } + + // assumes POINTER_SIZE alignment + var length = lengthBytesUTF(value); + var ptr = _malloc(4 + length + charSize); + HEAPU32[ptr >> 2] = length / charSize; + + encodeString(value, ptr + 4, length + charSize); + + if (destructors !== null) { + destructors.push(_free, ptr); + } + return ptr + }, + argPackAdvance: GenericWireTypeSize, + readValueFromPointer: readPointer, + destructorFunction(ptr) { + _free(ptr); + }, + }); + }; + + var __embind_register_void = (rawType, name) => { + name = readLatin1String(name); + registerType(rawType, { + isVoid: true, // void return values can be optimized out sometimes + name, + argPackAdvance: 0, + fromWireType: () => undefined, + // TODO: assert if anything else is given? + toWireType: (destructors, o) => undefined, + }); + }; + + var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num); + + var convertI32PairToI53Checked = (lo, hi) => { + return (hi + 0x200000) >>> 0 < 0x400001 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN + }; + function __gmtime_js(time_low, time_high, tmPtr) { + var time = convertI32PairToI53Checked(time_low, time_high); + + var date = new Date(time * 1000); + HEAP32[tmPtr >> 2] = date.getUTCSeconds(); + HEAP32[(tmPtr + 4) >> 2] = date.getUTCMinutes(); + HEAP32[(tmPtr + 8) >> 2] = date.getUTCHours(); + HEAP32[(tmPtr + 12) >> 2] = date.getUTCDate(); + HEAP32[(tmPtr + 16) >> 2] = date.getUTCMonth(); + HEAP32[(tmPtr + 20) >> 2] = date.getUTCFullYear() - 1900; + HEAP32[(tmPtr + 24) >> 2] = date.getUTCDay(); + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = ((date.getTime() - start) / (1000 * 60 * 60 * 24)) | 0; + HEAP32[(tmPtr + 28) >> 2] = yday; + } + + var __tzset_js = (timezone, daylight, std_name, dst_name) => { + // TODO: Use (malleable) environment variables instead of system settings. + var currentYear = new Date().getFullYear(); + var winter = new Date(currentYear, 0, 1); + var summer = new Date(currentYear, 6, 1); + var winterOffset = winter.getTimezoneOffset(); + var summerOffset = summer.getTimezoneOffset(); + + // Local standard timezone offset. Local standard time is not adjusted for + // daylight savings. This code uses the fact that getTimezoneOffset returns + // a greater value during Standard Time versus Daylight Saving Time (DST). + // Thus it determines the expected output during Standard Time, and it + // compares whether the output of the given date the same (Standard) or less + // (DST). + var stdTimezoneOffset = Math.max(winterOffset, summerOffset); + + // timezone is specified as seconds west of UTC ("The external variable + // `timezone` shall be set to the difference, in seconds, between + // Coordinated Universal Time (UTC) and local standard time."), the same + // as returned by stdTimezoneOffset. + // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html + HEAPU32[timezone >> 2] = stdTimezoneOffset * 60; + + HEAP32[daylight >> 2] = Number(winterOffset != summerOffset); + + var extractZone = (date) => + date.toLocaleTimeString(undefined, { hour12: false, timeZoneName: 'short' }).split(' ')[1]; + var winterName = extractZone(winter); + var summerName = extractZone(summer); + if (summerOffset < winterOffset) { + // Northern hemisphere + stringToUTF8(winterName, std_name, 17); + stringToUTF8(summerName, dst_name, 17); + } else { + stringToUTF8(winterName, dst_name, 17); + stringToUTF8(summerName, std_name, 17); + } + }; + + var _emscripten_date_now = () => Date.now(); + + var getHeapMax = () => + // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate + // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side + // for any code that deals with heap sizes, which would require special + // casing all heap size related code to treat 0 specially. + 2147483648; + + var growMemory = (size) => { + var b = wasmMemory.buffer; + var pages = (size - b.byteLength + 65535) / 65536; + try { + // round size grow request up to wasm page size (fixed 64KB per spec) + wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size + updateMemoryViews(); + return 1 /*success*/ + } catch (e) {} + // implicit 0 return to save code size (caller will cast "undefined" into 0 + // anyhow) + }; + var _emscripten_resize_heap = (requestedSize) => { + var oldSize = HEAPU8.length; + // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned. + requestedSize >>>= 0; + // With multithreaded builds, races can happen (another thread might increase the size + // in between), so return a failure, and let the caller retry. + + // Memory resize rules: + // 1. Always increase heap size to at least the requested size, rounded up + // to next page multiple. + // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap + // geometrically: increase the heap size according to + // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most + // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB). + // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap + // linearly: increase the heap size by at least + // MEMORY_GROWTH_LINEAR_STEP bytes. + // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by + // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest + // 4. If we were unable to allocate as much memory, it may be due to + // over-eager decision to excessively reserve due to (3) above. + // Hence if an allocation fails, cut down on the amount of excess + // growth, in an attempt to succeed to perform a smaller allocation. + + // A limit is set for how much we can grow. We should not exceed that + // (the wasm binary specifies it, so if we tried, we'd fail anyhow). + var maxHeapSize = getHeapMax(); + if (requestedSize > maxHeapSize) { + return false + } + + var alignUp = (x, multiple) => x + ((multiple - (x % multiple)) % multiple); + + // Loop through potential heap size increases. If we attempt a too eager + // reservation that fails, cut down on the attempted size and reserve a + // smaller bump instead. (max 3 times, chosen somewhat arbitrarily) + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth + // but limit overreserving (default to capping at +96MB overgrowth at most) + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + + var newSize = Math.min( + maxHeapSize, + alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) + ); + + var replacement = growMemory(newSize); + if (replacement) { + return true + } + } + return false + }; + + var ENV = {}; + + var getExecutableName = () => { + return thisProgram + }; + var getEnvStrings = () => { + if (!getEnvStrings.strings) { + // Default values. + // Browser language detection #8751 + var lang = + ( + (typeof navigator == 'object' && navigator.languages && navigator.languages[0]) || + 'C' + ).replace('-', '_') + '.UTF-8'; + var env = { + USER: 'web_user', + LOGNAME: 'web_user', + PATH: '/', + PWD: '/', + HOME: '/home/web_user', + LANG: lang, + _: getExecutableName(), + }; + // Apply the user-provided values, if any. + for (var x in ENV) { + // x is a key in ENV; if ENV[x] is undefined, that means it was + // explicitly set to be so. We allow user code to do that to + // force variables with default values to remain unset. + if (ENV[x] === undefined) delete env[x]; + else env[x] = ENV[x]; + } + var strings = []; + for (var x in env) { + strings.push(`${x}=${env[x]}`); + } + getEnvStrings.strings = strings; + } + return getEnvStrings.strings + }; + + var stringToAscii = (str, buffer) => { + for (var i = 0; i < str.length; ++i) { + HEAP8[buffer++] = str.charCodeAt(i); + } + // Null-terminate the string + HEAP8[buffer] = 0; + }; + var _environ_get = (__environ, environ_buf) => { + var bufSize = 0; + getEnvStrings().forEach((string, i) => { + var ptr = environ_buf + bufSize; + HEAPU32[(__environ + i * 4) >> 2] = ptr; + stringToAscii(string, ptr); + bufSize += string.length + 1; + }); + return 0 + }; + + var _environ_sizes_get = (penviron_count, penviron_buf_size) => { + var strings = getEnvStrings(); + HEAPU32[penviron_count >> 2] = strings.length; + var bufSize = 0; + strings.forEach((string) => (bufSize += string.length + 1)); + HEAPU32[penviron_buf_size >> 2] = bufSize; + return 0 + }; + + var isLeapYear = (year) => year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + + var arraySum = (array, index) => { + var sum = 0; + for (var i = 0; i <= index; sum += array[i++]) { + // no-op + } + return sum + }; + + var MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + var MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + var addDays = (date, days) => { + var newDate = new Date(date.getTime()); + while (days > 0) { + var leap = isLeapYear(newDate.getFullYear()); + var currentMonth = newDate.getMonth(); + var daysInCurrentMonth = (leap ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR)[currentMonth]; + + if (days > daysInCurrentMonth - newDate.getDate()) { + // we spill over to next month + days -= daysInCurrentMonth - newDate.getDate() + 1; + newDate.setDate(1); + if (currentMonth < 11) { + newDate.setMonth(currentMonth + 1); + } else { + newDate.setMonth(0); + newDate.setFullYear(newDate.getFullYear() + 1); + } + } else { + // we stay in current month + newDate.setDate(newDate.getDate() + days); + return newDate + } + } + + return newDate + }; + + /** @type {function(string, boolean=, number=)} */ + function intArrayFromString(stringy, dontAddNull, length) { + var len = lengthBytesUTF8(stringy) + 1; + var u8array = new Array(len); + stringToUTF8Array(stringy, u8array, 0, u8array.length); + return u8array + } + + var writeArrayToMemory = (array, buffer) => { + HEAP8.set(array, buffer); + }; + + var _strftime = (s, maxsize, format, tm) => { + // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr); + // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html + + var tm_zone = HEAPU32[(tm + 40) >> 2]; + + var date = { + tm_sec: HEAP32[tm >> 2], + tm_min: HEAP32[(tm + 4) >> 2], + tm_hour: HEAP32[(tm + 8) >> 2], + tm_mday: HEAP32[(tm + 12) >> 2], + tm_mon: HEAP32[(tm + 16) >> 2], + tm_year: HEAP32[(tm + 20) >> 2], + tm_wday: HEAP32[(tm + 24) >> 2], + tm_yday: HEAP32[(tm + 28) >> 2], + tm_isdst: HEAP32[(tm + 32) >> 2], + tm_gmtoff: HEAP32[(tm + 36) >> 2], + tm_zone: tm_zone ? UTF8ToString(tm_zone) : '', + }; + + var pattern = UTF8ToString(format); + + // expand format + var EXPANSION_RULES_1 = { + '%c': '%a %b %d %H:%M:%S %Y', // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013 + '%D': '%m/%d/%y', // Equivalent to %m / %d / %y + '%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d + '%h': '%b', // Equivalent to %b + '%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation + '%R': '%H:%M', // Replaced by the time in 24-hour notation + '%T': '%H:%M:%S', // Replaced by the time + '%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation + '%X': '%H:%M:%S', // Replaced by the locale's appropriate time representation + // Modified Conversion Specifiers + '%Ec': '%c', // Replaced by the locale's alternative appropriate date and time representation. + '%EC': '%C', // Replaced by the name of the base year (period) in the locale's alternative representation. + '%Ex': '%m/%d/%y', // Replaced by the locale's alternative date representation. + '%EX': '%H:%M:%S', // Replaced by the locale's alternative time representation. + '%Ey': '%y', // Replaced by the offset from %EC (year only) in the locale's alternative representation. + '%EY': '%Y', // Replaced by the full alternative year representation. + '%Od': '%d', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading characters. + '%Oe': '%e', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading characters. + '%OH': '%H', // Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols. + '%OI': '%I', // Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols. + '%Om': '%m', // Replaced by the month using the locale's alternative numeric symbols. + '%OM': '%M', // Replaced by the minutes using the locale's alternative numeric symbols. + '%OS': '%S', // Replaced by the seconds using the locale's alternative numeric symbols. + '%Ou': '%u', // Replaced by the weekday as a number in the locale's alternative representation (Monday=1). + '%OU': '%U', // Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols. + '%OV': '%V', // Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols. + '%Ow': '%w', // Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols. + '%OW': '%W', // Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols. + '%Oy': '%y', // Replaced by the year (offset from %C ) using the locale's alternative numeric symbols. + }; + for (var rule in EXPANSION_RULES_1) { + pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]); + } + + var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var MONTHS = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', + ]; + + function leadingSomething(value, digits, character) { + var str = typeof value == 'number' ? value.toString() : value || ''; + while (str.length < digits) { + str = character[0] + str; + } + return str + } + + function leadingNulls(value, digits) { + return leadingSomething(value, digits, '0') + } + + function compareByDay(date1, date2) { + function sgn(value) { + return value < 0 ? -1 : value > 0 ? 1 : 0 + } + + var compare; + if ((compare = sgn(date1.getFullYear() - date2.getFullYear())) === 0) { + if ((compare = sgn(date1.getMonth() - date2.getMonth())) === 0) { + compare = sgn(date1.getDate() - date2.getDate()); + } + } + return compare + } + + function getFirstWeekStartDate(janFourth) { + switch (janFourth.getDay()) { + case 0: // Sunday + return new Date(janFourth.getFullYear() - 1, 11, 29) + case 1: // Monday + return janFourth + case 2: // Tuesday + return new Date(janFourth.getFullYear(), 0, 3) + case 3: // Wednesday + return new Date(janFourth.getFullYear(), 0, 2) + case 4: // Thursday + return new Date(janFourth.getFullYear(), 0, 1) + case 5: // Friday + return new Date(janFourth.getFullYear() - 1, 11, 31) + case 6: // Saturday + return new Date(janFourth.getFullYear() - 1, 11, 30) + } + } + + function getWeekBasedYear(date) { + var thisDate = addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday); + + var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4); + var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4); + + var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); + var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); + + if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) { + // this date is after the start of the first week of this year + if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) { + return thisDate.getFullYear() + 1 + } + return thisDate.getFullYear() + } + return thisDate.getFullYear() - 1 + } + + var EXPANSION_RULES_2 = { + '%a': (date) => WEEKDAYS[date.tm_wday].substring(0, 3), + '%A': (date) => WEEKDAYS[date.tm_wday], + '%b': (date) => MONTHS[date.tm_mon].substring(0, 3), + '%B': (date) => MONTHS[date.tm_mon], + '%C': (date) => { + var year = date.tm_year + 1900; + return leadingNulls((year / 100) | 0, 2) + }, + '%d': (date) => leadingNulls(date.tm_mday, 2), + '%e': (date) => leadingSomething(date.tm_mday, 2, ' '), + '%g': (date) => { + // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. + // In this system, weeks begin on a Monday and week 1 of the year is the week that includes + // January 4th, which is also the week that includes the first Thursday of the year, and + // is also the first week that contains at least four days in the year. + // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of + // the last week of the preceding year; thus, for Saturday 2nd January 1999, + // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th, + // or 31st is a Monday, it and any following days are part of week 1 of the following year. + // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01. + + return getWeekBasedYear(date).toString().substring(2) + }, + '%G': getWeekBasedYear, + '%H': (date) => leadingNulls(date.tm_hour, 2), + '%I': (date) => { + var twelveHour = date.tm_hour; + if (twelveHour == 0) twelveHour = 12; + else if (twelveHour > 12) twelveHour -= 12; + return leadingNulls(twelveHour, 2) + }, + '%j': (date) => { + // Day of the year (001-366) + return leadingNulls( + date.tm_mday + + arraySum( + isLeapYear(date.tm_year + 1900) ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR, + date.tm_mon - 1 + ), + 3 + ) + }, + '%m': (date) => leadingNulls(date.tm_mon + 1, 2), + '%M': (date) => leadingNulls(date.tm_min, 2), + '%n': () => '\n', + '%p': (date) => { + if (date.tm_hour >= 0 && date.tm_hour < 12) { + return 'AM' + } + return 'PM' + }, + '%S': (date) => leadingNulls(date.tm_sec, 2), + '%t': () => '\t', + '%u': (date) => date.tm_wday || 7, + '%U': (date) => { + var days = date.tm_yday + 7 - date.tm_wday; + return leadingNulls(Math.floor(days / 7), 2) + }, + '%V': (date) => { + // Replaced by the week number of the year (Monday as the first day of the week) + // as a decimal number [01,53]. If the week containing 1 January has four + // or more days in the new year, then it is considered week 1. + // Otherwise, it is the last week of the previous year, and the next week is week 1. + // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday] + var val = Math.floor((date.tm_yday + 7 - ((date.tm_wday + 6) % 7)) / 7); + // If 1 Jan is just 1-3 days past Monday, the previous week + // is also in this year. + if ((date.tm_wday + 371 - date.tm_yday - 2) % 7 <= 2) { + val++; + } + if (!val) { + val = 52; + // If 31 December of prev year a Thursday, or Friday of a + // leap year, then the prev year has 53 weeks. + var dec31 = (date.tm_wday + 7 - date.tm_yday - 1) % 7; + if (dec31 == 4 || (dec31 == 5 && isLeapYear((date.tm_year % 400) - 1))) { + val++; + } + } else if (val == 53) { + // If 1 January is not a Thursday, and not a Wednesday of a + // leap year, then this year has only 52 weeks. + var jan1 = (date.tm_wday + 371 - date.tm_yday) % 7; + if (jan1 != 4 && (jan1 != 3 || !isLeapYear(date.tm_year))) val = 1; + } + return leadingNulls(val, 2) + }, + '%w': (date) => date.tm_wday, + '%W': (date) => { + var days = date.tm_yday + 7 - ((date.tm_wday + 6) % 7); + return leadingNulls(Math.floor(days / 7), 2) + }, + '%y': (date) => { + // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year] + return (date.tm_year + 1900).toString().substring(2) + }, + // Replaced by the year as a decimal number (for example, 1997). [ tm_year] + '%Y': (date) => date.tm_year + 1900, + '%z': (date) => { + // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ). + // For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). + var off = date.tm_gmtoff; + var ahead = off >= 0; + off = Math.abs(off) / 60; + // convert from minutes into hhmm format (which means 60 minutes = 100 units) + off = (off / 60) * 100 + (off % 60); + return (ahead ? '+' : '-') + String('0000' + off).slice(-4) + }, + '%Z': (date) => date.tm_zone, + '%%': () => '%', + }; + + // Replace %% with a pair of NULLs (which cannot occur in a C string), then + // re-inject them after processing. + pattern = pattern.replace(/%%/g, '\0\0'); + for (var rule in EXPANSION_RULES_2) { + if (pattern.includes(rule)) { + pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date)); + } + } + pattern = pattern.replace(/\0\0/g, '%'); + + var bytes = intArrayFromString(pattern); + if (bytes.length > maxsize) { + return 0 + } + + writeArrayToMemory(bytes, s); + return bytes.length - 1 + }; + var _strftime_l = (s, maxsize, format, tm, loc) => { + return _strftime(s, maxsize, format, tm) // no locale support yet + }; + embind_init_charCodes(); + BindingError = Module['BindingError'] = class BindingError extends Error { + constructor(message) { + super(message); + this.name = 'BindingError'; + } + }; + InternalError = Module['InternalError'] = class InternalError extends Error { + constructor(message) { + super(message); + this.name = 'InternalError'; + } + }; + init_ClassHandle(); + init_embind(); + init_RegisteredPointer(); + UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError'); + init_emval(); + var wasmImports = { + /** @export */ + _abort_js: __abort_js, + /** @export */ + _embind_register_bigint: __embind_register_bigint, + /** @export */ + _embind_register_bool: __embind_register_bool, + /** @export */ + _embind_register_class: __embind_register_class, + /** @export */ + _embind_register_class_constructor: __embind_register_class_constructor, + /** @export */ + _embind_register_class_function: __embind_register_class_function, + /** @export */ + _embind_register_emval: __embind_register_emval, + /** @export */ + _embind_register_float: __embind_register_float, + /** @export */ + _embind_register_integer: __embind_register_integer, + /** @export */ + _embind_register_memory_view: __embind_register_memory_view, + /** @export */ + _embind_register_std_string: __embind_register_std_string, + /** @export */ + _embind_register_std_wstring: __embind_register_std_wstring, + /** @export */ + _embind_register_void: __embind_register_void, + /** @export */ + _emscripten_memcpy_js: __emscripten_memcpy_js, + /** @export */ + _gmtime_js: __gmtime_js, + /** @export */ + _tzset_js: __tzset_js, + /** @export */ + emscripten_date_now: _emscripten_date_now, + /** @export */ + emscripten_resize_heap: _emscripten_resize_heap, + /** @export */ + environ_get: _environ_get, + /** @export */ + environ_sizes_get: _environ_sizes_get, + /** @export */ + strftime_l: _strftime_l, + }; + var wasmExports = createWasm(); + var ___getTypeName = (a0) => (___getTypeName = wasmExports['__getTypeName'])(a0); + var _malloc = (a0) => (_malloc = wasmExports['malloc'])(a0); + var _free = (a0) => (_free = wasmExports['free'])(a0); + (Module['dynCall_iiijj'] = (a0, a1, a2, a3, a4, a5, a6) => + (Module['dynCall_iiijj'] = wasmExports['dynCall_iiijj'])( + a0, + a1, + a2, + a3, + a4, + a5, + a6 + )); + (Module['dynCall_viijii'] = (a0, a1, a2, a3, a4, a5, a6) => + (Module['dynCall_viijii'] = wasmExports['dynCall_viijii'])( + a0, + a1, + a2, + a3, + a4, + a5, + a6 + )); + (Module['dynCall_iiiiij'] = (a0, a1, a2, a3, a4, a5, a6) => + (Module['dynCall_iiiiij'] = wasmExports['dynCall_iiiiij'])( + a0, + a1, + a2, + a3, + a4, + a5, + a6 + )); + (Module['dynCall_iiiiijj'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => + (Module['dynCall_iiiiijj'] = wasmExports['dynCall_iiiiijj'])( + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8 + )); + (Module['dynCall_iiiiiijj'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) => + (Module['dynCall_iiiiiijj'] = wasmExports['dynCall_iiiiiijj'])( + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9 + )); + + // include: postamble.js + // === Auto-generated postamble setup entry stuff === + + var calledRun; + + dependenciesFulfilled = function runCaller() { + // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled + }; + + function run() { + if (runDependencies > 0) { + return + } + + preRun(); + + // a preRun added a dependency, run will be called later + if (runDependencies > 0) { + return + } + + function doRun() { + // run may have just been called through dependencies being fulfilled just in this very frame, + // or while the async setStatus time below was happening + if (calledRun) return + calledRun = true; + Module['calledRun'] = true; + + if (ABORT) return + + initRuntime(); + + readyPromiseResolve(Module); + + postRun(); + } + + { + doRun(); + } + } + + run(); + + // end include: postamble.js + + // include: postamble_modularize.js + // In MODULARIZE mode we wrap the generated code in a factory function + // and return either the Module itself, or a promise of the module. + // + // We assign to the `moduleRtn` global here and configure closure to see + // this as and extern so it won't get minified. + + moduleRtn = readyPromise; + + // end include: postamble_modularize.js + + return moduleRtn + } + })(); + + const _excluded = ["locateFile"]; + const noopPrint = () => { + // No-op + }; + function defaultLocateFile(path, prefix) { + try { + const url = new URL(prefix); + if (url.pathname === '/') { + return "".concat(prefix, "mediainfo.js/dist/").concat(path); + } + } catch (_unused) { + // empty + } + return "".concat(prefix, "../").concat(path); + } + + // TODO pass through more emscripten module options? + + /** + * Creates a {@link MediaInfo} instance with the specified options. + * + * @typeParam TFormat - The format type, defaults to `object`. + * @param options - Configuration options for creating the {@link MediaInfo} instance. + * @returns A promise that resolves to a {@link MediaInfo} instance when no callback is provided. + */ + + /** + * Creates a {@link MediaInfo} instance with the specified options and executes the callback. + * + * @typeParam TFormat - The format type, defaults to `object`. + * @param options - Configuration options for creating the {@link MediaInfo} instance. + * @param callback - Function to call with the {@link MediaInfo} instance. + * @param errCallback - Optional function to call on error. + */ + + function mediaInfoFactory() { + var _options$format; + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let callback = arguments.length > 1 ? arguments[1] : undefined; + let errCallback = arguments.length > 2 ? arguments[2] : undefined; + if (callback === undefined) { + return new Promise((resolve, reject) => { + mediaInfoFactory(options, resolve, reject); + }); + } + const _DEFAULT_OPTIONS$opti = _objectSpread2(_objectSpread2(_objectSpread2({}, DEFAULT_OPTIONS), options), {}, { + format: (_options$format = options.format) !== null && _options$format !== void 0 ? _options$format : DEFAULT_OPTIONS.format + }), + { + locateFile + } = _DEFAULT_OPTIONS$opti, + mergedOptions = _objectWithoutProperties(_DEFAULT_OPTIONS$opti, _excluded); + const mediaInfoModuleFactoryOpts = { + // Silence all print in module + print: noopPrint, + printErr: noopPrint, + locateFile: locateFile !== null && locateFile !== void 0 ? locateFile : defaultLocateFile, + onAbort: err => { + if (errCallback) { + errCallback(err); + } + } + }; + + // Fetch and load WASM module + Module(mediaInfoModuleFactoryOpts).then(wasmModule => { + callback(new MediaInfo(wasmModule, mergedOptions)); + }).catch(error => { + if (errCallback) { + errCallback(error); + } + }); + } + + /** + * Checks if a given object is of a specified track type. + * + * @template T - The type of track to check for. + * @param thing - The object to check. + * @param type - The track type to check against. + * @returns A boolean indicating whether the object is of the specified track type. + */ + function isTrackType(thing, type) { + return thing !== null && typeof thing === 'object' && thing['@type'] === type; + } + + exports.default = mediaInfoFactory; + exports.isTrackType = isTrackType; + exports.mediaInfoFactory = mediaInfoFactory; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=index.js.map diff --git a/public/assets/medianinfo/index.min.js b/public/assets/medianinfo/index.min.js new file mode 100644 index 0000000..b336790 --- /dev/null +++ b/public/assets/medianinfo/index.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MediaInfo={})}(this,(function(e){"use strict";function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var n=1;n{this.analyzeData(e,t,((e,t)=>{t||!e?n(a(t)):r(e)}))}));const n=()=>{this.openBufferFinalize();const e=this.inform();"object"===this.options.format?r(this.parseResultJson(e)):r(e)};let i=0;const o=e=>{const o=e=>{u(e)?s():n()},s=()=>{let n;try{const r=Math.min(this.options.chunkSize,e-i);n=t(r,i)}catch(e){return void r("",a(e))}n instanceof Promise?n.then(o).catch((e=>{r("",a(e))})):o(n)},u=t=>{if(0===t.length||this.openBufferContinue(t,t.length))return!1;const r=this.openBufferContinueGotoGet();return-1===r?i+=t.length:(i=r,this.openBufferInit(e,r)),!0};this.openBufferInit(e,i),s()},s=e instanceof Function?e():e;s instanceof Promise?s.then(o).catch((e=>{r(null,a(e))})):o(s)}close(){"function"==typeof this.mediainfoModuleInstance.close&&this.mediainfoModuleInstance.close(),"function"==typeof this.mediainfoModule.destroy&&this.mediainfoModule.destroy(this.mediainfoModuleInstance)}inform(){return this.mediainfoModuleInstance.inform()}openBufferContinue(e,t){return!!(8&this.mediainfoModuleInstance.open_buffer_continue(e,t))}openBufferContinueGotoGet(){let e=-1;const t=this.mediainfoModuleInstance.open_buffer_continue_goto_get_lower(),r=this.mediainfoModuleInstance.open_buffer_continue_goto_get_upper();return e=-1==t&&-1==r?-1:t<0?t+s+r*s:t+r*s,e}openBufferFinalize(){this.mediainfoModuleInstance.open_buffer_finalize()}openBufferInit(e,t){this.mediainfoModuleInstance.open_buffer_init(e,t)}parseResultJson(e){const t=i,r=o,a=JSON.parse(e);if(a.media){const e=n(n({},a.media),{},{track:[]});if(Array.isArray(a.media.track))for(const i of a.media.track){let a={"@type":i["@type"]};for(const[e,o]of Object.entries(i))"@type"!==e&&(a="string"==typeof o&&t.includes(e)?n(n({},a),{},{[e]:Number.parseInt(o,10)}):"string"==typeof o&&r.includes(e)?n(n({},a),{},{[e]:Number.parseFloat(o)}):n(n({},a),{},{[e]:o}));e.track.push(a)}return n(n({},a),{},{media:e})}return a}}var c,d=(c="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,r,n=Object.assign({},e),a=new Promise(((e,n)=>{t=e,r=n})),i=Object.assign({},n),o="";"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),c&&(o=c),o=o.startsWith("blob:")?"":o.substr(0,o.replace(/[?#].*/,"").lastIndexOf("/")+1),console.log.bind(console);var s,u=console.error.bind(console);Object.assign(n,i),i=null;var l,d,f,p,m,h,y,g,v=!1;function _(){var e=s.buffer;n.HEAP8=l=new Int8Array(e),n.HEAP16=f=new Int16Array(e),n.HEAPU8=d=new Uint8Array(e),n.HEAPU16=p=new Uint16Array(e),n.HEAP32=m=new Int32Array(e),n.HEAPU32=h=new Uint32Array(e),n.HEAPF32=y=new Float32Array(e),n.HEAPF64=g=new Float64Array(e)}var b=[],$=[],C=[],w=0,P=null;function T(e){u(e="Aborted("+e+")"),v=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}var S,O=e=>e.startsWith("data:application/octet-stream;base64,");function F(){var e,t="MediaInfoModule.wasm";return O(t)?t:(e=t,n.locateFile?n.locateFile(e,o):o+e)}function A(e){throw"both async and sync fetching of the wasm failed"}function D(e,t,r){return function(e){return"function"==typeof fetch?fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()})).catch((()=>A())):Promise.resolve().then((()=>A()))}(e).then((e=>WebAssembly.instantiate(e,t))).then(r,(e=>{u(`failed to asynchronously prepare wasm: ${e}`),T(e)}))}var j,E,M,R=e=>{for(;e.length>0;)e.shift()(n)},W=e=>{for(var t="",r=e;d[r];)t+=j[d[r++]];return t},k={},I={},x={},B=e=>{throw new E(e)},U=e=>{throw new M(e)},H=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&U("Mismatched type converter count");for(var a=0;a{I.hasOwnProperty(e)?a[t]=I[e]:(i.push(e),k.hasOwnProperty(e)||(k[e]=[]),k[e].push((()=>{a[t]=I[e],++o===i.length&&n(a)})))})),0===i.length&&n(a)};function z(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||B(`type "${n}" must have a positive integer typeid pointer`),I.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;B(`Cannot register type '${n}' twice`)}if(I[e]=t,delete x[e],k.hasOwnProperty(e)){var a=k[e];delete k[e],a.forEach((e=>e()))}}(e,t,r)}var N,Y=e=>{B(e.$$.ptrType.registeredClass.name+" instance already deleted")},V=!1,G=e=>{},L=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},J=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=J(e,t,r.baseClass);return null===n?null:r.downcast(n)},Z={},q=()=>Object.keys(te).length,K=()=>{var e=[];for(var t in te)te.hasOwnProperty(t)&&e.push(te[t]);return e},X=[],Q=()=>{for(;X.length;){var e=X.pop();e.$$.deleteScheduled=!1,e.delete()}},ee=e=>{N=e,X.length&&N&&N(Q)},te={},re=(e,t)=>(t=((e,t)=>{for(void 0===t&&B("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),te[t]),ne=(e,t)=>(t.ptrType&&t.ptr||U("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&U("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ie(Object.create(e,{$$:{value:t,writable:!0}})));function ae(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=re(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?ne(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ne(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(t),s=Z[o];if(!s)return a.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=J(t,this.registeredClass,i.registeredClass);return null===u?a.call(this):this.isSmartPointer?ne(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):ne(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var ie=e=>"undefined"==typeof FinalizationRegistry?(ie=e=>e,e):(V=new FinalizationRegistry((e=>{L(e.$$)})),ie=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};V.register(e,r,e)}return e},G=e=>V.unregister(e),ie(e));function oe(){}var se=(e,t)=>Object.defineProperty(t,"name",{value:e}),ue=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||B(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}};function le(e,t,r,n,a,i,o,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var ce=(e,t,r)=>{for(;t!==r;)t.upcast||B(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function de(e,t){if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),0;t.$$||B(`Cannot pass "${ke(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ce(t.$$.ptr,r,this.registeredClass)}function fe(e,t){var r;if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||B(`Cannot pass "${ke(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&B(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=ce(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&B("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:B(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Re.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:B("Unsupporting sharing policy")}return r}function pe(e,t){if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),0;t.$$||B(`Cannot pass "${ke(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&B(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ce(t.$$.ptr,r,this.registeredClass)}function me(e){return this.fromWireType(h[e>>2])}function he(e,t,r,n,a,i,o,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,a||void 0!==t.baseClass?this.toWireType=fe:n?(this.toWireType=de,this.destructorFunction=null):(this.toWireType=pe,this.destructorFunction=null)}var ye,ge,ve=[],_e=e=>{var t=ve[e];return t||(e>=ve.length&&(ve.length=e+1),ve[e]=t=ye.get(e)),t},be=(e,t,r=[])=>e.includes("j")?((e,t,r)=>(e=e.replace(/p/g,"i"),(0,n["dynCall_"+e])(t,...r)))(e,t,r):_e(t)(...r),$e=(e,t)=>{var r,n,a=(e=W(e)).includes("j")?(r=e,n=t,(...e)=>be(r,n,e)):_e(t);return"function"!=typeof a&&B(`unknown function pointer with signature ${e}: ${t}`),a},Ce=e=>{var t=st(e),r=W(t);return lt(t),r},we=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||I[t]||(x[t]?x[t].forEach(e):(r.push(t),n[t]=!0))})),new ge(`${e}: `+r.map(Ce).join([", "]))},Pe=(e,t)=>{for(var r=[],n=0;n>2]);return r},Te=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Se(e){for(var t=1;t0?", ":"")+s),l+=(r||n?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",a)l+="runDestructors(destructors);\n";else for(u=t?1:2;uEe.length/2-5-je.length,Re={toValue:e=>(e||B("Cannot use deleted val. handle = "+e),Ee[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=je.pop()||Ee.length;return Ee[t]=e,Ee[t+1]=1,t}}}},We={name:"emscripten::val",fromWireType:e=>{var t=Re.toValue(e);return(e=>{e>9&&0==--Ee[e+1]&&(Ee[e]=void 0,je.push(e))})(e),t},toWireType:(e,t)=>Re.toHandle(t),argPackAdvance:8,readValueFromPointer:me,destructorFunction:null},ke=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ie=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(y[e>>2])};case 8:return function(e){return this.fromWireType(g[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},xe=(e,t,r)=>{switch(t){case 1:return r?e=>l[e]:e=>d[e];case 2:return r?e=>f[e>>1]:e=>p[e>>1];case 4:return r?e=>m[e>>2]:e=>h[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Be=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,o=0;o=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-a},Ue=(e,t,r)=>Be(e,d,t,r),He=e=>{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},ze="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Ne=(e,t)=>e?((e,t,r)=>{for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&ze)return ze.decode(e.subarray(t,a));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i})(d,e,t):"",Ye="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ve=(e,t)=>{for(var r=e,n=r>>1,a=n+t/2;!(n>=a)&&p[n];)++n;if((r=n<<1)-e>32&&Ye)return Ye.decode(d.subarray(e,r));for(var i="",o=0;!(o>=t/2);++o){var s=f[e+2*o>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Ge=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,a=(r-=2)<2*e.length?r/2:e.length,i=0;i>1]=o,t+=2}return f[t>>1]=0,t-n},Le=e=>2*e.length,Je=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=m[e+4*r>>2];if(0==a)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(a)}return n},Ze=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,a=n+r-4,i=0;i=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),m[t>>2]=o,(t+=4)+4>a)break}return m[t>>2]=0,t-n},qe=e=>{for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t},Ke=e=>{var t=(e-s.buffer.byteLength+65535)/65536;try{return s.grow(t),_(),1}catch(e){}},Xe={},Qe=()=>{if(!Qe.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var t in Xe)void 0===Xe[t]?delete e[t]:e[t]=Xe[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Qe.strings=r}return Qe.strings},et=e=>e%4==0&&(e%100!=0||e%400==0),tt=[31,29,31,30,31,30,31,31,30,31,30,31],rt=[31,28,31,30,31,30,31,31,30,31,30,31],nt=(e,t,r,n)=>{var a=h[n+40>>2],i={tm_sec:m[n>>2],tm_min:m[n+4>>2],tm_hour:m[n+8>>2],tm_mday:m[n+12>>2],tm_mon:m[n+16>>2],tm_year:m[n+20>>2],tm_wday:m[n+24>>2],tm_yday:m[n+28>>2],tm_isdst:m[n+32>>2],tm_gmtoff:m[n+36>>2],tm_zone:a?Ne(a):""},o=Ne(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)o=o.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function g(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function v(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=et(r.getFullYear()),a=r.getMonth(),i=(n?tt:rt)[a];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),a=g(r),i=g(n);return y(a,t)<=0?y(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var _={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>d[e.tm_mon].substring(0,3),"%B":e=>d[e.tm_mon],"%C":e=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>f(e.tm_mday,2," "),"%g":e=>v(e).toString().substring(2),"%G":v,"%H":e=>p(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":e=>p(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(et(e.tm_year+1900)?tt:rt,e.tm_mon-1),3),"%m":e=>p(e.tm_mon+1,2),"%M":e=>p(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>p(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return p(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&et(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&et(e.tm_year%400-1))&&t++}return p(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return p(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in o=o.replace(/%%/g,"\0\0"),_)o.includes(u)&&(o=o.replace(new RegExp(u,"g"),_[u](i)));o=o.replace(/\0\0/g,"%");var b,$,C,w,P,T=($=He(b=o)+1,C=new Array($),Be(b,C,0,C.length),C);return T.length>t?0:(w=T,P=e,l.set(w,P),T.length-1)};(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);j=e})(),E=n.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},M=n.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(oe.prototype,{isAliasOf(e){if(!(this instanceof oe))return!1;if(!(e instanceof oe))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||Y(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=ie(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Y(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&B("Object already scheduled for deletion"),G(this),L(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Y(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&B("Object already scheduled for deletion"),X.push(this),1===X.length&&N&&N(Q),this.$$.deleteScheduled=!0,this}}),n.getInheritedInstanceCount=q,n.getLiveInheritedInstances=K,n.flushPendingDeletes=Q,n.setDelayFunction=ee,Object.assign(he.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:me,fromWireType:ae}),ge=n.UnboundTypeError=(Fe=Error,(De=se(Ae="UnboundTypeError",(function(e){this.name=Ae,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Fe.prototype),De.prototype.constructor=De,De.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},De),Ee.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=Me;var at,it={_abort_js:()=>{T("")},_embind_register_bigint:(e,t,r,n,a)=>{},_embind_register_bool:(e,t,r,n)=>{z(e,{name:t=W(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(d[e])},destructorFunction:null})},_embind_register_class:(e,t,r,a,i,o,s,u,l,c,d,f,p)=>{d=W(d),o=$e(i,o),u&&=$e(s,u),c&&=$e(l,c),p=$e(f,p);var m=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(d);((e,t,r)=>{n.hasOwnProperty(e)?(B(`Cannot register public name '${e}' twice`),ue(n,e,e),n.hasOwnProperty(r)&&B(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),n[e].overloadTable[r]=t):n[e]=t})(m,(function(){we(`Cannot construct ${d} due to unbound types`,[a])})),H([e,t,r],a?[a]:[],(t=>{var r,i;t=t[0],i=a?(r=t.registeredClass).instancePrototype:oe.prototype;var s=se(d,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new E("Use 'new' to construct "+d);if(void 0===f.constructor_body)throw new E(d+" has no accessible constructor");var t=f.constructor_body[e.length];if(void 0===t)throw new E(`Tried to invoke ctor of ${d} with invalid number of parameters (${e.length}) - expected (${Object.keys(f.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),l=Object.create(i,{constructor:{value:s}});s.prototype=l;var f=new le(d,s,l,p,r,o,u,c);f.baseClass&&(f.baseClass.__derivedClasses??=[],f.baseClass.__derivedClasses.push(f));var h=new he(d,f,!0,!1,!1),y=new he(d+"*",f,!1,!1,!1),g=new he(d+" const*",f,!1,!0,!1);return Z[e]={pointerType:y,constPointerType:g},((e,t,r)=>{n.hasOwnProperty(e)||U("Replacing nonexistent public symbol"),void 0!==n[e].overloadTable&&void 0!==r?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)})(m,s),[h,y,g]}))},_embind_register_class_constructor:(e,t,r,n,a,i)=>{var o=Pe(t,r);a=$e(n,a),H([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new E(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{we(`Cannot construct ${e.name} due to unbound types`,o)},H([],o,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Oe(r,n,null,a,i),[]))),[]}))},_embind_register_class_function:(e,t,r,n,a,i,o,s,u)=>{var l=Pe(r,n);t=(e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e})(t=W(t)),i=$e(a,i),H([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function a(){we(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(a.argCount=r-2,a.className=e.name,c[t]=a):(ue(c,t,n),c[t].overloadTable[r-2]=a),H([],l,(a=>{var s=Oe(n,a,e,i,o,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},_embind_register_emval:e=>z(e,We),_embind_register_float:(e,t,r)=>{z(e,{name:t=W(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Ie(t,r),destructorFunction:null})},_embind_register_integer:(e,t,r,n,a)=>{t=W(t);var i=e=>e;if(0===n){var o=32-8*r;i=e=>e<>>o}var s=t.includes("unsigned");z(e,{name:t,fromWireType:i,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:xe(t,r,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function a(e){var t=h[e>>2],r=h[e+4>>2];return new n(l.buffer,r,t)}z(e,{name:r=W(r),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,t)=>{var r="std::string"===(t=W(t));z(e,{name:t,fromWireType(e){var t,n=h[e>>2],a=e+4;if(r)for(var i=a,o=0;o<=n;++o){var s=a+o;if(o==n||0==d[s]){var u=Ne(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var l=new Array(n);for(o=0;o>2]=n,r&&a)Ue(t,o,n+1);else if(a)for(var s=0;s255&&(lt(o),B("String has UTF-16 code units that do not fit in 8 bits")),d[o+s]=u}else for(s=0;s{var n,a,i,o;r=W(r),2===t?(n=Ve,a=Ge,o=Le,i=e=>p[e>>1]):4===t&&(n=Je,a=Ze,o=qe,i=e=>h[e>>2]),z(e,{name:r,fromWireType:e=>{for(var r,a=h[e>>2],o=e+4,s=0;s<=a;++s){var u=e+4+s*t;if(s==a||0==i(u)){var l=n(o,u-o);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),o=u+t}}return lt(e),r},toWireType:(e,n)=>{"string"!=typeof n&&B(`Cannot pass non-string to C++ string type ${r}`);var i=o(n),s=ut(4+i+t);return h[s>>2]=i/t,a(n,s+4,i+t),null!==e&&e.push(lt,s),s},argPackAdvance:8,readValueFromPointer:me,destructorFunction(e){lt(e)}})},_embind_register_void:(e,t)=>{z(e,{isVoid:!0,name:t=W(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},_emscripten_memcpy_js:(e,t,r)=>d.copyWithin(e,t,t+r),_gmtime_js:function(e,t,r){var n,a,i=(a=t)+2097152>>>0<4194305-!!(n=e)?(n>>>0)+4294967296*a:NaN,o=new Date(1e3*i);m[r>>2]=o.getUTCSeconds(),m[r+4>>2]=o.getUTCMinutes(),m[r+8>>2]=o.getUTCHours(),m[r+12>>2]=o.getUTCDate(),m[r+16>>2]=o.getUTCMonth(),m[r+20>>2]=o.getUTCFullYear()-1900,m[r+24>>2]=o.getUTCDay();var s=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),u=(o.getTime()-s)/864e5|0;m[r+28>>2]=u},_tzset_js:(e,t,r,n)=>{var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1),s=i.getTimezoneOffset(),u=o.getTimezoneOffset(),l=Math.max(s,u);h[e>>2]=60*l,m[t>>2]=Number(s!=u);var c=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],d=c(i),f=c(o);uDate.now(),emscripten_resize_heap:e=>{var t=d.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,a,i=1;i<=4;i*=2){var o=t*(1+.2/i);o=Math.min(o,e+100663296);var s=Math.min(r,(n=Math.max(e,o))+((a=65536)-n%a)%a);if(Ke(s))return!0}return!1},environ_get:(e,t)=>{var r=0;return Qe().forEach(((n,a)=>{var i=t+r;h[e+4*a>>2]=i,((e,t)=>{for(var r=0;r{var r=Qe();h[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),h[t>>2]=n,0},strftime_l:(e,t,r,n,a)=>nt(e,t,r,n)},ot=function(){var e,t,n,a={env:it,wasi_snapshot_preview1:it};function i(e,t){var r;return ot=e.exports,s=ot.memory,_(),ye=ot.__indirect_function_table,r=ot.__wasm_call_ctors,$.unshift(r),function(){if(0==--w&&P){var e=P;P=null,e()}}(),ot}return w++,S||(S=F()),(e=S,t=a,n=function(e){i(e.instance)},"function"!=typeof WebAssembly.instantiateStreaming||O(e)||"function"!=typeof fetch?D(e,t,n):fetch(e,{credentials:"same-origin"}).then((r=>WebAssembly.instantiateStreaming(r,t).then(n,(function(r){return u(`wasm streaming compile failed: ${r}`),u("falling back to ArrayBuffer instantiation"),D(e,t,n)}))))).catch(r),{}}(),st=e=>(st=ot.__getTypeName)(e),ut=e=>(ut=ot.malloc)(e),lt=e=>(lt=ot.free)(e);function ct(){w>0||(R(b),w>0||at||(at=!0,n.calledRun=!0,v||(R($),t(n),R(C))))}return n.dynCall_iiijj=(e,t,r,a,i,o,s)=>(n.dynCall_iiijj=ot.dynCall_iiijj)(e,t,r,a,i,o,s),n.dynCall_viijii=(e,t,r,a,i,o,s)=>(n.dynCall_viijii=ot.dynCall_viijii)(e,t,r,a,i,o,s),n.dynCall_iiiiij=(e,t,r,a,i,o,s)=>(n.dynCall_iiiiij=ot.dynCall_iiiiij)(e,t,r,a,i,o,s),n.dynCall_iiiiijj=(e,t,r,a,i,o,s,u,l)=>(n.dynCall_iiiiijj=ot.dynCall_iiiiijj)(e,t,r,a,i,o,s,u,l),n.dynCall_iiiiiijj=(e,t,r,a,i,o,s,u,l,c)=>(n.dynCall_iiiiiijj=ot.dynCall_iiiiiijj)(e,t,r,a,i,o,s,u,l,c),P=function e(){at||ct(),at||(P=e)},ct(),a});const f=["locateFile"],p=()=>{};function m(e,t){try{if("/"===new URL(t).pathname)return"".concat(t,"mediainfo.js/dist/").concat(e)}catch(e){}return"".concat(t,"../").concat(e)}function h(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;if(void 0===r)return new Promise(((e,r)=>{h(t,e,r)}));const i=n(n(n({},u),t),{},{format:null!==(e=t.format)&&void 0!==e?e:u.format}),{locateFile:o}=i,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{a&&a(e)}}).then((e=>{r(new l(e,s))})).catch((e=>{a&&a(e)}))}e.default=h,e.isTrackType=function(e,t){return null!==e&&"object"==typeof e&&e["@type"]===t},e.mediaInfoFactory=h,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=index.min.js.map diff --git a/public/assets/scripts/Stats.js b/public/assets/scripts/Stats.js new file mode 100644 index 0000000..41d8ce1 --- /dev/null +++ b/public/assets/scripts/Stats.js @@ -0,0 +1,172 @@ +/** + * @author mrdoob / http://mrdoob.com/ + */ + +var Stats = function () { + + var mode = 0; + + var container = document.createElement( 'div' ); + container.style.cssText = 'cursor:pointer;opacity:0.9'; + container.addEventListener( 'click', function ( event ) { + + event.preventDefault(); + showPanel( ++ mode % container.children.length ); + + }, false ); + + // + + function addPanel( panel ) { + + container.appendChild( panel.dom ); + return panel; + + } + + function showPanel( id ) { + + for ( var i = 0; i < container.children.length; i ++ ) { + + container.children[ i ].style.display = i === id ? 'block' : 'none'; + + } + + mode = id; + + } + + // + + var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0; + + var fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) ); + var msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) ); + + if ( self.performance && self.performance.memory ) { + + var memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) ); + + } + + showPanel( 0 ); + + return { + + REVISION: 16, + + domElement: container, + + addPanel: addPanel, + showPanel: showPanel, + + setMode: showPanel, // backwards compatibility + + begin: function () { + + beginTime = ( performance || Date ).now(); + + }, + + end: function () { + + frames ++; + + var time = ( performance || Date ).now(); + + msPanel.update( time - beginTime, 200 ); + + if ( time > prevTime + 1000 ) { + + fpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 ); + + prevTime = time; + frames = 0; + + if ( memPanel ) { + + var memory = performance.memory; + memPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 ); + + } + + } + + return time; + + }, + + update: function () { + + beginTime = this.end(); + + } + + }; + +}; + +Stats.Panel = function ( name, fg, bg ) { + + var min = Infinity, max = 0, round = Math.round; + var PR = round( window.devicePixelRatio || 1 ); + + var WIDTH = 80 * PR, HEIGHT = 48 * PR, + TEXT_X = 3 * PR, TEXT_Y = 2 * PR, + GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR, + GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR; + + var canvas = document.createElement( 'canvas' ); + canvas.width = WIDTH; + canvas.height = HEIGHT; + canvas.style.cssText = 'width:80px;height:48px'; + + var context = canvas.getContext( '2d' ); + context.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif'; + context.textBaseline = 'top'; + + context.fillStyle = bg; + context.fillRect( 0, 0, WIDTH, HEIGHT ); + + context.fillStyle = fg; + context.fillText( name, TEXT_X, TEXT_Y ); + context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT ); + + context.fillStyle = bg; + context.globalAlpha = 0.9; + context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT ); + + return { + + dom: canvas, + + update: function ( value, maxValue ) { + + min = Math.min( min, value ); + max = Math.max( max, value ); + + context.fillStyle = bg; + context.globalAlpha = 1; + context.fillRect( 0, 0, WIDTH, GRAPH_Y ); + context.fillStyle = fg; + context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y ); + + context.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT ); + + context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT ); + + context.fillStyle = bg; + context.globalAlpha = 0.9; + context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) ); + + } + + }; + +}; + +if ( typeof module === 'object' ) { + + module.exports = Stats; + +} diff --git a/public/assets/scripts/lame.min.js b/public/assets/scripts/lame.min.js new file mode 100644 index 0000000..8dc6b07 --- /dev/null +++ b/public/assets/scripts/lame.min.js @@ -0,0 +1,307 @@ +function lamejs(){function X(c){return new Int32Array(c)}function K(c){return new Float32Array(c)}function ca(c){if(1==c.length)return K(c[0]);var k=c[0];c=c.slice(1);for(var n=[],u=0;uf.sampleWindow-f.totsamp?f.sampleWindow-f.totsamp:d;if(lMAX_ORDER-l&&(g=MAX_ORDER-l)}else e=v+l,q=b,D=m+l,p=a;c(q,e,f.lstepbuf,f.lstep+f.totsamp,g,B[f.reqindex]);c(p,D,f.rstepbuf,f.rstep+f.totsamp,g,B[f.reqindex]);k(f.lstepbuf,f.lstep+f.totsamp,f.loutbuf,f.lout+f.totsamp,g,w[f.reqindex]);k(f.rstepbuf,f.rstep+f.totsamp,f.routbuf,f.rout+f.totsamp,g,w[f.reqindex]);e=f.lout+f.totsamp;q=f.loutbuf; +D=f.rout+f.totsamp;p=f.routbuf;for(var r=g%8;0!=r--;)f.lsum+=n(q[e++]),f.rsum+=n(p[D++]);for(r=g/8;0!=r--;)f.lsum+=n(q[e+0])+n(q[e+1])+n(q[e+2])+n(q[e+3])+n(q[e+4])+n(q[e+5])+n(q[e+6])+n(q[e+7]),e+=8,f.rsum+=n(p[D+0])+n(p[D+1])+n(p[D+2])+n(p[D+3])+n(p[D+4])+n(p[D+5])+n(p[D+6])+n(p[D+7]),D+=8;d-=g;l+=g;f.totsamp+=g;f.totsamp==f.sampleWindow&&(e=10*Y.STEPS_per_dB*Math.log10((f.lsum+f.rsum)/f.totsamp*.5+1E-37),e=0>=e?0:0|e,e>=f.A.length&&(e=f.A.length-1),f.A[e]++,f.lsum=f.rsum=0,T.arraycopy(f.loutbuf, +f.totsamp,f.loutbuf,0,MAX_ORDER),T.arraycopy(f.routbuf,f.totsamp,f.routbuf,0,MAX_ORDER),T.arraycopy(f.lstepbuf,f.totsamp,f.lstepbuf,0,MAX_ORDER),T.arraycopy(f.rstepbuf,f.totsamp,f.rstepbuf,0,MAX_ORDER),f.totsamp=0);if(f.totsamp>f.sampleWindow)return GAIN_ANALYSIS_ERROR}u=(m-=b[a])););b=64.82-a/Y.STEPS_per_dB}for(c=0;cf&&(f=0);9k&&(k+=64);b.exp_nspsytune|=k<<2}0!=a?b.quant_comp=f[m].quant_comp:0=c)return V(b,c,a);b.preset=0;return c}}function qb(){function u(a){this.bits=0|a}function k(a,d,p,b,e,c){d=.5946/d;for(a>>=1;0!=a--;)e[c++]=d>p[b++]? +0:1,e[c++]=d>p[b++]?0:1}function n(a,d,b,e,c,l){a>>=1;var h=a%2;for(a>>=1;0!=a--;){var p=b[e++]*d;var r=b[e++]*d;var t=0|p;var f=b[e++]*d;var g=0|r;var J=b[e++]*d;var D=0|f;p+=B.adj43[t];t=0|J;r+=B.adj43[g];c[l++]=0|p;f+=B.adj43[D];c[l++]=0|r;J+=B.adj43[t];c[l++]=0|f;c[l++]=0|J}0!=h&&(p=b[e++]*d,r=b[e++]*d,p+=B.adj43[0|p],r+=B.adj43[0|r],c[l++]=0|p,c[l++]=0|r)}function V(a,d,b,e){var p,c=d,h=p=0;do{var r=a[c++],l=a[c++];p>=16;p>a&&(p=a,d++);e.bits+=p;return d;case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:c=d;d=f[p-1];r=h=p=0;l=w.ht[d].xlen;var g=w.ht[d].hlen,D=w.ht[d+1].hlen,q=w.ht[d+2].hlen;do{var m=a[c+0]*l+a[c+1];c+=2;p+=g[m];h+=D[m];r+=q[m]}while(ch&&(p=h,a++);p>r&&(p=r,a=d+2);e.bits+=p;return a;default:if(p>ia.IXMAX_VAL)return e.bits=ia.LARGE_BITS,-1;p-=15;for(c=24;32>c&&!(w.ht[c].linmax>=p);c++);for(h=c-8;24>h&&!(w.ht[h].linmax>=p);h++);p=h;r=65536*w.ht[p].xlen+w.ht[c].xlen;h=0;do l=a[d++],g=a[d++],0!=l&&(14>=16;h>a&&(h=a,p=c);e.bits+=h;return p}}function E(a,d,p,b,e,l,h,g){for(var r=d.big_values,f=2;f=r)break;var t=e[f-2]+d.count1bits;if(p.part2_3_length<=t)break;t=new u(t);x=V(b,x,r,t);t=t.bits;p.part2_3_length<=t||(p.assign(d),p.part2_3_length=t,p.region0_count=l[f-2],p.region1_count=f-2-l[f-2],p.table_select[0]=h[f-2],p.table_select[1]=g[f-2],p.table_select[2]=x)}}var B=null;this.qupvt=null;this.setModules=function(a){B=this.qupvt=a};var ha=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]],f=[1,2, +5,7,7,10,10,13,13,13,13,13,13,13,13];this.noquant_count_bits=function(a,d,p){var b=d.l3_enc,e=Math.min(576,d.max_nonzero_coeff+2>>1<<1);null!=p&&(p.sfb_count1=0);for(;1h&&(f=h,d.count1table_select=1);d.count1bits=f;d.big_values=e;if(0==e)return f;d.block_type==c.SHORT_TYPE?(l=3*a.scalefac_band.s[3], +l>d.big_values&&(l=d.big_values),h=d.big_values):d.block_type==c.NORM_TYPE?(l=d.region0_count=a.bv_scf[e-2],h=d.region1_count=a.bv_scf[e-1],h=a.scalefac_band.l[l+h+2],l=a.scalefac_band.l[l+1],hh&&(l=h));l=Math.min(l,e);h=Math.min(h,e);0l)return ia.LARGE_BITS;l=B.IPOW20(e.global_gain);var h,f=0,g=0,r=0,D=0,m=0,q=p,v=0,C=d,I=0;var Q=null!=b&&e.global_gain==b.global_gain;var S=e.block_type==c.SHORT_TYPE?38:21;for(h=0;h<=S;h++){var u=-1;if(Q||e.block_type==c.NORM_TYPE)u= +e.global_gain-(e.scalefac[h]+(0!=e.preflag?B.pretab[h]:0)<e.max_nonzero_coeff&&(h=e.max_nonzero_coeff-f+1,na.fill(p,e.max_nonzero_coeff,576,0),Z=h,0>Z&&(Z=0),h=S+1);0==g&&0==r&&(q=p,v=m,C=d,I=D);null!=b&&0=b.sfb_count1&&0=b.step[h]?(0!=g&&(n(g,l,C,I,q,v),g=0,q=p,v=m,C=d,I=D),r+=Z):(0!=r&&(k(r,l,C,I,q,v),r=0,q= +p,v=m,C=d,I=D),g+=Z);if(0>=Z){0!=r&&(k(r,l,C,I,q,v),r=0);0!=g&&(n(g,l,C,I,q,v),g=0);break}}h<=S&&(m+=e.width[h],D+=e.width[h],f+=e.width[h])}0!=g&&n(g,l,C,I,q,v);0!=r&&k(r,l,C,I,q,v);if(0!=(a.substep_shaping&2))for(l=0,S=.634521682242439/B.IPOW20(e.global_gain+e.scalefac_scale),f=0;f=S?p[g]:0;return this.noquant_count_bits(a,e,b)};this.best_huffman_divide=function(a,d){var e=new rb,b=d.l3_enc,l=X(23),f=X(23), +h=X(23),g=X(23);if(d.block_type!=c.SHORT_TYPE||1!=a.mode_gr){e.assign(d);if(d.block_type==c.NORM_TYPE){for(var y=d.big_values,m=0;22>=m;m++)l[m]=ia.LARGE_BITS;for(m=0;16>m;m++){var D=a.scalefac_band.l[m+1];if(D>=y)break;var q=0,k=new u(q),v=V(b,0,D,k);q=k.bits;for(var C=0;8>C;C++){var I=a.scalefac_band.l[m+C+2];if(I>=y)break;k=q;k=new u(k);I=V(b,D,I,k);k=k.bits;l[m+C]>k&&(l[m+C]=k,f[m+C]=m,h[m+C]=v,g[m+C]=I)}}E(a,e,d,b,l,f,h,g)}y=e.big_values;if(!(0==y||1<(b[y-2]|b[y-1])||(y=d.count1+2,576e.big_values;y-=4)q=2*(2*(2*b[y-4]+b[y-3])+b[y-2])+b[y-1],m+=w.t32l[q],D+=w.t33l[q];e.big_values=y;e.count1table_select=0;m>D&&(m=D,e.count1table_select=1);e.count1bits=m;e.block_type==c.NORM_TYPE?E(a,e,d,b,l,f,h,g):(e.part2_3_length=m,m=a.scalefac_band.l[8],m>y&&(m=y),0m&&(a=new u(e.part2_3_length),e.table_select[1]=V(b,m,y,a),e.part2_3_length=a.bits),d.part2_3_length>e.part2_3_length&&d.assign(e))}}}; +var b=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],v=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],a=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],m=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];qb.slen1_tab=a;qb.slen2_tab=m;this.best_scalefac_store=function(d,e,p,l){var f=l.tt[e][p],g,h,r=0;for(g=h=0;gy&&0==f.l3_enc[y+h];y++);0==y&&(f.scalefac[g]=r=-2)}if(0==f.scalefac_scale&&0==f.preflag){for(g=h=0;g>=1);f.scalefac_scale=r=1}}if(0==f.preflag&&f.block_type!=c.SHORT_TYPE&&2==d.mode_gr){for(g=11;gg;g++)l.scfsi[p][g]=0;if(2==d.mode_gr&&1==e&&l.tt[0][p].block_type!=c.SHORT_TYPE&&l.tt[1][p].block_type!=c.SHORT_TYPE){e=l.tt[1][p];h=l.tt[0][p];for(r=0;rg;g++)-1!=e.scalefac[g]&&(l++,pr;r++)pg&&(e.part2_length=g,e.scalefac_compress=r));r=0}for(g=0;gd;d++)gm[d]&&(a.part2_length=m[d],a.scalefac_compress=d);return a.part2_length==ia.LARGE_BITS};var d=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(a,e){var b,f,l,m,h=X(4),x=e.scalefac;a=0!=e.preflag?2:0;for(l=0;4>l;l++)h[l]=0;if(e.block_type==c.SHORT_TYPE){var y=1;var k=B.nr_of_sfb_block[a][y]; +for(b=m=0;4>b;b++){var q=k[b]/3;for(l=0;lf;f++)x[3*m+f]>h[b]&&(h[b]=x[3*m+f])}}else for(y=0,k=B.nr_of_sfb_block[a][y],b=m=0;4>b;b++)for(q=k[b],l=0;lh[b]&&(h[b]=x[m]);q=!1;for(b=0;4>b;b++)h[b]>d[a][b]&&(q=!0);if(!q){e.sfb_partition_table=B.nr_of_sfb_block[a][y];for(b=0;4>b;b++)e.slen[b]=g[h[b]];y=e.slen[0];b=e.slen[1];h=e.slen[2];f=e.slen[3];switch(a){case 0:e.scalefac_compress=(5*y+b<<4)+(h<<2)+f;break;case 1:e.scalefac_compress=400+(5*y+b<<2)+h;break;case 2:e.scalefac_compress= +500+3*y+b;break;default:T.err.printf("intensity stereo not implemented yet\n")}}if(!q)for(b=e.part2_length=0;4>b;b++)e.part2_length+=e.slen[b]*e.sfb_partition_table[b];return q};var g=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(a){for(var d=2;576>=d;d+=2){for(var e=0,b;a.scalefac_band.l[++e]d;)b--;0>b&&(b=ha[e][0]);a.bv_scf[d-2]=b;for(b=ha[e][1];a.scalefac_band.l[b+a.bv_scf[d-2]+2]>d;)b--;0>b&&(b=ha[e][1]);a.bv_scf[d-1]=b}}}function xc(){var c; +this.setModules=function(k){c=k};this.ResvFrameBegin=function(k,n){var u=k.internal_flags,E=u.l3_side,B=c.getframebits(k);n.bits=(B-8*u.sideinfo_len)/u.mode_gr;var w=2048*u.mode_gr-8;if(320w&&(u.ResvMax=w);if(0>u.ResvMax||k.disable_reservoir)u.ResvMax=0;k=n.bits*u.mode_gr+Math.min(u.ResvSize,u.ResvMax);k>f&&(k=f);E.resvDrain_pre=0;null!=u.pinfo&& +(u.pinfo.mean_bits=n.bits/2,u.pinfo.resvsize=u.ResvSize);return k};this.ResvMaxBits=function(c,n,u,E){var k=c.internal_flags,w=k.ResvSize,f=k.ResvMax;0!=E&&(w+=n);0!=(k.substep_shaping&1)&&(f*=.9);u.bits=n;10*w>9*f?(E=w-9*f/10,u.bits+=E,k.substep_shaping|=128):(E=0,k.substep_shaping&=127,c.disable_reservoir||0!=(k.substep_shaping&1)||(u.bits-=.1*n));c=w<6*k.ResvMax/10?w:6*k.ResvMax/10;c-=E;0>c&&(c=0);return c};this.ResvAdjust=function(c,n){c.ResvSize-=n.part2_3_length+n.part2_length};this.ResvFrameEnd= +function(c,n){var k,u=c.l3_side;c.ResvSize+=n*c.mode_gr;n=0;u.resvDrain_post=0;u.resvDrain_pre=0;0!=(k=c.ResvSize%8)&&(n+=k);k=c.ResvSize-n-c.ResvMax;0>b<> +3]|=d>>e<<8-(b&7)-h;b+=h}a.header[a.h_ptr].ptr=b}function V(a,d){a<<=8;for(var e=0;8>e;e++)a<<=1,d<<=1,0!=((d^a)&65536)&&(d^=32773);return d}function E(a,d){var e=w.ht[d.count1table_select+32],b,h=0,c=d.big_values,g=d.big_values;for(b=(d.count1-d.big_values)/4;0d.xr[g+0]&&l++);p=d.l3_enc[c+1];0!=p&&(f+=4,l*=2,0>d.xr[g+1]&&l++);p=d.l3_enc[c+2];0!=p&&(f+=2,l*=2,0>d.xr[g+2]&&l++);p=d.l3_enc[c+3];0!=p&&(f++,l*=2,0>d.xr[g+3]&&l++);c+=4;g+=4;u(a,l+e.table[f], +e.hlen[f]);h+=e.hlen[f]}return h}function B(a,d,e,b,h){var c=w.ht[d],g=0;if(0==d)return g;for(;eh.xr[e]&&m++,l--);15h.xr[e+1]&&m++,l--);C=C*r+k;f-=l;l+=c.hlen[C];u(a,c.table[C],l);u(a,m,f);g+=l+f}return g}function K(a,d){var e=3*a.scalefac_band.s[3];e>d.big_values&&(e=d.big_values);var b=B(a,d.table_select[0],0,e,d);return b+=B(a, +d.table_select[1],e,d.big_values,d)}function f(a,d){var e=d.big_values;var b=d.region0_count+1;var h=a.scalefac_band.l[b];b+=d.region1_count+1;var c=a.scalefac_band.l[b];h>e&&(h=e);c>e&&(c=e);b=B(a,d.table_select[0],0,h,d);b+=B(a,d.table_select[1],h,c,d);return b+=B(a,d.table_select[2],c,e,d)}function b(){this.total=0}function v(d,e){var b=d.internal_flags;var c=b.w_ptr;var h=b.h_ptr-1;-1==h&&(h=da.MAX_HEADER_BUF-1);var l=b.header[h].write_timing-g;e.total=l;if(0<=l){var f=1+h-c;hl&&T.err.println("strange error flushing buffer ... \n");return l}var a=this,m=null,z=null,e=null,l=null;this.setModules=function(a,d,b,c){m=a;z=d;e=b;l=c};var d=null,g=0,q=0,D=0;this.getframebits=function(a){var d=a.internal_flags;return 8*(0|72E3*(a.version+1)*(0!=d.bitrate_index?w.bitrate_table[a.version][d.bitrate_index]:a.brate)/a.out_samplerate+d.padding)};this.CRC_writeheader= +function(a,d){var e=V(d[2]&255,65535);e=V(d[3]&255,e);for(var b=6;b>8);d[5]=byte(e&255)};this.flush_bitstream=function(a){var d=a.internal_flags,e;var c=d.l3_side;0>(e=v(a,new b))||(k(a,e),d.ResvSize=0,c.main_data_begin=0,d.findReplayGain&&(c=m.GetTitleGain(d.rgdata),d.RadioGain=Math.floor(10*c+.5)|0),d.findPeakSample&&(d.noclipGainChange=Math.ceil(200*Math.log10(d.PeakSample/32767))|0,0>h<a.out_samplerate?n(h,4094,12):n(h,4095,12);n(h,a.version,1);n(h,1,2);n(h,a.error_protection?0:1,1);n(h,h.bitrate_index,4);n(h,h.samplerate_index,2);n(h,h.padding,1);n(h,a.extension,1);n(h,a.mode.ordinal(),2);n(h,h.mode_ext,2);n(h,a.copyright,1);n(h,a.original,1);n(h,a.emphasis,2);a.error_protection&&n(h,0,16);if(1==a.version){n(h,m.main_data_begin,9);2==h.channels_out?n(h,m.private_bits,3):n(h,m.private_bits,5);for(y=0;yp;p++)n(h,m.scfsi[y][p], +1);for(p=0;2>p;p++)for(y=0;ym;m++)for(y=0;yQ;Q++){var w=C.sfb_partition_table[Q]/3,Z=C.slen[Q];for(I=0;IQ;Q++)for(w=C.sfb_partition_table[Q],Z=C.slen[Q],I=0;I ResvSize");8*e.main_data_begin!=d.ResvSize&&(T.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n", +8*e.main_data_begin,d.ResvSize,e.resvDrain_post,e.resvDrain_pre,8*d.sideinfo_len,h-e.resvDrain_post-8*d.sideinfo_len,h,h%8,l),T.err.println("This is a fatal error. It has several possible causes:"),T.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),T.err.println(" 9%% Your system is overclocked"),T.err.println(" 1%% bug in LAME encoding library"),d.ResvSize=8*e.main_data_begin);if(1E9=g)return 0;if(0!=c&&g>c)return-1;T.arraycopy(d,0,e,b,g);q=-1;D=0;if(0!=h&&(c=X(1),c[0]=a.nMusicCRC,l.updateMusicCRC(c,e,b,g),a.nMusicCRC=c[0],0a.PeakSample?a.PeakSample=c[0][p]:-c[0][p]>a.PeakSample&&(a.PeakSample=-c[0][p]);if(1< +a.channels_out)for(p=0;pa.PeakSample?a.PeakSample=c[1][p]:-c[1][p]>a.PeakSample&&(a.PeakSample=-c[1][p])}if(a.findReplayGain&&m.AnalyzeSamples(a.rgdata,c[0],0,c[1],0,f,a.channels_out)==Y.GAIN_ANALYSIS_ERROR)return-6}}return g};this.init_bit_stream_w=function(a){d=new Int8Array(W.LAME_MAXMP3BUFFER);a.h_ptr=a.w_ptr=0;a.header[a.h_ptr].write_timing=0;q=-1;g=D=0}}function zb(){function c(a,b){var d=a[b+0]&255;d=d<<8|a[b+1]&255;d=d<<8|a[b+2]&255;return d=d<<8|a[b+3]&255}function k(a,b,d){a[b+ +0]=d>>24&255;a[b+1]=d>>16&255;a[b+2]=d>>8&255;a[b+3]=d&255}function n(a,b,d){a[b+0]=d>>8&255;a[b+1]=d&255}function V(a,b,d){return 255&(a<a.out_samplerate?0:1);b[1]=V(b[1],1,a.version);b[1]=V(b[1],2,1);b[1]=V(b[1],1,a.error_protection?0:1);b[2]=V(b[2],4,d.bitrate_index);b[2]=V(b[2],2,d.samplerate_index);b[2]=V(b[2],1,0);b[2]=V(b[2],1,a.extension);b[3]=V(b[3],2,a.mode.ordinal());b[3]=V(b[3], +2,d.mode_ext);b[3]=V(b[3],1,a.copyright);b[3]=V(b[3],1,a.original);b[3]=V(b[3],2,a.emphasis);b[0]=255;d=b[1]&241;var e=1==a.version?128:16E3>a.out_samplerate?32:64;a.VBR==G.vbr_off&&(e=a.brate);e=a.free_format?0:255&16*K.BitrateIndex(e,a.version,a.out_samplerate);b[1]=1==a.version?255&(d|10):255&(d|2);d=b[2]&13;b[2]=255&(e|d)}function B(a,b){return b=b>>8^z[(b^a)&255]}var K,f,b;this.setModules=function(a,c,d){K=a;f=c;b=d};var v=zb.NUMTOCENTRIES,a=zb.MAXFRAMESIZE,m=v+4+4+4+4+4+9+1+1+8+1+1+3+1+1+2+ +4+2+2,z=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8E3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16E3,65089,64001, +15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32E3,48577, +48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.addVbrFrame= +function(a){var b=a.internal_flags;var d=b.VBR_seek_table;a=w.bitrate_table[a.version][b.bitrate_index];d.nVbrNumFrames++;d.sum+=a;d.seen++;if(!(d.seen>3&1,f=a[d+2]>>2&3,m=a[d+3]>>6&3,p=a[d+2]>>4&15;p=w.bitrate_table[e][p];b.samprate=14==a[d+1]>>4?w.samplerate_table[2][f]:w.samplerate_table[e][f]; +f=d=0!=e?3!=m?d+36:d+21:3!=m?d+21:d+13;if(!(new String(a,f,4(),null)).equals("Xing")&&!(new String(a,f,4(),null)).equals("Info"))return null;d+=4;b.hId=e;f=b.flags=c(a,d);d+=4;0!=(f&1)&&(b.frames=c(a,d),d+=4);0!=(f&2)&&(b.bytes=c(a,d),d+=4);if(0!=(f&4)){if(null!=b.toc)for(m=0;m>4;p=(a[d+1]&15)<<8;p+=a[d+2]&255;if(0>e||3E3p||3E3b.out_samplerate?32:64;b.VBR==G.vbr_off&&(d=b.brate);d=72E3*(b.version+1)*d/b.out_samplerate;var c=e.sideinfo_len+m;e.VBR_seek_table.TotalFrameSize=d;if(da)b.bWriteVbrTag=!1;else for(e.VBR_seek_table.nVbrNumFrames=0,e.VBR_seek_table.nBytesWritten=0,e.VBR_seek_table.sum=0,e.VBR_seek_table.seen=0,e.VBR_seek_table.want=1,e.VBR_seek_table.pos=0,null==e.VBR_seek_table.bag&&(e.VBR_seek_table.bag= +new int[400],e.VBR_seek_table.size=400),d=new Int8Array(a),E(b,d),e=e.VBR_seek_table.TotalFrameSize,c=0;c=d.VBR_seek_table.pos)return 0;if(c.length=m.pos))for(l=1;lm.pos-1&&(p=m.pos-1);p=0|256*m.bag[p]/m.sum;255t.RadioGain&&(t.RadioGain=-510),w=11264,w=0<=t.RadioGain?w|t.RadioGain:w|512|-t.RadioGain);t.findPeakSample&&(z=Math.abs(0|t.PeakSample/32767*Math.pow(2,23)+.5));-1!=ma&&(0h&&(h=0);switch(a.mode){case MONO:Q=0;break;case STEREO:Q=1;break; +case DUAL_CHANNEL:Q=2;break;case JOINT_STEREO:Q=a.force_ms?4:3;break;default:Q=7}C=32E3>=a.in_samplerate?0:48E3==a.in_samplerate?2:48E3a.scale_right||a.disable_reservoir&&320>a.brate||a.noATH||a.ATHonly||0==L||32E3>=a.in_samplerate)F=1;O=O+(Q<<2)+(F<<5)+(C<<6);t=t.nMusicCRC;k(c,e+p,h);p+=4;for(h=0;9>h;h++)c[e+p+h]= +255&x.charAt(h);p+=9;c[e+p]=255&y;p++;c[e+p]=255&A;p++;k(c,e+p,z);p+=4;n(c,e+p,w);p+=2;n(c,e+p,0);p+=2;c[e+p]=255&I;p++;c[e+p]=255<=V?255:255&V;p++;c[e+p]=255&r>>4;c[e+p+1]=255&(r<<4)+(u>>8);c[e+p+2]=255&u;p+=3;c[e+p]=255&O;p++;c[e+p++]=0;n(c,e+p,a.preset);p+=2;k(c,e+p,m);p+=4;n(c,e+p,t);p+=2;for(a=0;a=b.internal_flags.VBR_seek_table.pos)return-1;c.seek(c.length());if(0==c.length())return-1;c.seek(0); +var d=new Int8Array(10);c.readFully(d);d=(new String(d,"ISO-8859-1")).startsWith("ID3")?0:((d[6]&127)<<21|(d[7]&127)<<14|(d[8]&127)<<7|d[9]&127)+d.length;c.seek(d);d=new Int8Array(a);b=getLameTagFrame(b,d);if(b>d.length)return-1;if(1>b)return 0;c.write(d,0,b);return 0}}function U(c,k,n,w){this.xlen=c;this.linmax=k;this.table=n;this.hlen=w}function xa(c){this.bits=c}function yc(){this.setModules=function(c,k){}}function sb(){this.bits=this.over_SSD=this.over_count=this.max_noise=this.tot_noise=this.over_noise= +0}function zc(){this.scale_right=this.scale_left=this.scale=this.out_samplerate=this.in_samplerate=this.num_channels=this.num_samples=this.class_id=0;this.decode_only=this.bWriteVbrTag=this.analysis=!1;this.quality=0;this.mode=la.STEREO;this.write_id3tag_automatic=this.decode_on_the_fly=this.findReplayGain=this.free_format=this.force_ms=!1;this.error_protection=this.emphasis=this.extension=this.original=this.copyright=this.compression_ratio=this.brate=0;this.disable_reservoir=this.strict_ISO=!1;this.quant_comp_short= +this.quant_comp=0;this.experimentalY=!1;this.preset=this.exp_nspsytune=this.experimentalZ=0;this.VBR=null;this.maskingadjust_short=this.maskingadjust=this.highpasswidth=this.lowpasswidth=this.highpassfreq=this.lowpassfreq=this.VBR_hard_min=this.VBR_max_bitrate_kbps=this.VBR_min_bitrate_kbps=this.VBR_mean_bitrate_kbps=this.VBR_q=this.VBR_q_frac=0;this.noATH=this.ATHshort=this.ATHonly=!1;this.athaa_sensitivity=this.athaa_loudapprox=this.athaa_type=this.ATHlower=this.ATHcurve=this.ATHtype=0;this.short_blocks= +null;this.useTemporal=!1;this.msfix=this.interChRatio=0;this.tune=!1;this.lame_allocated_gfp=this.frameNum=this.framesize=this.encoder_padding=this.encoder_delay=this.version=this.tune_value_a=0;this.internal_flags=null}function Ac(){this.linprebuf=K(2*Y.MAX_ORDER);this.linpre=0;this.lstepbuf=K(Y.MAX_SAMPLES_PER_WINDOW+Y.MAX_ORDER);this.lstep=0;this.loutbuf=K(Y.MAX_SAMPLES_PER_WINDOW+Y.MAX_ORDER);this.lout=0;this.rinprebuf=K(2*Y.MAX_ORDER);this.rinpre=0;this.rstepbuf=K(Y.MAX_SAMPLES_PER_WINDOW+Y.MAX_ORDER); +this.rstep=0;this.routbuf=K(Y.MAX_SAMPLES_PER_WINDOW+Y.MAX_ORDER);this.first=this.freqindex=this.rsum=this.lsum=this.totsamp=this.sampleWindow=this.rout=0;this.A=X(0|Y.STEPS_per_dB*Y.MAX_dB);this.B=X(0|Y.STEPS_per_dB*Y.MAX_dB)}function Bc(u){this.quantize=u;this.iteration_loop=function(k,n,u,w){var B=k.internal_flags,E=K(sa.SFBMAX),f=K(576),b=X(2),v=B.l3_side;var a=new xa(0);this.quantize.rv.ResvFrameBegin(k,a);a=a.bits;for(var m=0;m>2&63;32<=d&&(d-=64);g=Math.pow(10,d/4/10);d=b.exp_nspsytune>>8&63;32<=d&&(d-=64);q=Math.pow(10,d/4/10);d=b.exp_nspsytune>>14&63;32<=d&&(d-=64);k= +Math.pow(10,d/4/10);d=b.exp_nspsytune>>20&63;32<=d&&(d-=64);b=k*Math.pow(10,d/4/10);for(d=0;d=d?g:13>=d?q:20>=d?k:b,e.nsPsy.longfact[d]=p;for(d=0;d=d?g:10>=d?q:11>=d?k:b,e.nsPsy.shortfact[d]=p}};this.on_pe=function(a,b,d,c,f,m){var e=a.internal_flags,g=0,l=X(2),q;g=new xa(g);a=w.ResvMaxBits(a,c,g,m);g=g.bits;var h=g+a;h>da.MAX_BITS_PER_GRANULE&&(h=da.MAX_BITS_PER_GRANULE);for(q=m=0;q3*c/4&&(l[q]=3*c/4),0>l[q]&&(l[q]=0),l[q]+d[q]>da.MAX_BITS_PER_CHANNEL&&(l[q]=Math.max(0,da.MAX_BITS_PER_CHANNEL-d[q])),m+=l[q];if(m>a)for(q=0;qda.MAX_BITS_PER_GRANULE)for(q=0;qb&&(b=0);.5da.MAX_BITS_PER_CHANNEL- +a[0]&&(b=da.MAX_BITS_PER_CHANNEL-a[0]);0>b&&(b=0);125<=a[1]&&(125c&&(a[0]=c*a[0]/b,a[1]=c*a[1]/b)};this.athAdjust=function(a,b,d){b=aa.FAST_LOG10_X(b,10);a*=a;var c=0;b-=d;1E-20c&&(c=0);return Math.pow(10,.1*(b*c+(d+90.30873362-94.82444863)))};this.calc_xmin=function(a,b,d,f){var e=0,g=a.internal_flags,m,l=0,k=0,v=g.ATH,h=d.xr,x=a.VBR==G.vbr_mtrh?1:0,y=g.masking_lower;if(a.VBR== +G.vbr_mtrh||a.VBR==G.vbr_mt)y=1;for(m=0;m>1;var C=0;do{var I=h[l]*h[l];C+=I;B+=IA&&k++;m==c.SBPSY_l&&(u=A*g.nsPsy.longfact[m],BS;S++){C=0;z=n>>1;u=w/n;B=2.220446049250313E-16;do I=h[l]*h[l],C+=I,B+=Iw&&k++;Q==c.SBPSY_s&&(u=w*g.nsPsy.shortfact[Q],Bf[e-3+1]&&(f[e-3+1]+=(f[e-3]-f[e-3+1])*g.decay),f[e-3+1]>f[e-3+2]&&(f[e-3+2]+=(f[e-3+1]-f[e-3+2])*g.decay))}return k};this.calc_noise_core=function(a,b,d,c){var e=0,f=b.s,g=a.l3_enc;if(f>a.count1)for(;0!=d--;){var l=a.xr[f];f++;e+=l*l;l=a.xr[f];f++;e+=l*l}else if(f>a.big_values){var k=K(2);k[0]=0;for(k[1]=c;0!=d--;)l=Math.abs(a.xr[f])-k[g[f]],f++,e+=l*l,l=Math.abs(a.xr[f])- +k[g[f]],f++,e+=l*l}else for(;0!=d--;)l=Math.abs(a.xr[f])-m[g[f]]*c,f++,e+=l*l,l=Math.abs(a.xr[f])-m[g[f]]*c,f++,e+=l*l;b.s=f;return e};this.calc_noise=function(a,c,d,f,m){var e=0,g=0,l,q=0,u=0,h=0,x=-20,y=0,A=a.scalefac,n=0;for(l=f.over_SSD=0;l>1;y+a.width[l]> +a.max_nonzero_coeff&&(w=a.max_nonzero_coeff-y+1,w=0>1:0);y=new k(y);z=this.calc_noise_core(a,y,w,z);y=y.s;null!=m&&(m.step[l]=B,m.noise[l]=z);z=d[e++]=z/c[g++];z=aa.FAST_LOG10(Math.max(z,1E-20));null!=m&&(m.noise_log[l]=z)}null!=m&&(m.global_gain=a.global_gain);h+=z;0I;I++){k=0;for(C=B;Cf;++f){var a=c.tt[b][0].xr[f],m=c.tt[b][1].xr[f];c.tt[b][0].xr[f]=.5*(a+m)*aa.SQRT2; +c.tt[b][1].xr[f]=.5*(a-m)*aa.SQRT2}};this.init_xrpow=function(c,b,k){var a=0|b.max_nonzero_coeff;b.xrpow_max=0;na.fill(k,a,576,0);for(var f,v=f=0;v<=a;++v){var e=Math.abs(b.xr[v]);f+=e;k[v]=Math.sqrt(e*Math.sqrt(e));k[v]>b.xrpow_max&&(b.xrpow_max=k[v])}if(1E-20l;l++)for(var d=n;d=n;e--)if(Math.abs(a[e])l;l++)for(b=!1,m=c.PSFB12-1;0<=m&&!b;m--)for(n=3*f.scalefac_band.s[12]+(f.scalefac_band.s[13]-f.scalefac_band.s[12])*l+(f.scalefac_band.psfb12[m]-f.scalefac_band.psfb12[0]),e=n+(f.scalefac_band.psfb12[m+1]-f.scalefac_band.psfb12[m]),d=E.athAdjust(k.adjust,k.psfb12[m],k.floor),1E-12=n;e--)if(Math.abs(a[e])n;n++){var e=0;0!=b.l3_enc[n]&&(e=Math.abs(b.xr[n]));a[n]=e}n=0;e=8;b.block_type==c.SHORT_TYPE&&(e=6);do{var l,d,g=b.width[e];n+=g;if(!(1<=m[e]||(na.sort(a,n-g,g),qa.EQ(a[n-1],0)))){var q=(1-m[e])*k[e];var v=l=0;do{for(d= +1;v+dh?(z==u.BINSEARCH_DOWN&&(y=!0),y&&(x/=2),z=u.BINSEARCH_UP,H=x):(z==u.BINSEARCH_UP&&(y=!0),y&&(x/=2),z=u.BINSEARCH_DOWN,H=-x);b.global_gain+=H;0>b.global_gain&&(b.global_gain=0,y=!0);255h&&255>b.global_gain;)b.global_gain++,H=ha.count_bits(e,a,b,null);e.CurrentStep[m]=4<=A-b.global_gain?4:2;e.OldValue[m]=b.global_gain;b.part2_3_length=H;if(0==e.noise_shaping)return 100;E.calc_noise(b,n,g,q,v);q.bits=b.part2_3_length; +l.assign(b);m=0;for(T.arraycopy(a,0,d,0,576);!r;){do{h=new sb;y=255;x=0!=(e.substep_shaping&2)?20:3;if(e.sfb21_extra){if(1L;L++)C[Z+L]*=Q,C[Z+L]>O.xrpow_max&&(O.xrpow_max=C[Z+L]);if(2==I.noise_shaping_amp)break}}if(Q=k(A))A=!1;else if(Q=2==z.mode_gr?ha.scale_bitcount(A):ha.scale_bitcount_lsf(z,A)){if(1I;I++)H[O+I]*=1.2968395546510096,H[O+I]>Q.xrpow_max&&(Q.xrpow_max=H[O+I]);Q.scalefac[F]=C>>1}Q.preflag=0;Q.scalefac_scale=1;Q=!1}else if(A.block_type==c.SHORT_TYPE&&0I;I++){ma=S=0;for(H=O.sfb_lmax+I;HS&&8>ma)){if(7<=O.subblock_gain[I]){H= +!0;break b}O.subblock_gain[I]++;S=Q.scalefac_band.l[O.sfb_lmax];for(H=O.sfb_lmax+I;H>O.scalefac_scale,0<=Z)C[H]=Z,S+=3*ma;else{C[H]=0;Z=E.IPOW20(210+(Z<L;L++)F[S+L]*=Z,F[S+L]>O.xrpow_max&&(O.xrpow_max=F[S+L]);S+=ma*(3-I-1)}Z=E.IPOW20(202);S+=O.width[H]*(I+1);for(L=-O.width[H];0>L;L++)F[S+L]*=Z,F[S+L]>O.xrpow_max&&(O.xrpow_max=F[S+L])}}H=!1}Q=H||k(A)}Q||(Q=2==z.mode_gr?ha.scale_bitcount(A):ha.scale_bitcount_lsf(z, +A));A=!Q}else A=!0;if(!A)break;0!=l.scalefac_scale&&(y=254);A=B-l.part2_length;if(0>=A)break;for(;(l.part2_3_length=ha.count_bits(e,a,l,v))>A&&l.global_gain<=y;)l.global_gain++;if(l.global_gain>y)break;if(0==q.over_count){for(;(l.part2_3_length=ha.count_bits(e,a,l,v))>p&&l.global_gain<=y;)l.global_gain++;if(l.global_gain>y)break}E.calc_noise(l,n,g,h,v);h.bits=l.part2_3_length;z=b.block_type!=c.SHORT_TYPE?f.quant_comp:f.quant_comp_short;y=q;A=h;Q=l;H=g;switch(z){default:case 9:0A.max_noise&&10*A.max_noise+A.bits<=10*y.max_noise+y.bits;break;case 0:z=A.over_count=A.max_noise&&.2=A.max_noise&&0>y.max_noise&&y.max_noise>A.max_noise-.2&&A.tot_noise=A.max_noise&&0A.max_noise-.2&&A.tot_noiseA.max_noise-.1&&A.tot_noise+A.over_noiseA.max_noise-.15&&A.tot_noise+A.over_noise+A.over_noisex&&0== +q.over_count)break;if(3==e.noise_shaping_amp&&t&&30l.global_gain+l.scalefac_scale);3==e.noise_shaping_amp?t?r=!0:(l.assign(b),T.arraycopy(d,0,a,0,576),m=0,w=l.global_gain,t=!0):r=!0}f.VBR==G.vbr_rh||f.VBR==G.vbr_mtrh?T.arraycopy(d,0,a,0,576):0!=(e.substep_shaping&1)&&trancate_smallspectrums(e,b,n,a);return q.over_count};this.iteration_finish_one=function(c,b,k){var a=c.l3_side,f=a.tt[b][k];ha.best_scalefac_store(c,b,k,a);1== +c.use_best_huffman&&ha.best_huffman_divide(c,f);w.ResvAdjust(c,f)};this.VBR_encode_granule=function(c,b,k,a,m,n,e){var f=c.internal_flags,d=new rb,g=K(576),q=e,v=(e+n)/2,p=0,r=f.sfb21_extra;na.fill(d.l3_enc,0);do{f.sfb21_extra=v>q-42?!1:r;var t=outer_loop(c,b,k,a,m,v);0>=t?(p=1,e=b.part2_3_length,d.assign(b),T.arraycopy(a,0,g,0,576),e-=32,t=e-n,v=(e+n)/2):(n=v+32,t=e-n,v=(e+n)/2,0!=p&&(p=2,b.assign(d),T.arraycopy(g,0,a,0,576)))}while(12n[g.VBR_max_bitrate]&& +(l[r][t]*=n[g.VBR_max_bitrate],l[r][t]/=v),e[r][t]>l[r][t]&&(e[r][t]=l[r][t]);return q};this.bitpressure_strategy=function(f,b,k,a){for(var m=0;mq&&(n[m][v]*=q,n[m][v]/=g);return l};this.calc_target_bits=function(f,b,k,a,m,u){var e=f.internal_flags,l=e.l3_side;e.bitrate_index=e.VBR_max_bitrate;var d=new xa(0);u[0]=w.ResvFrameBegin(f,d);e.bitrate_index=1;d=n.getframebits(f)-8*e.sideinfo_len;m[0]=d/(e.mode_gr*e.channels_out);d=f.VBR_mean_bitrate_kbps*f.framesize*1E3;0!=(e.substep_shaping&1)&&(d*=1.09);d/=f.out_samplerate; +d-=8*e.sideinfo_len;d/=e.mode_gr*e.channels_out;var g=.93+.07*(11-f.compression_ratio)/5.5;.9>g&&(g=.9);13*d/2?v=3*d/2:0>v&&(v=0);a[f][m]+=v}a[f][m]>da.MAX_BITS_PER_CHANNEL&&(a[f][m]=da.MAX_BITS_PER_CHANNEL);q+=a[f][m]}if(q>da.MAX_BITS_PER_GRANULE)for(m=0;mda.MAX_BITS_PER_CHANNEL&&(a[f][m]=da.MAX_BITS_PER_CHANNEL),b+=a[f][m];if(b>u[0])for(f=0;fe;e++){var l=k[f+-10];var d=b[n+-224]*l;var g=b[c+224]*l;l=k[f+-9];d+=b[n+-160]* +l;g+=b[c+160]*l;l=k[f+-8];d+=b[n+-96]*l;g+=b[c+96]*l;l=k[f+-7];d+=b[n+-32]*l;g+=b[c+32]*l;l=k[f+-6];d+=b[n+32]*l;g+=b[c+-32]*l;l=k[f+-5];d+=b[n+96]*l;g+=b[c+-96]*l;l=k[f+-4];d+=b[n+160]*l;g+=b[c+-160]*l;l=k[f+-3];d+=b[n+224]*l;g+=b[c+-224]*l;l=k[f+-2];d+=b[c+-256]*l;g-=b[n+256]*l;l=k[f+-1];d+=b[c+-192]*l;g-=b[n+192]*l;l=k[f+0];d+=b[c+-128]*l;g-=b[n+128]*l;l=k[f+1];d+=b[c+-64]*l;g-=b[n+64]*l;l=k[f+2];d+=b[c+0]*l;g-=b[n+0]*l;l=k[f+3];d+=b[c+64]*l;g-=b[n+-64]*l;l=k[f+4];d+=b[c+128]*l;g-=b[n+-128]*l; +l=k[f+5];d+=b[c+192]*l;g-=b[n+-192]*l;d*=k[f+6];l=g-d;a[30+2*e]=g+d;a[31+2*e]=k[f+7]*l;f+=18;c--;n++}g=b[c+-16]*k[f+-10];d=b[c+-32]*k[f+-2];g+=(b[c+-48]-b[c+16])*k[f+-9];d+=b[c+-96]*k[f+-1];g+=(b[c+-80]+b[c+48])*k[f+-8];d+=b[c+-160]*k[f+0];g+=(b[c+-112]-b[c+80])*k[f+-7];d+=b[c+-224]*k[f+1];g+=(b[c+-144]+b[c+112])*k[f+-6];d-=b[c+32]*k[f+2];g+=(b[c+-176]-b[c+144])*k[f+-5];d-=b[c+96]*k[f+3];g+=(b[c+-208]+b[c+176])*k[f+-4];d-=b[c+160]*k[f+4];g+=(b[c+-240]-b[c+208])*k[f+-3];d-=b[c+224];b=d-g;c=d+g;g=a[14]; +d=a[15]-g;a[31]=c+g;a[30]=b+d;a[15]=b-d;a[14]=c-g;d=a[28]-a[0];a[0]+=a[28];a[28]=d*k[f+-36+7];d=a[29]-a[1];a[1]+=a[29];a[29]=d*k[f+-36+7];d=a[26]-a[2];a[2]+=a[26];a[26]=d*k[f+-72+7];d=a[27]-a[3];a[3]+=a[27];a[27]=d*k[f+-72+7];d=a[24]-a[4];a[4]+=a[24];a[24]=d*k[f+-108+7];d=a[25]-a[5];a[5]+=a[25];a[25]=d*k[f+-108+7];d=a[22]-a[6];a[6]+=a[22];a[22]=d*aa.SQRT2;d=a[23]-a[7];a[7]+=a[23];a[23]=d*aa.SQRT2-a[7];a[7]-=a[6];a[22]-=a[7];a[23]-=a[22];d=a[6];a[6]=a[31]-d;a[31]+=d;d=a[7];a[7]=a[30]-d;a[30]+=d;d= +a[22];a[22]=a[15]-d;a[15]+=d;d=a[23];a[23]=a[14]-d;a[14]+=d;d=a[20]-a[8];a[8]+=a[20];a[20]=d*k[f+-180+7];d=a[21]-a[9];a[9]+=a[21];a[21]=d*k[f+-180+7];d=a[18]-a[10];a[10]+=a[18];a[18]=d*k[f+-216+7];d=a[19]-a[11];a[11]+=a[19];a[19]=d*k[f+-216+7];d=a[16]-a[12];a[12]+=a[16];a[16]=d*k[f+-252+7];d=a[17]-a[13];a[13]+=a[17];a[17]=d*k[f+-252+7];d=-a[20]+a[24];a[20]+=a[24];a[24]=d*k[f+-216+7];d=-a[21]+a[25];a[21]+=a[25];a[25]=d*k[f+-216+7];d=a[4]-a[8];a[4]+=a[8];a[8]=d*k[f+-216+7];d=a[5]-a[9];a[5]+=a[9];a[9]= +d*k[f+-216+7];d=a[0]-a[12];a[0]+=a[12];a[12]=d*k[f+-72+7];d=a[1]-a[13];a[1]+=a[13];a[13]=d*k[f+-72+7];d=a[16]-a[28];a[16]+=a[28];a[28]=d*k[f+-72+7];d=-a[17]+a[29];a[17]+=a[29];a[29]=d*k[f+-72+7];d=aa.SQRT2*(a[2]-a[10]);a[2]+=a[10];a[10]=d;d=aa.SQRT2*(a[3]-a[11]);a[3]+=a[11];a[11]=d;d=aa.SQRT2*(-a[18]+a[26]);a[18]+=a[26];a[26]=d-a[18];d=aa.SQRT2*(-a[19]+a[27]);a[19]+=a[27];a[27]=d-a[19];d=a[2];a[19]-=a[3];a[3]-=d;a[2]=a[31]-d;a[31]+=d;d=a[3];a[11]-=a[19];a[18]-=d;a[3]=a[30]-d;a[30]+=d;d=a[18];a[27]-= +a[11];a[19]-=d;a[18]=a[15]-d;a[15]+=d;d=a[19];a[10]-=d;a[19]=a[14]-d;a[14]+=d;d=a[10];a[11]-=d;a[10]=a[23]-d;a[23]+=d;d=a[11];a[26]-=d;a[11]=a[22]-d;a[22]+=d;d=a[26];a[27]-=d;a[26]=a[7]-d;a[7]+=d;d=a[27];a[27]=a[6]-d;a[6]+=d;d=aa.SQRT2*(a[0]-a[4]);a[0]+=a[4];a[4]=d;d=aa.SQRT2*(a[1]-a[5]);a[1]+=a[5];a[5]=d;d=aa.SQRT2*(a[16]-a[20]);a[16]+=a[20];a[20]=d;d=aa.SQRT2*(a[17]-a[21]);a[17]+=a[21];a[21]=d;d=-aa.SQRT2*(a[8]-a[12]);a[8]+=a[12];a[12]=d-a[8];d=-aa.SQRT2*(a[9]-a[13]);a[9]+=a[13];a[13]=d-a[9];d= +-aa.SQRT2*(a[25]-a[29]);a[25]+=a[29];a[29]=d-a[25];d=-aa.SQRT2*(a[24]+a[28]);a[24]-=a[28];a[28]=d-a[24];d=a[24]-a[16];a[24]=d;d=a[20]-d;a[20]=d;d=a[28]-d;a[28]=d;d=a[25]-a[17];a[25]=d;d=a[21]-d;a[21]=d;d=a[29]-d;a[29]=d;d=a[17]-a[1];a[17]=d;d=a[9]-d;a[9]=d;d=a[25]-d;a[25]=d;d=a[5]-d;a[5]=d;d=a[21]-d;a[21]=d;d=a[13]-d;a[13]=d;d=a[29]-d;a[29]=d;d=a[1]-a[0];a[1]=d;d=a[16]-d;a[16]=d;d=a[17]-d;a[17]=d;d=a[8]-d;a[8]=d;d=a[9]-d;a[9]=d;d=a[24]-d;a[24]=d;d=a[25]-d;a[25]=d;d=a[4]-d;a[4]=d;d=a[5]-d;a[5]=d;d= +a[20]-d;a[20]=d;d=a[21]-d;a[21]=d;d=a[12]-d;a[12]=d;d=a[13]-d;a[13]=d;d=a[28]-d;a[28]=d;d=a[29]-d;a[29]=d;d=a[0];a[0]+=a[31];a[31]-=d;d=a[1];a[1]+=a[30];a[30]-=d;d=a[16];a[16]+=a[15];a[15]-=d;d=a[17];a[17]+=a[14];a[14]-=d;d=a[8];a[8]+=a[23];a[23]-=d;d=a[9];a[9]+=a[22];a[22]-=d;d=a[24];a[24]+=a[7];a[7]-=d;d=a[25];a[25]+=a[6];a[6]-=d;d=a[4];a[4]+=a[27];a[27]-=d;d=a[5];a[5]+=a[26];a[26]-=d;d=a[20];a[20]+=a[11];a[11]-=d;d=a[21];a[21]+=a[10];a[10]-=d;d=a[12];a[12]+=a[19];a[19]-=d;d=a[13];a[13]+=a[18]; +a[18]-=d;d=a[28];a[28]+=a[3];a[3]-=d;d=a[29];a[29]+=a[2];a[2]-=d}var k=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152, +321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375, +-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542, +355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463, +-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965, +29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006, +.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487, +26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164, +.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184, +23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734, +.04912684976946725,1.990369453344394,.0178904535*aa.SQRT2/2.384E-6,.008938074*aa.SQRT2/2.384E-6,.0015673635*aa.SQRT2/2.384E-6,.001228571*aa.SQRT2/2.384E-6,4.856585E-4*aa.SQRT2/2.384E-6,1.09434E-4*aa.SQRT2/2.384E-6,5.0783E-5*aa.SQRT2/2.384E-6,6.914E-6*aa.SQRT2/2.384E-6,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],n=[[2.382191739347913E-13,6.423305872147834E-13,9.400849094049688E-13,1.122435026096556E-12,1.183840321267481E-12, +1.122435026096556E-12,9.40084909404969E-13,6.423305872147839E-13,2.382191739347918E-13,5.456116108943412E-12,4.878985199565852E-12,4.240448995017367E-12,3.559909094758252E-12,2.858043359288075E-12,2.156177623817898E-12,1.475637723558783E-12,8.371015190102974E-13,2.599706096327376E-13,-5.456116108943412E-12,-4.878985199565852E-12,-4.240448995017367E-12,-3.559909094758252E-12,-2.858043359288076E-12,-2.156177623817898E-12,-1.475637723558783E-12,-8.371015190102975E-13,-2.599706096327376E-13,-2.382191739347923E-13, +-6.423305872147843E-13,-9.400849094049696E-13,-1.122435026096556E-12,-1.183840321267481E-12,-1.122435026096556E-12,-9.400849094049694E-13,-6.42330587214784E-13,-2.382191739347918E-13],[2.382191739347913E-13,6.423305872147834E-13,9.400849094049688E-13,1.122435026096556E-12,1.183840321267481E-12,1.122435026096556E-12,9.400849094049688E-13,6.423305872147841E-13,2.382191739347918E-13,5.456116108943413E-12,4.878985199565852E-12,4.240448995017367E-12,3.559909094758253E-12,2.858043359288075E-12,2.156177623817898E-12, +1.475637723558782E-12,8.371015190102975E-13,2.599706096327376E-13,-5.461314069809755E-12,-4.921085770524055E-12,-4.343405037091838E-12,-3.732668368707687E-12,-3.093523840190885E-12,-2.430835727329465E-12,-1.734679010007751E-12,-9.74825365660928E-13,-2.797435120168326E-13,0,0,0,0,0,0,-2.283748241799531E-13,-4.037858874020686E-13,-2.146547464825323E-13],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212, +4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2.283748241799531E-13, +4.037858874020686E-13,2.146547464825323E-13,5.461314069809755E-12,4.921085770524055E-12,4.343405037091838E-12,3.732668368707687E-12,3.093523840190885E-12,2.430835727329466E-12,1.734679010007751E-12,9.74825365660928E-13,2.797435120168326E-13,-5.456116108943413E-12,-4.878985199565852E-12,-4.240448995017367E-12,-3.559909094758253E-12,-2.858043359288075E-12,-2.156177623817898E-12,-1.475637723558782E-12,-8.371015190102975E-13,-2.599706096327376E-13,-2.382191739347913E-13,-6.423305872147834E-13,-9.400849094049688E-13, +-1.122435026096556E-12,-1.183840321267481E-12,-1.122435026096556E-12,-9.400849094049688E-13,-6.423305872147841E-13,-2.382191739347918E-13]],w=n[c.SHORT_TYPE],E=n[c.SHORT_TYPE],B=n[c.SHORT_TYPE],G=n[c.SHORT_TYPE],f=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];this.mdct_sub48=function(b,k,a){for(var m=286,v=0;vr;r++)for(u(k,m,D[p]),u(k, +m+32,D[p+1]),p+=2,m+=64,l=1;32>l;l+=2)D[p-1][l]*=-1;for(l=0;32>l;l++,q+=18){D=d.block_type;p=b.sb_sample[v][e];var t=b.sb_sample[v][1-e];0!=d.mixed_block_flag&&2>l&&(D=0);if(1E-12>b.amp_filter[l])na.fill(g,q+0,q+18,0);else{if(1>b.amp_filter[l])for(r=0;18>r;r++)t[r][f[l]]*=b.amp_filter[l];if(D==c.SHORT_TYPE){for(r=-3;0>r;r++){var J=n[c.SHORT_TYPE][r+3];g[q+3*r+9]=p[9+r][f[l]]*J-p[8-r][f[l]];g[q+3*r+18]=p[14-r][f[l]]*J+p[15+r][f[l]];g[q+3*r+10]=p[15+r][f[l]]*J-p[14-r][f[l]];g[q+3*r+19]=t[2-r][f[l]]* +J+t[3+r][f[l]];g[q+3*r+11]=t[3+r][f[l]]*J-t[2-r][f[l]];g[q+3*r+20]=t[8-r][f[l]]*J+t[9+r][f[l]]}r=g;p=q;for(J=0;3>J;J++){var h=r[p+6]*n[c.SHORT_TYPE][0]-r[p+15];t=r[p+0]*n[c.SHORT_TYPE][2]-r[p+9];var x=h+t;var y=h-t;h=r[p+15]*n[c.SHORT_TYPE][0]+r[p+6];t=r[p+9]*n[c.SHORT_TYPE][2]+r[p+0];var A=h+t;var N=-h+t;t=2.069978111953089E-11*(r[p+3]*n[c.SHORT_TYPE][1]-r[p+12]);h=2.069978111953089E-11*(r[p+12]*n[c.SHORT_TYPE][1]+r[p+3]);r[p+0]=1.90752519173728E-11*x+t;r[p+15]=1.90752519173728E-11*-A+h;y*=1.6519652744032674E-11; +A=9.537625958686404E-12*A+h;r[p+3]=y-A;r[p+6]=y+A;x=9.537625958686404E-12*x-t;N*=1.6519652744032674E-11;r[p+9]=x+N;r[p+12]=x-N;p++}}else{J=K(18);for(r=-9;0>r;r++)x=n[D][r+27]*t[r+9][f[l]]+n[D][r+36]*t[8-r][f[l]],y=n[D][r+9]*p[r+9][f[l]]-n[D][r+18]*p[8-r][f[l]],J[r+9]=x-y*w[3+r+9],J[r+18]=x*w[3+r+9]+y;r=g;p=q;x=J;var H=x[17]-x[9];var O=x[15]-x[11];var F=x[14]-x[12];N=x[0]+x[8];A=x[1]+x[7];h=x[2]+x[6];y=x[3]+x[5];r[p+17]=N+h-y-(A-x[4]);J=(N+h-y)*E[19]+(A-x[4]);t=(H-O-F)*E[18];r[p+5]=t+J;r[p+6]=t-J; +var C=(x[16]-x[10])*E[18];A=A*E[19]+x[4];t=H*E[12]+C+O*E[13]+F*E[14];J=-N*E[16]+A-h*E[17]+y*E[15];r[p+1]=t+J;r[p+2]=t-J;t=H*E[13]-C-O*E[14]+F*E[12];J=-N*E[17]+A-h*E[15]+y*E[16];r[p+9]=t+J;r[p+10]=t-J;t=H*E[14]-C+O*E[12]-F*E[13];J=N*E[15]-A+h*E[16]-y*E[17];r[p+13]=t+J;r[p+14]=t-J;H=x[8]-x[0];O=x[6]-x[2];F=x[5]-x[3];N=x[17]+x[9];A=x[16]+x[10];h=x[15]+x[11];y=x[14]+x[12];r[p+0]=N+h+y+(A+x[13]);t=(N+h+y)*E[19]-(A+x[13]);J=(H-O+F)*E[18];r[p+11]=t+J;r[p+12]=t-J;C=(x[7]-x[1])*E[18];A=x[13]-A*E[19];t=N*E[15]- +A+h*E[16]+y*E[17];J=H*E[14]+C+O*E[12]+F*E[13];r[p+3]=t+J;r[p+4]=t-J;t=-N*E[17]+A-h*E[15]-y*E[16];J=H*E[13]+C-O*E[14]-F*E[12];r[p+7]=t+J;r[p+8]=t-J;t=-N*E[16]+A-h*E[17]-y*E[15];J=H*E[12]-C+O*E[13]-F*E[14];r[p+15]=t+J;r[p+16]=t-J}}if(D!=c.SHORT_TYPE&&0!=l)for(r=7;0<=r;--r)D=g[q+r]*B[20+r]+g[q+-1-r]*G[28+r],p=g[q+r]*G[28+r]-g[q+-1-r]*B[20+r],g[q+-1-r]=D,g[q+r]=p}}k=a;m=286;if(1==b.mode_gr)for(e=0;18>e;e++)T.arraycopy(b.sb_sample[v][1][e],0,b.sb_sample[v][0][e],0,32)}}}function Xa(){this.thm=new Xb;this.en= +new Xb}function c(){var u=c.FFTOFFSET,k=c.MPG_MD_MS_LR,n=null,w=this.psy=null,E=null,B=null;this.setModules=function(c,b,k,a){n=c;w=this.psy=b;E=a;B=k};var ha=new Fc;this.lame_encode_mp3_frame=function(f,b,v,a,m,z){var e=Ob([2,2]);e[0][0]=new Xa;e[0][1]=new Xa;e[1][0]=new Xa;e[1][1]=new Xa;var l=Ob([2,2]);l[0][0]=new Xa;l[0][1]=new Xa;l[1][0]=new Xa;l[1][1]=new Xa;var d=[null,null],g=f.internal_flags,q=ca([2,4]),D=[.5,.5],p=[[0,0],[0,0]],r=[[0,0],[0,0]];d[0]=b;d[1]=v;if(0==g.lame_encode_frame_init){b= +f.internal_flags;var t,J;if(0==b.lame_encode_frame_init){v=K(2014);var h=K(2014);b.lame_encode_frame_init=1;for(J=t=0;t<286+576*(1+b.mode_gr);++t)t<576*b.mode_gr?(v[t]=0,2==b.channels_out&&(h[t]=0)):(v[t]=d[0][J],2==b.channels_out&&(h[t]=d[1][J]),++J);for(J=0;J(g.slot_lag-=g.frac_SpF)&&(g.slot_lag+=f.out_samplerate,g.padding=1);if(0!=g.psymodel)for(h=[null,null],t=0,J=X(2),v= +0;v=q?(g.ATH.adjust*=.075*q+.925,g.ATH.adjust= +q?g.ATH.adjust=q:g.ATH.adjustl;l++)g.nsPsy.pefirbuf[l]=g.nsPsy.pefirbuf[l+ +1];for(v=r=0;vl;l++)r+=(g.nsPsy.pefirbuf[l]+g.nsPsy.pefirbuf[18-l])*c.fircoef[l];r=3350*g.mode_gr*g.channels_out/r;for(v=0;vm;m++)g.pinfo.pcmdata[b][m]=d[b][m-u]}B.set_frame_pinfo(f,e)}g.bitrate_stereoMode_Hist[g.bitrate_index][4]++;g.bitrate_stereoMode_Hist[15][4]++;2==g.channels_out&&(g.bitrate_stereoMode_Hist[g.bitrate_index][g.mode_ext]++,g.bitrate_stereoMode_Hist[15][g.mode_ext]++);for(f=0;fc;c++)for(var k=0;2>k;k++)this.tt[c][k]=new rb}function Ic(){this.last_en_subshort=ca([4,9]);this.lastAttacks=X(4);this.pefirbuf= +K(19);this.longfact=K(c.SBMAX_l);this.shortfact=K(c.SBMAX_s);this.attackthre_s=this.attackthre=0}function Xb(){this.l=K(c.SBMAX_l);this.s=ca([c.SBMAX_s,3]);var u=this;this.assign=function(k){T.arraycopy(k.l,0,u.l,0,c.SBMAX_l);for(var n=0;nw;w++)u.s[n][w]=k.s[n][w]}}function da(){function u(){this.ptr=this.write_timing=0;this.buf=new Int8Array(40)}this.fill_buffer_resample_init=this.iteration_init_init=this.lame_encode_frame_init=this.Class_ID=0;this.mfbuf=ca([2,da.MFSIZE]); +this.full_outer_loop=this.use_best_huffman=this.subblock_gain=this.noise_shaping_stop=this.psymodel=this.substep_shaping=this.noise_shaping_amp=this.noise_shaping=this.highpass2=this.highpass1=this.lowpass2=this.lowpass1=this.mode_ext=this.samplerate_index=this.bitrate_index=this.VBR_max_bitrate=this.VBR_min_bitrate=this.mf_size=this.mf_samples_to_encode=this.resample_ratio=this.channels_out=this.channels_in=this.mode_gr=0;this.l3_side=new Hc;this.ms_ratio=K(2);this.slot_lag=this.frac_SpF=this.padding= +0;this.tag_spec=null;this.nMusicCRC=0;this.OldValue=X(2);this.CurrentStep=X(2);this.masking_lower=0;this.bv_scf=X(576);this.pseudohalf=X(sa.SFBMAX);this.sfb21_extra=!1;this.inbuf_old=Array(2);this.blackfilt=Array(2*da.BPC+1);this.itime=new Float64Array(2);this.sideinfo_len=0;this.sb_sample=ca([2,2,18,c.SBLIMIT]);this.amp_filter=K(32);this.header=Array(da.MAX_HEADER_BUF);this.ResvMax=this.ResvSize=this.ancillary_flag=this.w_ptr=this.h_ptr=0;this.scalefac_band=new za;this.minval_l=K(c.CBANDS);this.minval_s= +K(c.CBANDS);this.nb_1=ca([4,c.CBANDS]);this.nb_2=ca([4,c.CBANDS]);this.nb_s1=ca([4,c.CBANDS]);this.nb_s2=ca([4,c.CBANDS]);this.s3_ll=this.s3_ss=null;this.decay=0;this.thm=Array(4);this.en=Array(4);this.tot_ener=K(4);this.loudness_sq=ca([2,2]);this.loudness_sq_save=K(2);this.mld_l=K(c.SBMAX_l);this.mld_s=K(c.SBMAX_s);this.bm_l=X(c.SBMAX_l);this.bo_l=X(c.SBMAX_l);this.bm_s=X(c.SBMAX_s);this.bo_s=X(c.SBMAX_s);this.npart_s=this.npart_l=0;this.s3ind=Ia([c.CBANDS,2]);this.s3ind_s=Ia([c.CBANDS,2]);this.numlines_s= +X(c.CBANDS);this.numlines_l=X(c.CBANDS);this.rnumlines_l=K(c.CBANDS);this.mld_cb_l=K(c.CBANDS);this.mld_cb_s=K(c.CBANDS);this.numlines_l_num1=this.numlines_s_num1=0;this.pe=K(4);this.ms_ener_ratio_old=this.ms_ratio_l_old=this.ms_ratio_s_old=0;this.blocktype_old=X(2);this.nsPsy=new Ic;this.VBR_seek_table=new Gc;this.PSY=this.ATH=null;this.nogap_current=this.nogap_total=0;this.findPeakSample=this.findReplayGain=this.decode_on_the_fly=!0;this.AudiophileGain=this.RadioGain=this.PeakSample=0;this.rgdata= +null;this.noclipScale=this.noclipGainChange=0;this.bitrate_stereoMode_Hist=Ia([16,5]);this.bitrate_blockType_Hist=Ia([16,6]);this.hip=this.pinfo=null;this.in_buffer_nsamples=0;this.iteration_loop=this.in_buffer_1=this.in_buffer_0=null;for(var k=0;k>1;var e=a;var l=a<<1;var d=l+e; +a=l<<1;var g=k;var q=g+u;do{var B=c[g+0]-c[g+e];var p=c[g+0]+c[g+e];var r=c[g+l]-c[g+d];var t=c[g+l]+c[g+d];c[g+l]=p-t;c[g+0]=p+t;c[g+d]=B-r;c[g+e]=B+r;B=c[q+0]-c[q+e];p=c[q+0]+c[q+e];r=aa.SQRT2*c[q+d];t=aa.SQRT2*c[q+l];c[q+l]=p-t;c[q+0]=p+t;c[q+d]=B-r;c[q+e]=B+r;q+=a;g+=a}while(gk;k++){var a=c.BLKSIZE_s/2,m=65535&192*(k+1),B= +c.BLKSIZE_s/8-1;do{var e=E[B<<2]&255;var l=n[e]*b[f][v+e+m];var d=n[127-e]*b[f][v+e+m+128];var g=l-d;l+=d;var q=n[e+64]*b[f][v+e+m+64];d=n[63-e]*b[f][v+e+m+192];var D=q-d;q+=d;a-=4;w[k][a+0]=l+q;w[k][a+2]=l-q;w[k][a+1]=g+D;w[k][a+3]=g-D;l=n[e+1]*b[f][v+e+m+1];d=n[126-e]*b[f][v+e+m+129];g=l-d;l+=d;q=n[e+65]*b[f][v+e+m+65];d=n[62-e]*b[f][v+e+m+193];D=q-d;q+=d;w[k][a+c.BLKSIZE_s/2+0]=l+q;w[k][a+c.BLKSIZE_s/2+2]=l-q;w[k][a+c.BLKSIZE_s/2+1]=g+D;w[k][a+c.BLKSIZE_s/2+3]=g-D}while(0<=--B);u(w[k],a,c.BLKSIZE_s/ +2)}};this.fft_long=function(n,w,f,b,v){n=c.BLKSIZE/8-1;var a=c.BLKSIZE/2;do{var m=E[n]&255;var B=k[m]*b[f][v+m];var e=k[m+512]*b[f][v+m+512];var l=B-e;B+=e;var d=k[m+256]*b[f][v+m+256];e=k[m+768]*b[f][v+m+768];var g=d-e;d+=e;a-=4;w[a+0]=B+d;w[a+2]=B-d;w[a+1]=l+g;w[a+3]=l-g;B=k[m+1]*b[f][v+m+1];e=k[m+513]*b[f][v+m+513];l=B-e;B+=e;d=k[m+257]*b[f][v+m+257];e=k[m+769]*b[f][v+m+769];g=d-e;d+=e;w[a+c.BLKSIZE/2+0]=B+d;w[a+c.BLKSIZE/2+2]=B-d;w[a+c.BLKSIZE/2+1]=l+g;w[a+c.BLKSIZE/2+3]=l-g}while(0<=--n);u(w, +a,c.BLKSIZE/2)};this.init_fft=function(u){for(u=0;ua)if(c=c*r)return a+c;g=a/c}a+=c;if(6>=b+3){if(g>=p)return a;b=0|aa.FAST_LOG10_X(g,16);return a* +x[b]}b=0|aa.FAST_LOG10_X(g,16);c=0!=e?f.ATH.cb_s[d]*f.ATH.adjust:f.ATH.cb_l[d]*f.ATH.adjust;return ac?(d=1,13>=b&&(d=y[b]),c=aa.FAST_LOG10_X(a/c,10/15),a*((h[b]-d)*c+d)):13a&&(a=0);0>c&&(c=0);if(0>=a)return c;if(0>=c)return a;var b=c>a?c/a:a/c;if(-2<=d&&2>=d){if(b>=p)return a+c;d=0|aa.FAST_LOG10_X(b,16);return(a+c)*A[d]}if(b=y){++e;break}k=a.PSY.bo_s_weight[e];y=1-k;l=k*d[g];k*=b[g];a.en[h].s[e][f]+=l;a.thm[h].s[e][f]+=k;l=y*d[g];k=y*b[g]}for(;e=m){++f;break}l=a.PSY.bo_l_weight[f];m=1-l;g=l*d[e];l*=b[e];a.en[h].l[f]+=g; +a.thm[h].l[f]+=l;g=m*d[e];l=m*b[e]}for(;f=d?c:0f;f++){var e=a.thm.s[h][f];if(0e&&(b=g>1E10*e?b+23.02585092994046*N[h]:b+N[h]*aa.FAST_LOG10(g/e))}}return b}function f(a,d){for(var b=281.0575,h=0;hf&&(b=e>1E10*f?b+23.02585092994046*H[h]: +b+H[h]*aa.FAST_LOG10(e/f))}}return b}function b(a,c,b,d,h){var f,e;for(f=e=0;fh&&(e=h);d[f]=e}else d[f]=0;for(f=1;fh&&(e=h),d[f]=e):d[f]=0;e=b[f-1]+b[f];0h&&(e=h),d[f]=e):d[f]=0}function a(a,c,b,d,f,h,e){var g=2*h;f=0y&&(k=y);l>p&&(l=p);c[2][m]=k;c[3][m]=l}}function m(a,c){a=0<=a?27*-a:a*c;return-72>=a?0:Math.exp(.2302585093*a)}function z(a){0>a&&(a=0);a*=.001;return 13*Math.atan(.76*a)+3.5*Math.atan(a*a/56.25)}function e(a,b,d,f,h,e,g,l,k,m,y,p){var q=K(c.CBANDS+1),n=l/(15z(l*t)- +A&&t<=k/2;t++);a[r]=t-u;for(C=r+1;uk/2){u=k/2;++r;break}}q[r]=l*u;for(u=0;ur&&(r=0),t=0|Math.floor(.5+y*(A-.5)),t>k/2&&(t=k/2),d[u]=(x[r]+x[t])/2,b[u]=x[t],g[u]=(n*A-q[b[u]])/(q[b[u]+1]-q[b[u]]),0>g[u]?g[u]=0:1=y){var p=y-.5;p=8*(p*p-2*p)}else p=0;y+=.474;y=15.811389+7.5*y-17.5*Math.sqrt(1+y*y);-60>=y?p=0:(y=Math.exp(.2302585093*(p+y)),p=y/.6609193);y=p*f[e];g[k][e]=y*h[k]}else for(e=0;e=n;++n)q=y+n*(x-y)/1E3,q=m(q,k),r+=q;q=1001/(r*(x-y));for(k=0;k +a&&(a=3410);a=Math.max(.1,a/1E3);return 3.64*Math.pow(a,-.8)-6.8*Math.exp(-.6*Math.pow(a-3.4,2))+6*Math.exp(-.15*Math.pow(a-8.7,2))+.001*(.6+.04*c)*Math.pow(a,4)}var q=new Jc,D=1/217621504/(c.BLKSIZE/2),p,r,t,J=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749],h=[3.3246*3.3246,3.23837*3.23837,9.9500500969,9.0247369744,8.1854926609,7.0440875649,2.46209*2.46209,2.284*2.284,4.4892710641,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,2.4621061921,2.1508568964,1.37074*1.37074,1.31036*1.31036, +1.5691069696,1.4555939904,1.16203*1.16203,1.2715945225,1.09428*1.09428,1.0659*1.0659,1.0779838276,1.0382591025,1],x=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1],y=[5.5396212496,2.29259*2.29259,4.9868695969,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,2.2499700001,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.2339655056,1.0779838276],A=[1.7782755904,1.35879*1.35879,1.38454* +1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1],N=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130],H=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1],O=[-1.730326E-17,-.01703172,-1.349528E-17,.0418072,-6.73278E-17,-.0876324,-3.0835E-17,.1863476,-1.104424E-16,-.627638];this.L3psycho_anal_ns=function(a,d,h,e,g,l,m,y,p,n){var x=a.internal_flags,r=ca([2,c.BLKSIZE]),t=ca([2,3,c.BLKSIZE_s]),A= +K(c.CBANDS+1),I=K(c.CBANDS+1),C=K(c.CBANDS+2),Q=X(2),S=X(2),z,D,F,H,N,Z,L,V=ca([2,576]),ma=X(c.CBANDS+2),R=X(c.CBANDS+2);na.fill(R,0);var T=x.channels_out;a.mode==la.JOINT_STEREO&&(T=4);var M=a.VBR==G.vbr_off?0==x.ResvMax?0:x.ResvSize/x.ResvMax*.5:a.VBR==G.vbr_rh||a.VBR==G.vbr_mtrh||a.VBR==G.vbr_mt?.6:1;for(z=0;zF;F++){var U;var da=Y[ha+F+10];for(H=U=0;9>H;H+=2)da+=O[H]*(Y[ha+F+H]+Y[ha+F+21-H]),U+=O[H+1]*(Y[ha+F+H+1]+Y[ha+F+21-H-1]); +V[z][F]=da+U}g[e][z].en.assign(x.en[z]);g[e][z].thm.assign(x.thm[z]);2F;F++)Qa[F]=x.nsPsy.last_en_subshort[z][F+6],qa[F]=Qa[F]/x.nsPsy.last_en_subshort[z][F+4],ya[0]+=Qa[F];if(2==z)for(F=0;576>F;F++){var Ya=V[0][F];var Xa=V[1][F];V[0][F]=Ya+Xa;V[1][F]=Ya-Xa}var Ia=V[z&1],ec=0;for(F=0;9> +F;F++){for(var xa=ec+64,Ga=1;ecQa[F+3-2]?Ga/Qa[F+3-2]:Qa[F+3-2]>10*Ga?Qa[F+3-2]/(10*Ga):0;qa[F+3]=Ga}if(a.analysis){var Qb=qa[0];for(F=1;12>F;F++)QbF;F++)0==ta[F/3]&&qa[F]>Ma&&(ta[F/3]=F%3+1);for(F=1;4>F;F++)1.7>(ya[F-1]>ya[F]?ya[F-1]/ya[F]:ya[F]/ +ya[F-1])&&(ta[F]=0,1==F&&(ta[0]=0));0!=ta[0]&&0!=x.nsPsy.lastAttacks[z]&&(ta[0]=0);if(3==x.nsPsy.lastAttacks[z]||0!=ta[0]+ta[1]+ta[2]+ta[3])ia=0,0!=ta[1]&&0!=ta[0]&&(ta[1]=0),0!=ta[2]&&0!=ta[1]&&(ta[2]=0),0!=ta[3]&&0!=ta[2]&&(ta[3]=0);2>z?S[z]=ia:0==ia&&(S[0]=S[1]=0);p[z]=x.tot_ener[z];var P=a,Ha=za,Gb=Wb,La=r,kb=z&1,Ra=t,Na=z&1,cb=e,Aa=z,va=d,qb=h,Va=P.internal_flags;if(2>Aa)q.fft_long(Va,La[kb],Aa,va,qb),q.fft_short(Va,Ra[Na],Aa,va,qb);else if(2==Aa){for(var ja=c.BLKSIZE-1;0<=ja;--ja){var Hb=La[kb+ +0][ja],Ib=La[kb+1][ja];La[kb+0][ja]=(Hb+Ib)*aa.SQRT2*.5;La[kb+1][ja]=(Hb-Ib)*aa.SQRT2*.5}for(var Ba=2;0<=Ba;--Ba)for(ja=c.BLKSIZE_s-1;0<=ja;--ja)Hb=Ra[Na+0][Ba][ja],Ib=Ra[Na+1][Ba][ja],Ra[Na+0][Ba][ja]=(Hb+Ib)*aa.SQRT2*.5,Ra[Na+1][Ba][ja]=(Hb-Ib)*aa.SQRT2*.5}Ha[0]=La[kb+0][0];Ha[0]*=Ha[0];for(ja=c.BLKSIZE/2-1;0<=ja;--ja){var fc=La[kb+0][c.BLKSIZE/2-ja],tb=La[kb+0][c.BLKSIZE/2+ja];Ha[c.BLKSIZE/2-ja]=.5*(fc*fc+tb*tb)}for(Ba=2;0<=Ba;--Ba)for(Gb[Ba][0]=Ra[Na+0][Ba][0],Gb[Ba][0]*=Gb[Ba][0],ja=c.BLKSIZE_s/ +2-1;0<=ja;--ja)fc=Ra[Na+0][Ba][c.BLKSIZE_s/2-ja],tb=Ra[Na+0][Ba][c.BLKSIZE_s/2+ja],Gb[Ba][c.BLKSIZE_s/2-ja]=.5*(fc*fc+tb*tb);var oa=0;for(ja=11;jaAa&&(Va.loudness_sq[cb][Aa]=Va.loudness_sq_save[Aa],Va.loudness_sq_save[Aa]=u(Ha,Va));b(x,za,A,sa,Fa);v(x,sa,Fa,ma);for(L= +0;3>L;L++){var ea=void 0,Ab=void 0,Bb=Wb,Sa=I,Za=C,ub=z,zb=L,Ja=a.internal_flags;for(ea=Ab=0;eafb;fb++)Sb=fa.thm[0].s[Ca][fb],Eb=fa.thm[1].s[Ca][fb],fa.thm[0].s[Ca][fb]+=Eb*xb,fa.thm[1].s[Ca][fb]+=Sb*xb}}if(a.mode==la.JOINT_STEREO){for(var Oa,ka=0;ka1.58*x.thm[1].l[ka]||x.thm[1].l[ka]>1.58* +x.thm[0].l[ka])){var Ua=x.mld_l[ka]*x.en[3].l[ka],gb=Math.max(x.thm[2].l[ka],Math.min(x.thm[3].l[ka],Ua));Ua=x.mld_l[ka]*x.en[2].l[ka];var gc=Math.max(x.thm[3].l[ka],Math.min(x.thm[2].l[ka],Ua));x.thm[2].l[ka]=gb;x.thm[3].l[ka]=gc}for(ka=0;kaua;ua++)x.thm[0].s[ka][ua]>1.58*x.thm[1].s[ka][ua]||x.thm[1].s[ka][ua]>1.58*x.thm[0].s[ka][ua]||(Ua=x.mld_s[ka]*x.en[3].s[ka][ua],gb=Math.max(x.thm[2].s[ka][ua],Math.min(x.thm[3].s[ka][ua],Ua)),Ua=x.mld_s[ka]*x.en[2].s[ka][ua],gc= +Math.max(x.thm[3].s[ka][ua],Math.min(x.thm[2].s[ka][ua],Ua)),x.thm[2].s[ka][ua]=gb,x.thm[3].s[ka][ua]=gc);Oa=a.msfix;if(0Da;Da++)ba=x.ATH.cb_s[x.bm_s[wa]]*Zb,Wa=Math.min(Math.max(x.thm[0].s[wa][Da],ba),Math.max(x.thm[1].s[wa][Da],ba)),ab=Math.max(x.thm[2].s[wa][Da],ba),mb=Math.max(x.thm[3].s[wa][Da],ba),Wa*KbM;M++){var Y;var ha=firbuf[T+M+10];for(var U=Y=0;9>U;U+=2)ha+=F[U]*(firbuf[T+M+U]+firbuf[T+M+21-U]),Y+=F[U+1]*(firbuf[T+M+U+1]+firbuf[T+M+21-U-1]);Z[R][M]=ha+Y}l[g][R].en.assign(G.en[R]); +l[g][R].thm.assign(G.thm[R]);2M;M++)ya[M]=G.nsPsy.last_en_subshort[R][M+6],da[M]=ya[M]/G.nsPsy.last_en_subshort[R][M+4],qa[0]+=ya[M];for(M=0;9>M;M++){for(var Xa=sa+64,Ya=1;saya[M+3-2]?Ya/ya[M+3-2]:ya[M+3-2]>10*Ya?ya[M+3-2]/(10*Ya):0;da[M+3]=Ya}for(M=0;3>M;++M){var Ia=ya[3*M+3]+ya[3*M+4]+ya[3*M+5],Wb=1;6*ya[3*M+5]M;M++)xaM;M++)0==L[R][M/3]&&da[M]>Fa&&(L[R][M/3]=M%3+1);for(M=1;4>M;M++){var Qb=qa[M-1],Ga=qa[M];4E4>Math.max(Qb,Ga)&&Qb< +1.7*Ga&&Ga<1.7*Qb&&(1==M&&L[R][0]<=L[R][M]&&(L[R][0]=0),L[R][M]=0)}L[R][0]<=G.nsPsy.lastAttacks[R]&&(L[R][0]=0);if(3==G.nsPsy.lastAttacks[R]||0!=L[R][0]+L[R][1]+L[R][2]+L[R][3])na=0,0!=L[R][1]&&0!=L[R][0]&&(L[R][1]=0),0!=L[R][2]&&0!=L[R][1]&&(L[R][2]=0),0!=L[R][3]&&0!=L[R][2]&&(L[R][3]=0);2>R?H[R]=na:0==na&&(H[0]=H[1]=0);y[R]=G.tot_ener[R]}var qb=d.internal_flags;d.short_blocks!=ra.short_block_coupled||0!=H[0]&&0!=H[1]||(H[0]=H[1]=0);for(var Ma=0;MaLa)q.fft_long(Aa,Na[cb],La,h,e);else if(2==La)for(var va=c.BLKSIZE-1;0<=va;--va){var rb=Na[cb+0][va],Va=Na[cb+1][va];Na[cb+0][va]=(rb+Va)*aa.SQRT2*.5;Na[cb+1][va]=(rb-Va)*aa.SQRT2*.5}Ra[0]=Na[cb+0][0];Ra[0]*=Ra[0];for(va=c.BLKSIZE/2-1;0<=va;--va){var ja=Na[cb+0][c.BLKSIZE/2-va],Hb=Na[cb+0][c.BLKSIZE/2+va];Ra[c.BLKSIZE/2-va]=.5*(ja*ja+Hb*Hb)}var Ib= +0;for(va=11;vaBa&&(tb.loudness_sq[g][Ba]=tb.loudness_sq_save[Ba],tb.loudness_sq_save[Ba]=u(zb,tb));if(0!=H[Ha]){var oa=void 0,ea=r,Ab=I,Bb=S[P],Sa=D[P],Za=P,ub=K(c.CBANDS),sb=K(c.CBANDS),Ja=X(c.CBANDS+2);b(ea,Ab,Bb,ub,sb);v(ea,ub, +sb,Ja);var Rb=0;for(oa=0;oa=Yb&&(Yb=$a);0>=eb&&(eb=$a); +wb=ea.blocktype_old[Za&1]==c.NORM_TYPE?Math.min(eb,Yb):eb;Sa[oa]=Math.min($a,wb)}ea.nb_2[Za][oa]=ea.nb_1[Za][oa];ea.nb_1[Za][oa]=$a;vb=ub[oa];vb*=ea.minval_l[oa];vb*=Ta;Sa[oa]>vb&&(Sa[oa]=vb);1Bb[oa]&&(Sa[oa]=Bb[oa]);1>ea.masking_lower&&(Sa[oa]*=ea.masking_lower)}for(;oafa;fa++){for(P=0;Pfb&&q.fft_short(gc,Ua[gb],fb,h,e);if(2==fb)for(var ua=c.BLKSIZE_s-1;0<=ua;--ua){var Kb=Ua[gb+0][Oa][ua],hc=Ua[gb+1][Oa][ua];Ua[gb+0][Oa][ua]=(Kb+hc)*aa.SQRT2*.5; +Ua[gb+1][Oa][ua]=(Kb-hc)*aa.SQRT2*.5}ka[Oa][0]=Ua[gb+0][Oa][0];ka[Oa][0]*=ka[Oa][0];for(ua=c.BLKSIZE_s/2-1;0<=ua;--ua){var Zb=Ua[gb+0][Oa][c.BLKSIZE_s/2-ua],wa=Ua[gb+0][Oa][c.BLKSIZE_s/2+ua];ka[Oa][c.BLKSIZE_s/2-ua]=.5*(Zb*Zb+wa*wa)}var ba=void 0,Wa=void 0,ab=void 0,mb=C,hb=S[P],Da=D[P],ib=P,Ka=fa,Ea=d.internal_flags,Lb=new float[c.CBANDS],Tb=K(c.CBANDS),Fb=new int[c.CBANDS];for(ba=Wa=0;baac&&(ob=ac);$b[pa]=ob}else $b[pa]=0;for(pa=1;paac&&(ob=ac),$b[pa]=ob):$b[pa]=0;Pa=Ub[pa-1]+Ub[pa];0ac&&(ob=ac),$b[pa]=ob):$b[pa]=0;for(Wa=ba=0;babc&&(Da[ba]=bc);1hb[ba]&&(Da[ba]=hb[ba]);1>Ea.masking_lower&&(Da[ba]*=Ea.masking_lower)}for(;bafa;fa++){var jb=r.thm[P].s[Vb][fa];jb*=.8;if(2<=L[P][fa]||1==L[P][fa+1]){var jc=0!=fa?fa-1:2,kc=B(r.thm[P].s[Vb][jc],jb,.36);jb=Math.min(jb,kc)}else if(1==L[P][fa])jc=0!=fa?fa-1:2,kc=B(r.thm[P].s[Vb][jc],jb,.18),jb=Math.min(jb,kc);else if(0!=fa&&3==L[P][fa-1]||0==fa&&3==r.nsPsy.lastAttacks[P])jc=2!=fa?fa+1:0,kc=B(r.thm[P].s[Vb][jc],jb,.18),jb=Math.min(jb,kc);jb*=O[P][fa];vc[fa]=jb}for(fa=0;3>fa;fa++)r.thm[P].s[Vb][fa]=vc[fa]}for(P=0;Pf;++f){for(var v=0;vv;++v){for(z=0;zv;v++)b.nsPsy.last_en_subshort[f][v]=10}b.loudness_sq_save[0]=b.loudness_sq_save[1]=0;b.npart_l=e(b.numlines_l,b.bo_l,b.bm_l,n,u,b.mld_l,b.PSY.bo_l_weight,w,c.BLKSIZE,b.scalefac_band.l, +c.BLKSIZE/1152,c.SBMAX_l);for(f=0;f=g&&(z=m*(n[f]-g)/(24-g)+k*(24-n[f])/(24-g)),A[f]=Math.pow(10,z/10),b.rnumlines_l[f]=0k&&(m=k);b.ATH.cb_l[f]=m;m=-20+20*n[f]/10;6m&&(m=-15);m-=8;b.minval_l[f]=Math.pow(10,m/10)*b.numlines_l[f]}b.npart_s= +e(b.numlines_s,b.bo_s,b.bm_s,n,u,b.mld_s,b.PSY.bo_s_weight,w,c.BLKSIZE_s,b.scalefac_band.s,c.BLKSIZE_s/384,c.SBMAX_s);for(f=v=0;f=g&&(z=y*(n[f]-g)/(24-g)+x*(24-n[f])/(24-g));A[f]=Math.pow(10,z/10);m=Ma.MAX_VALUE;for(z=0;zk&&(m=k);b.ATH.cb_s[f]=m;m=-7+7*n[f]/12;12n[f]&&(m*=1+2.3*Math.log(1-m));-15>m&&(m=-15);m-=8;b.minval_s[f]= +Math.pow(10,m/10)*b.numlines_s[f]}b.s3_ss=l(b.s3ind_s,b.npart_s,n,u,A,h);p=Math.pow(10,.5625);r=Math.pow(10,1.5);t=Math.pow(10,1.5);q.init_fft(b);b.decay=Math.exp(-2.302585092994046/(.01*w/192));f=3.5;0!=(a.exp_nspsytune&2)&&(f=1);0b.npart_l-1&&(b.s3ind[h][1]=b.npart_l-1);b.ATH.decay=Math.pow(10,576*b.mode_gr/w*-1.2);b.ATH.adjust=.01;b.ATH.adjustLimit=1;if(-1!=a.ATHtype){v=a.out_samplerate/c.BLKSIZE;for(f=k=h=0;f=a?1:Math.cos(Math.PI/2*a)}function E(a,b){switch(a){case 44100:return b.version= +1,0;case 48E3:return b.version=1;case 32E3:return b.version=1,2;case 22050:return b.version=0;case 24E3:return b.version=0,1;case 16E3:return b.version=0,2;case 11025:return b.version=0;case 12E3:return b.version=0,1;case 8E3:return b.version=0,2;default:return b.version=0,-1}}function B(a,b,d){16E3>d&&(b=2);d=w.bitrate_table[b][1];for(var c=2;14>=c;c++)0d&&(b=2);for(d= +0;14>=d;d++)if(0t)return t;n+=t;x+=t;u[0]=g;u[1]=k;if(qa.NEQ(f.scale,0)&&qa.NEQ(f.scale,1))for(t=0;tH.resample_ratio||1.0001da.BPC&&(sa= +da.BPC);var ra=1E-4>Math.abs(ca.resample_ratio-Math.floor(.5+ca.resample_ratio))?1:0;var R=1/ca.resample_ratio;1xa&&(xa=0);1Math.abs(Ma)?Qa/Math.PI:xa*Math.sin(na*Qa*Ma)/(Math.PI*na*Ma)}for(N=0;N<=na;N++)ca.blackfilt[ia][N]/=M}ca.fill_buffer_resample_init=1}M=ca.inbuf_old[la];for(R=0;R=aa)break;za=N-ca.itime[la]-(ia+na%2*.5);za=0|Math.floor(2*za*sa+sa+.5);for(N=Fa=0;N<=na;++N)Ia=0|N+ia-na/2,Fa+=(0>Ia?M[ra+Ia]:W[X+Ia])*ca.blackfilt[za][N];V[T+R]=Fa}ha.num_used=Math.min(aa,na+ia-na/2);ca.itime[la]+=ha.num_used- +R*ca.resample_ratio;if(ha.num_used>=ra)for(N=0;Nh.mf_samples_to_encode&&(h.mf_samples_to_encode=c.ENCDELAY+c.POSTDELAY);h.mf_samples_to_encode+=t;if(h.mf_size>=g){w=r-x;0==r&&(w=0);t=f;w=e.enc.lame_encode_mp3_frame(t,y[0],y[1],q,n,w);t.frameNum++;t=w;if(0>t)return t;n+=t;x+=t;h.mf_size-=f.framesize;h.mf_samples_to_encode-=f.framesize;for(w=0;wh;h++)if(Math.max(a,b[h+1])!=a){d=b[h+1];c=h+1;f=b[h];e=h;break}return d-a>a-f?e:c};this.lame_init_params=function(a){var b=a.internal_flags;b.Class_ID=0;null==b.ATH&&(b.ATH=new Cc);null==b.PSY&&(b.PSY=new u);null==b.rgdata&&(b.rgdata=new Ac);b.channels_in=a.num_channels; +1==b.channels_in&&(a.mode=la.MONO);b.channels_out=a.mode==la.MONO?1:2;b.mode_ext=c.MPG_MD_MS_LR;a.mode==la.MONO&&(a.force_ms=!1);a.VBR==G.vbr_off&&128!=a.VBR_mean_bitrate_kbps&&0==a.brate&&(a.brate=a.VBR_mean_bitrate_kbps);a.VBR!=G.vbr_off&&a.VBR!=G.vbr_mtrh&&a.VBR!=G.vbr_mt&&(a.free_format=!1);a.VBR==G.vbr_off&&0==a.brate&&qa.EQ(a.compression_ratio,0)&&(a.compression_ratio=11.025);a.VBR==G.vbr_off&&0a.out_samplerate?(a.VBR_mean_bitrate_kbps=Math.max(a.VBR_mean_bitrate_kbps,8),a.VBR_mean_bitrate_kbps=Math.min(a.VBR_mean_bitrate_kbps,64)):32E3>a.out_samplerate?(a.VBR_mean_bitrate_kbps=Math.max(a.VBR_mean_bitrate_kbps,8),a.VBR_mean_bitrate_kbps=Math.min(a.VBR_mean_bitrate_kbps,160)):(a.VBR_mean_bitrate_kbps= +Math.max(a.VBR_mean_bitrate_kbps,32),a.VBR_mean_bitrate_kbps=Math.min(a.VBR_mean_bitrate_kbps,320)));if(0==a.lowpassfreq){switch(a.VBR){case G.vbr_off:var e=new k;f(e,a.brate);e=e.lowerlimit;break;case G.vbr_abr:e=new k;f(e,a.VBR_mean_bitrate_kbps);e=e.lowerlimit;break;case G.vbr_rh:var h=[19500,19E3,18600,18E3,17500,16E3,15600,14900,12500,1E4,3950];if(0<=a.VBR_q&&9>=a.VBR_q){e=h[a.VBR_q];h=h[a.VBR_q+1];var m=a.VBR_q_frac;e=linear_int(e,h,m)}else e=19500;break;default:h=[19500,19E3,18500,18E3,17500, +16500,15500,14500,12500,9500,3950],0<=a.VBR_q&&9>=a.VBR_q?(e=h[a.VBR_q],h=h[a.VBR_q+1],m=a.VBR_q_frac,e=linear_int(e,h,m)):e=19500}a.mode!=la.MONO||a.VBR!=G.vbr_off&&a.VBR!=G.vbr_abr||(e*=1.5);a.lowpassfreq=e|0}0==a.out_samplerate&&(2*a.lowpassfreq>a.in_samplerate&&(a.lowpassfreq=a.in_samplerate/2),e=a.lowpassfreq|0,h=a.in_samplerate,m=44100,48E3<=h?m=48E3:44100<=h?m=44100:32E3<=h?m=32E3:24E3<=h?m=24E3:22050<=h?m=22050:16E3<=h?m=16E3:12E3<=h?m=12E3:11025<=h?m=11025:8E3<=h&&(m=8E3),-1==e?e=m:(15960>= +e&&(m=44100),15250>=e&&(m=32E3),11220>=e&&(m=24E3),9970>=e&&(m=22050),7230>=e&&(m=16E3),5420>=e&&(m=12E3),4510>=e&&(m=11025),3970>=e&&(m=8E3),e=h=a.out_samplerate?1:2;a.framesize=576*b.mode_gr;a.encoder_delay=c.ENCDELAY;b.resample_ratio=a.in_samplerate/a.out_samplerate;switch(a.VBR){case G.vbr_mt:case G.vbr_rh:case G.vbr_mtrh:a.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][a.VBR_q];break;case G.vbr_abr:a.compression_ratio=16*a.out_samplerate*b.channels_out/(1E3*a.VBR_mean_bitrate_kbps);break;default:a.compression_ratio=16*a.out_samplerate*b.channels_out/(1E3*a.brate)}a.mode==la.NOT_SET&&(a.mode=la.JOINT_STEREO);0b.lowpass1&&(b.lowpass1=0)):b.lowpass1=2*a.lowpassfreq,b.lowpass1/=a.out_samplerate,b.lowpass2/=a.out_samplerate):(b.lowpass1=0,b.lowpass2=0);e=a.internal_flags;var n=32,v=-1;if(0=h;h++)m=h/31,m>=e.lowpass2&&(n=Math.min(n,h)),e.lowpass1=h;h++)m=h/31,m<=e.highpass1&&(v=Math.max(v,h)),e.highpass1h;h++)m=h/31,v=e.highpass2>e.highpass1?V((e.highpass2-m)/(e.highpass2-e.highpass1+1E-20)):1,m=e.lowpass2>e.lowpass1?V((m-e.lowpass1)/(e.lowpass2-e.lowpass1+1E-20)):1,e.amp_filter[h]=v*m;b.samplerate_index=E(a.out_samplerate,a);if(0>b.samplerate_index)return a.internal_flags=null,-1;if(a.VBR==G.vbr_off)if(a.free_format)b.bitrate_index=0;else{if(a.brate=B(a.brate,a.version,a.out_samplerate),b.bitrate_index=U(a.brate,a.version,a.out_samplerate),0>=b.bitrate_index)return a.internal_flags=null,-1}else b.bitrate_index= +1;a.analysis&&(a.bWriteVbrTag=!1);null!=b.pinfo&&(a.bWriteVbrTag=!1);d.init_bit_stream_w(b);e=b.samplerate_index+3*a.version+6*(16E3>a.out_samplerate?1:0);for(h=0;he;e++)b.nsPsy.pefirbuf[e]=700* +b.mode_gr*b.channels_out;-1==a.ATHtype&&(a.ATHtype=4);switch(a.VBR){case G.vbr_mt:a.VBR=G.vbr_mtrh;case G.vbr_mtrh:null==a.useTemporal&&(a.useTemporal=!1);g.apply_preset(a,500-10*a.VBR_q,0);0>a.quality&&(a.quality=LAME_DEFAULT_QUALITY);5>a.quality&&(a.quality=0);5a.quality&&(a.quality=LAME_DEFAULT_QUALITY);b.iteration_loop=new VBROldIterationLoop(D);break;default:b.sfb21_extra=!1,0>a.quality&&(a.quality=LAME_DEFAULT_QUALITY),e=a.VBR,e==G.vbr_off&&(a.VBR_mean_bitrate_kbps=a.brate),g.apply_preset(a,a.VBR_mean_bitrate_kbps,0),a.VBR=e,b.PSY.mask_adjust=a.maskingadjust,b.PSY.mask_adjust_short= +a.maskingadjust_short,b.iteration_loop=e==G.vbr_off?new Bc(D):new ABRIterationLoop(D)}if(a.VBR!=G.vbr_off){b.VBR_min_bitrate=1;b.VBR_max_bitrate=14;16E3>a.out_samplerate&&(b.VBR_max_bitrate=8);if(0!=a.VBR_min_bitrate_kbps&&(a.VBR_min_bitrate_kbps=B(a.VBR_min_bitrate_kbps,a.version,a.out_samplerate),b.VBR_min_bitrate=U(a.VBR_min_bitrate_kbps,a.version,a.out_samplerate),0>b.VBR_min_bitrate)||0!=a.VBR_max_bitrate_kbps&&(a.VBR_max_bitrate_kbps=B(a.VBR_max_bitrate_kbps,a.version,a.out_samplerate),b.VBR_max_bitrate= +U(a.VBR_max_bitrate_kbps,a.version,a.out_samplerate),0>b.VBR_max_bitrate))return-1;a.VBR_min_bitrate_kbps=w.bitrate_table[a.version][b.VBR_min_bitrate];a.VBR_max_bitrate_kbps=w.bitrate_table[a.version][b.VBR_max_bitrate];a.VBR_mean_bitrate_kbps=Math.min(w.bitrate_table[a.version][b.VBR_max_bitrate],a.VBR_mean_bitrate_kbps);a.VBR_mean_bitrate_kbps=Math.max(w.bitrate_table[a.version][b.VBR_min_bitrate],a.VBR_mean_bitrate_kbps)}a.tune&&(b.PSY.mask_adjust+=a.tune_value_a,b.PSY.mask_adjust_short+=a.tune_value_a); +e=a.internal_flags;switch(a.quality){default:case 9:e.psymodel=0;e.noise_shaping=0;e.noise_shaping_amp=0;e.noise_shaping_stop=0;e.use_best_huffman=0;e.full_outer_loop=0;break;case 8:a.quality=7;case 7:e.psymodel=1;e.noise_shaping=0;e.noise_shaping_amp=0;e.noise_shaping_stop=0;e.use_best_huffman=0;e.full_outer_loop=0;break;case 6:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);e.noise_shaping_amp=0;e.noise_shaping_stop=0;-1==e.subblock_gain&&(e.subblock_gain=1);e.use_best_huffman=0;e.full_outer_loop= +0;break;case 5:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);e.noise_shaping_amp=0;e.noise_shaping_stop=0;-1==e.subblock_gain&&(e.subblock_gain=1);e.use_best_huffman=0;e.full_outer_loop=0;break;case 4:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);e.noise_shaping_amp=0;e.noise_shaping_stop=0;-1==e.subblock_gain&&(e.subblock_gain=1);e.use_best_huffman=1;e.full_outer_loop=0;break;case 3:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);e.noise_shaping_amp=1;e.noise_shaping_stop=1;-1== +e.subblock_gain&&(e.subblock_gain=1);e.use_best_huffman=1;e.full_outer_loop=0;break;case 2:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);0==e.substep_shaping&&(e.substep_shaping=2);e.noise_shaping_amp=1;e.noise_shaping_stop=1;-1==e.subblock_gain&&(e.subblock_gain=1);e.use_best_huffman=1;e.full_outer_loop=0;break;case 1:e.psymodel=1;0==e.noise_shaping&&(e.noise_shaping=1);0==e.substep_shaping&&(e.substep_shaping=2);e.noise_shaping_amp=2;e.noise_shaping_stop=1;-1==e.subblock_gain&&(e.subblock_gain= +1);e.use_best_huffman=1;e.full_outer_loop=0;break;case 0:e.psymodel=1,0==e.noise_shaping&&(e.noise_shaping=1),0==e.substep_shaping&&(e.substep_shaping=2),e.noise_shaping_amp=2,e.noise_shaping_stop=1,-1==e.subblock_gain&&(e.subblock_gain=1),e.use_best_huffman=1,e.full_outer_loop=0}b.ATH.useAdjust=0>a.athaa_type?3:a.athaa_type;b.ATH.aaSensitivityP=Math.pow(10,a.athaa_sensitivity/-10);null==a.short_blocks&&(a.short_blocks=ra.short_block_allowed);a.short_blocks!=ra.short_block_allowed||a.mode!=la.JOINT_STEREO&& +a.mode!=la.STEREO||(a.short_blocks=ra.short_block_coupled);0>a.quant_comp&&(a.quant_comp=1);0>a.quant_comp_short&&(a.quant_comp_short=0);0>a.msfix&&(a.msfix=0);a.exp_nspsytune|=1;0>a.internal_flags.nsPsy.attackthre&&(a.internal_flags.nsPsy.attackthre=Pb.NSATTACKTHRE);0>a.internal_flags.nsPsy.attackthre_s&&(a.internal_flags.nsPsy.attackthre_s=Pb.NSATTACKTHRE_S);0>a.scale&&(a.scale=1);0>a.ATHtype&&(a.ATHtype=4);0>a.ATHcurve&&(a.ATHcurve=4);0>a.athaa_loudapprox&&(a.athaa_loudapprox=2);0>a.interChRatio&& +(a.interChRatio=0);null==a.useTemporal&&(a.useTemporal=!0);b.slot_lag=b.frac_SpF=0;a.VBR==G.vbr_off&&(b.slot_lag=b.frac_SpF=72E3*(a.version+1)*a.brate%a.out_samplerate|0);q.iteration_init(a);p.psymodel_init(a);return 0};this.lame_encode_flush=function(a,e,f,g){var k=a.internal_flags,l=dc([2,1152]),h=0,m=k.mf_samples_to_encode-c.POSTDELAY,p=b(a);if(1>k.mf_samples_to_encode)return 0;var n=0;a.in_samplerate!=a.out_samplerate&&(m+=16*a.out_samplerate/a.in_samplerate);var q=a.framesize-m%a.framesize;576> +q&&(q+=a.framesize);a.encoder_padding=q;for(q=(m+q)/a.framesize;0r&&(r=1);h=g-n;0==g&&(h=0);h=this.lame_encode_buffer(a,l[0],l[1],r,e,f,h);f+=h;n+=h;q-=m!=a.frameNum?1:0}k.mf_samples_to_encode=0;if(0>h)return h;h=g-n;0==g&&(h=0);d.flush_bitstream(a);h=d.copy_buffer(k,e,f,h,1);if(0>h)return h;f+=h;n+=h;h=g-n;0==g&&(h=0);if(a.write_id3tag_automatic){t.id3tag_write_v1(a);h=d.copy_buffer(k,e,f,h,0);if(0> +h)return h;n+=h}return n};this.lame_encode_buffer=function(a,b,d,c,e,f,g){var h=a.internal_flags,k=[null,null];if(4294479419!=h.Class_ID)return-3;if(0==c)return 0;if(null==h.in_buffer_0||h.in_buffer_nsamplesMath.abs(k)?Math.abs(c-k)<=1E-6*Math.abs(c):Math.abs(c-k)<=1E-6*Math.abs(k)};qa.NEQ=function(c,k){return!qa.EQ(c,k)};zb.NUMTOCENTRIES=100;zb.MAXFRAMESIZE=2880; +var w={t1HB:[1,1,1,0],t2HB:[1,2,1,3,1,1,3,2,0],t3HB:[3,2,1,1,1,1,3,2,0],t5HB:[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],t6HB:[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],t7HB:[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],t8HB:[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],t9HB:[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],t10HB:[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34, +46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],t11HB:[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],t12HB:[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],t13HB:[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19, +3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51, +36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],t15HB:[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40, +38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],t16HB:[1,5,14,44,74,63, +110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73, +141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],t24HB:[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216, +209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289, +275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],t32HB:[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],t33HB:[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],t1l:[1,4,3,5],t2l:[1,4, +7,4,5,7,6,7,8],t3l:[2,3,7,4,4,7,6,7,8],t5l:[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],t6l:[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],t7l:[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],t8l:[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],t9l:[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],t10l:[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12, +12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],t11l:[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],t12l:[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],t13l:[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11, +12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14, +14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],t15l:[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10, +11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],t16_5l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12, +12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14, +14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],t16l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14, +15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],t24l:[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8, +9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12, +12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],t32l:[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],t33l:[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]};w.ht=[new U(0,0,null,null),new U(2,0,w.t1HB,w.t1l),new U(3,0,w.t2HB,w.t2l),new U(3,0,w.t3HB,w.t3l),new U(0,0,null,null),new U(4,0,w.t5HB,w.t5l),new U(4,0,w.t6HB,w.t6l),new U(6,0,w.t7HB,w.t7l),new U(6,0,w.t8HB,w.t8l),new U(6,0,w.t9HB,w.t9l),new U(8, +0,w.t10HB,w.t10l),new U(8,0,w.t11HB,w.t11l),new U(8,0,w.t12HB,w.t12l),new U(16,0,w.t13HB,w.t13l),new U(0,0,null,w.t16_5l),new U(16,0,w.t15HB,w.t15l),new U(1,1,w.t16HB,w.t16l),new U(2,3,w.t16HB,w.t16l),new U(3,7,w.t16HB,w.t16l),new U(4,15,w.t16HB,w.t16l),new U(6,63,w.t16HB,w.t16l),new U(8,255,w.t16HB,w.t16l),new U(10,1023,w.t16HB,w.t16l),new U(13,8191,w.t16HB,w.t16l),new U(4,15,w.t24HB,w.t24l),new U(5,31,w.t24HB,w.t24l),new U(6,63,w.t24HB,w.t24l),new U(7,127,w.t24HB,w.t24l),new U(8,255,w.t24HB,w.t24l), +new U(9,511,w.t24HB,w.t24l),new U(11,2047,w.t24HB,w.t24l),new U(13,8191,w.t24HB,w.t24l),new U(0,0,w.t32HB,w.t32l),new U(0,0,w.t33HB,w.t33l)];w.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832, +655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052, +983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589, +851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366];w.table23=[65538,262147, +458759,262148,327684,458759,393222,458759,524296];w.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369];w.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]];w.samplerate_table=[[22050,24E3,16E3,-1],[44100,48E3,32E3,-1],[11025,12E3,8E3,-1]];w.scfsi_band=[0,6,11,16,21];ia.Q_MAX=257;ia.Q_MAX2=116;ia.LARGE_BITS=1E5; +ia.IXMAX_VAL=8206;var sa={};sa.SFBMAX=3*c.SBMAX_s;c.ENCDELAY=576;c.POSTDELAY=1152;c.MDCTDELAY=48;c.FFTOFFSET=224+c.MDCTDELAY;c.DECDELAY=528;c.SBLIMIT=32;c.CBANDS=64;c.SBPSY_l=21;c.SBPSY_s=12;c.SBMAX_l=22;c.SBMAX_s=13;c.PSFB21=6;c.PSFB12=6;c.BLKSIZE=1024;c.HBLKSIZE=c.BLKSIZE/2+1;c.BLKSIZE_s=256;c.HBLKSIZE_s=c.BLKSIZE_s/2+1;c.NORM_TYPE=0;c.START_TYPE=1;c.SHORT_TYPE=2;c.STOP_TYPE=3;c.MPG_MD_LR_LR=0;c.MPG_MD_LR_I=1;c.MPG_MD_MS_LR=2;c.MPG_MD_MS_I=3;c.fircoef=[-.1039435,-.1892065,-.0432472*5,-.155915,3.898045E-17, +.0467745*5,.50455,.756825,.187098*5];da.MFSIZE=3456+c.ENCDELAY-c.MDCTDELAY;da.MAX_HEADER_BUF=256;da.MAX_BITS_PER_CHANNEL=4095;da.MAX_BITS_PER_GRANULE=7680;da.BPC=320;Fa.RIFF=cc("RIFF");Fa.WAVE=cc("WAVE");Fa.fmt_=cc("fmt ");Fa.data=cc("data");Fa.readHeader=function(c){var k=new Fa,n=c.getUint32(0,!1);if(Fa.RIFF==n&&(c.getUint32(4,!0),Fa.WAVE==c.getUint32(8,!1)&&Fa.fmt_==c.getUint32(12,!1))){var u=c.getUint32(16,!0),w=20;switch(u){case 16:case 18:k.channels=c.getUint16(w+2,!0);k.sampleRate=c.getUint32(w+ +4,!0);break;default:throw"extended fmt chunk not implemented";}w+=u;u=Fa.data;for(var B=0;u!=n;){n=c.getUint32(w,!1);B=c.getUint32(w+4,!0);if(u==n)break;w+=B+8}k.dataLen=B;k.dataOffset=w+8;return k}};sa.SFBMAX=3*c.SBMAX_s;lamejs.Mp3Encoder=function(c,k,n){3!=arguments.length&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),c=1,k=44100,n=128);var u=new W,w=new Kc,B=new Y,G=new qa,f=new wc,b=new ia,v=new Ec,a=new zb,m=new mc,z=new Nc,e=new xc,l=new qb,d=new Lc,g=new Mc; +u.setModules(B,G,f,b,v,a,m,z,g);G.setModules(B,g,m,a);z.setModules(G,m);f.setModules(u);v.setModules(G,e,b,l);b.setModules(l,e,u.enc.psy);e.setModules(G);l.setModules(b);a.setModules(u,G,m);w.setModules(d,g);d.setModules(m,z,f);var q=u.lame_init();q.num_channels=c;q.in_samplerate=k;q.brate=n;q.mode=la.STEREO;q.quality=3;q.bWriteVbrTag=!1;q.disable_reservoir=!0;q.write_id3tag_automatic=!1;u.lame_init_params(q);var D=1152,p=0|1.25*D+7200,r=new Int8Array(p);this.encodeBuffer=function(a,b){1==c&&(b=a); +a.length>D&&(D=a.length,p=0|1.25*D+7200,r=new Int8Array(p));a=u.lame_encode_buffer(q,a,b,a.length,r,0,p);return new Int8Array(r.subarray(0,a))};this.flush=function(){var a=u.lame_encode_flush(q,r,0,p);return new Int8Array(r.subarray(0,a))}};lamejs.WavHeader=Fa}lamejs(); diff --git a/public/assets/worker/decode.worker.js b/public/assets/worker/decode.worker.js new file mode 100644 index 0000000..f5c82d0 --- /dev/null +++ b/public/assets/worker/decode.worker.js @@ -0,0 +1 @@ +function decodeFrameImage(e,a){const{url:t,startTime:s=0,duration:r,noAudioTracks:o,aspectRatio:l=1,frameScale:n=1,videoRotation:d=0}=e,f=e.frameHeight*n,i=f*l;self.frames={},self.canvas=a;const c=debounce(()=>{self.drawIndex=0,self.frameIndex=0,self.canvas.convertToBlob({type:"image/jpeg",quality:.7}).then(e=>{self.postMessage({type:"drawFrameImageSuccess",data:{url:URL.createObjectURL(e),rotate:self.rotate,noAudioTracks:o}})})},500),m=new OffscreenCanvas(f,i),u=m.getContext("2d");let h=e.stepFrameDraw;self.stepFrameDrawMark=!!e.stepFrameDraw,self.decoder=new VideoDecoder({output:async a=>{if(self.frameIndex%h===0){let t=a;if(self.rotate&&(u.save(),u.translate(m.width/2,m.height/2),u.rotate(d*Math.PI/180),u.drawImage(a,-i/2,-f/2,i,f),u.restore(),t=await createImageBitmap(m)),self.stepFrameDrawMark)if(e.drawRectangle){const e=self.drawIndex%self.cavnasSizeSqrt;self.ctx.drawImage(t,e*i,Math.floor(self.drawIndex/self.cavnasSizeSqrt)*f,i,f)}else self.ctx.drawImage(t,self.drawIndex*i,0,i,f);else self.ctx.drawImage(t,self.drawIndex*i,0,i,f);self.drawIndex++}self.frames[self.frameIndex]=a,self.frameIndex++,a.close(),c()},error(e){postMessage({type:"end"})}}),new MP4Demuxer(t,{onConfig:a=>{if(a.error)postMessage({type:"end"});else{a.movie_duration=r,["hev","hvc"].includes(a.codec.substring(0,3))||(a.codec="avc1.420034"),r&&(a.movie_duration=r*a.movie_timescale),a.movie_duration||(a.movie_duration=a.nb_samples/30*a.movie_timescale),a.hasAudio?isNaN(a.hasAudio.bitrate)?self.noAudioTracks=!0:a.hasAudio.duration||(self.noAudioTracks=!0):self.noAudioTracks=!0,self.noAudioTracks&&(a.hasAudio=!1),decoder.configure(a),self.totalFrame=a.nb_samples-2,self.duration=r;const t=Number((a.codedWidth/a.codedHeight).toFixed(1))-Number(l.toFixed(1));if(self.rotate=Math.abs(t)>.5,self.fps=Math.ceil(self.totalFrame/self.duration),h||(h=self.fps),self.stepFrameDrawMark)if(e.drawRectangle){const e=Math.ceil(Math.sqrt(Math.ceil(self.totalFrame/h)));self.cavnasSizeSqrt=e,self.canvas.width=e*i,self.canvas.height=e*f}else self.canvas.width=Math.ceil(self.totalFrame/h)*i,self.canvas.height=f;else self.canvas.width=self.duration*i,self.canvas.height=f;self.ctx=self.canvas.getContext("2d"),self.drawIndex=0,self.frameIndex=0,postMessage({type:"drawFrameImageBefore",data:{noAudioTracks:self.noAudioTracks,totalFrame:self.totalFrame,duration:self.duration,startFrameIndex:self.startFrameIndex,rotate:self.rotate,frameScale:n}})}},onChunk:e=>{self.decoder.decode(e)},setStatus:(e,a)=>{}})}function removeFrame(e){for(let a in self.frames)void 0!==self.frames[a]&&Number(a)t?removeFrameAll():removeFrame(o),o>=self.totalFrame&&(removeFrameAll(),self.frames={},postMessage({type:"end"}))}function clearCanvas(){self.ctx.fillStyle="rgba(0,0,0,1)",self.ctx.fillRect(0,0,this._canvas.width,this._canvas.height)}function getFPS(e){const a=e.streams.find(e=>"video"===e.codec_type_string);let t=30;if(a&&a.r_frame_rate){const[e,s]=a.r_frame_rate.split("/").map(Number);s&&s>0&&(t=e/s)}else if(a&&a.avg_frame_rate){const[e,s]=a.avg_frame_rate.split("/").map(Number);s&&s>0&&(t=e/s)}return t}async function waittingFrame(){for(;self.waittingFrameLock;)await sleep(8);return!0}function initDecodeVideo(e,a){const{url:t,clipTime:s=0,duration:r=0,aspectRatio:o=1,rotation:l=0,noAudioTracks:n,elementId:d,returnBitmap:f,webm:i=!1}=e;self.noAudioTracks=n,self.elementId=d,self.returnBitmap=f,self.frames={},self.frameIndex=0,self.hasDrawFrameIndex=-1,a&&(self.canvas=a,self.ctx=a.getContext("2d",{alpha:!0})),i?fetch(t).then(async e=>{if(!e.ok)throw new Error(`HTTP 错误!状态:${e.status}`);const a=await e.blob();return new File([a],"video.webm",{type:a.type})}).then(async e=>{self.demuxer=new WebDemuxer({wasmFilePath:location.origin+"/worker/web-demuxer.wasm"}),await self.demuxer.load(e);const t=await demuxer.getMediaInfo(),s=getFPS(t),r=await self.demuxer.getDecoderConfig("video");let o=null;self.decoder=new VideoDecoder({output:e=>{self.ctx.clearRect(0,0,a.width,a.height);const t=Math.min(self.canvas.width/e.displayWidth,self.canvas.height/e.displayHeight);if(self.ctx.drawImage(e,0,0,e.displayWidth*t,e.displayHeight*t),!o){const e=ctx.getImageData(0,0,1,1);o=e.data}const s=ctx.getImageData(0,0,a.width,a.height),r=s.data;for(let e=0;e{}}),self.decoder.configure(r),self.totalFrame=s*t.duration,self.duration=t.duration,self.noAudioTracks=!0,self.startFrameIndex=0,self.rotate=!1,postMessage({type:"decodeMP4DemuxerSuccess"}),self.waittingFrameLock=!0;const l=demuxer.read("video",0,t.duration).getReader();l.read().then(async function e({done:a,value:t}){if(a)return void decoder.flush();await waittingFrame(),decoder.decode(t);const s=l.read().then(e);return self.waittingFrameLock=!0,s}),loop()}):(self.decoder=new VideoDecoder({output:e=>{self.frames[self.frameIndex]=e,self.frameIndex++},error(e){}}),new MP4Demuxer(t,{onConfig:e=>{if(e.error)postMessage({type:"end"});else{if(["hev","hvc"].includes(e.codec.substring(0,3))||(e.codec="avc1.420034"),self.decoder.configure(e),r&&(e.movie_duration=r*e.movie_timescale),e.movie_duration||(e.movie_duration=e.nb_samples/30*e.movie_timescale),self.totalFrame=e.nb_samples-2,self.duration=e.movie_duration/e.movie_timescale,self.noAudioTracks=n,self.startFrameIndex=Math.floor(s/self.duration*self.totalFrame),self.rotate=l%360!=0,l){const e=self.canvas.width/self.canvas.height;self.ctx.translate(self.canvas.width/2,self.canvas.height/2),self.ctx.scale(e,self.canvas.height/self.canvas.width),self.ctx.rotate(l*Math.PI/180),self.ctx.translate(-self.canvas.width/2,-self.canvas.height/2)}postMessage({type:"decodeMP4DemuxerSuccess"})}},onChunk:e=>{self.decoder.decode(e)},setStatus:async(e,a)=>{"Ready"===a&&(await decodeClipTime(),postMessage({type:"ready",data:{noAudioTracks:self.noAudioTracks,totalFrame:self.totalFrame,duration:self.duration,startFrameIndex:self.startFrameIndex,rotate:self.rotate}}))}}))}function debounce(e,a){let t=null;return function(...s){t&&clearTimeout(t),t=setTimeout(()=>{e.apply(this,s)},a)}}function sleep(e){return new Promise(a=>{setTimeout(()=>{a()},e)})}importScripts("./demuxer.worker.js"),self.addEventListener("message",e=>{switch(e.data.type){case"initDecodeVideo":initDecodeVideo(e.data.options,e.data.canvas);break;case"decodeFrameByTime":decodeFrameByTime(e.data);break;case"decodeFrameImage":decodeFrameImage(e.data.options,e.data.canvas);break;case"destroy":for(const e in self.frames)self.frames[e]&&(self.frames[e].close(),delete self.frames[e]);self.frames=null,delete self.frames,delete self.frameIndex,delete self.hasDrawFrameIndex,delete self.noAudioTracks,delete self.startFrameIndex,self.canvas&&(delete self.canvas,delete self.ctx)}}); \ No newline at end of file diff --git a/public/assets/worker/demo.worker.js b/public/assets/worker/demo.worker.js new file mode 100644 index 0000000..22885b1 --- /dev/null +++ b/public/assets/worker/demo.worker.js @@ -0,0 +1,3 @@ +self.addEventListener('message', e => { + console.log('收到消息:', e.data); +}); diff --git a/public/assets/worker/demuxer.worker.js b/public/assets/worker/demuxer.worker.js new file mode 100644 index 0000000..36f36e1 --- /dev/null +++ b/public/assets/worker/demuxer.worker.js @@ -0,0 +1 @@ +importScripts("mp4box.all.js");class MP4FileSink{#t=null;#e=null;#i=0;constructor(t,e){this.#e=t,this.#t=e}write(t){const e=new ArrayBuffer(t.byteLength);new Uint8Array(e).set(t),e.fileStart=this.#i,this.#i+=e.byteLength,this.#t("fetch",(this.#i/1048576).toFixed(1)+" MiB"),this.#e.appendBuffer(e)}close(){this.#t("fetch","Done"),this.#e.flush()}}class MP4Demuxer{#s=null;#o=null;#t=null;#e=null;get file(){return this.#e}constructor(t,{onConfig:e,onChunk:i,setStatus:s}){this.#s=e,this.#o=i,this.#t=s,this.#e=MP4Box.createFile(),this.#e.onError=t=>{s("demux",t)},this.#e.onReady=this.#n.bind(this),this.#e.onSamples=this.#a.bind(this);const o=new MP4FileSink(this.#e,s);fetch(t).then(t=>{t.body.pipeTo(new WritableStream(o,{highWaterMark:2}))})}#r(t){const e=this.#e.getTrackById(t.id);for(const t of e.mdia.minf.stbl.stsd.entries)if(t.avcC||t.hvcC){const e=new DataStream(void 0,0,DataStream.BIG_ENDIAN);return t.avcC?t.avcC.write(e):t.hvcC.write(e),new Uint8Array(e.buffer,8)}throw"avcC or hvcC not found"}#h=null;set track(t){this.#h=t}get track(){return this.#h}#n(t){this.#t("demux","Ready");const e=t.videoTracks[0],i=t.tracks.find(t=>"audio"===t.type);e?(this.#s({codec:e.codec,codedHeight:e.video.height,codedWidth:e.video.width,nb_samples:e.nb_samples,volume:e.volume,hasAudio:i,movie_timescale:e.movie_timescale,movie_duration:e.movie_duration,description:this.#r(e)}),this.#e.setExtractionOptions(e.id),this.#e.start()):this.#s({error:!0,hasAudio:i})}#a(t,e,i){for(const t of i)this.#o(new EncodedVideoChunk({type:t.is_sync?"key":"delta",timestamp:1e6*t.cts/t.timescale,duration:1e6*t.duration/t.timescale,data:t.data}))}} \ No newline at end of file diff --git a/public/assets/worker/mp4box.all.js b/public/assets/worker/mp4box.all.js new file mode 100644 index 0000000..f96d72c --- /dev/null +++ b/public/assets/worker/mp4box.all.js @@ -0,0 +1 @@ +var Log=function(){new Date;return{setLogLevel:function(t){t==this.debug?1:t==this.info?2:t==this.warn?3:(this.error,4)},debug:function(t,e){void 0===console.debug&&(console.debug=console.log)},log:function(t,e){this.debug(t.msg)},info:function(t,e){},warn:function(t,e){},error:function(t,e){}}}();Log.getDurationString=function(t,e){var i;function r(t,e){for(var i=(""+t).split(".");i[0].length0){for(var i="",r=0;r0&&(i+=","),i+="["+Log.getDurationString(t.start(r))+","+Log.getDurationString(t.end(r))+"]";return i}return"(empty)"},"undefined"!=typeof exports&&(exports.Log=Log);var MP4BoxStream=function(t){if(!(t instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=t,this.dataview=new DataView(t),this.position=0};MP4BoxStream.prototype.getPosition=function(){return this.position},MP4BoxStream.prototype.getEndPosition=function(){return this.buffer.byteLength},MP4BoxStream.prototype.getLength=function(){return this.buffer.byteLength},MP4BoxStream.prototype.seek=function(t){var e=Math.max(0,Math.min(this.buffer.byteLength,t));return this.position=isNaN(e)||!isFinite(e)?0:e,!0},MP4BoxStream.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},MP4BoxStream.prototype.readAnyInt=function(t,e){var i=0;if(this.position+t<=this.buffer.byteLength){switch(t){case 1:i=e?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:i=e?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(e)throw"No method for reading signed 24 bits values";i=this.dataview.getUint8(this.position)<<16,i|=this.dataview.getUint8(this.position+1)<<8,i|=this.dataview.getUint8(this.position+2);break;case 4:i=e?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(e)throw"No method for reading signed 64 bits values";i=this.dataview.getUint32(this.position)<<32,i|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+t}return this.position+=t,i}throw"Not enough bytes in buffer"},MP4BoxStream.prototype.readUint8=function(){return this.readAnyInt(1,!1)},MP4BoxStream.prototype.readUint16=function(){return this.readAnyInt(2,!1)},MP4BoxStream.prototype.readUint24=function(){return this.readAnyInt(3,!1)},MP4BoxStream.prototype.readUint32=function(){return this.readAnyInt(4,!1)},MP4BoxStream.prototype.readUint64=function(){return this.readAnyInt(8,!1)},MP4BoxStream.prototype.readString=function(t){if(this.position+t<=this.buffer.byteLength){for(var e="",i=0;ithis._byteLength&&(this._byteLength=e);else{for(i<1&&(i=1);e>i;)i*=2;var r=new ArrayBuffer(i),s=new Uint8Array(this._buffer);new Uint8Array(r,0,s.length).set(s),this.buffer=r,this._byteLength=e}}},DataStream.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var t=new ArrayBuffer(this._byteLength),e=new Uint8Array(t),i=new Uint8Array(this._buffer,0,e.length);e.set(i),this.buffer=t}},DataStream.BIG_ENDIAN=!1,DataStream.LITTLE_ENDIAN=!0,DataStream.prototype._byteLength=0,Object.defineProperty(DataStream.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(DataStream.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(t){this._buffer=t,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(DataStream.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(t){this._byteOffset=t,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(DataStream.prototype,"dataView",{get:function(){return this._dataView},set:function(t){this._byteOffset=t.byteOffset,this._buffer=t.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+t.byteLength}}),DataStream.prototype.seek=function(t){var e=Math.max(0,Math.min(this.byteLength,t));this.position=isNaN(e)||!isFinite(e)?0:e},DataStream.prototype.isEof=function(){return this.position>=this._byteLength},DataStream.prototype.mapUint8Array=function(t){this._realloc(1*t);var e=new Uint8Array(this._buffer,this.byteOffset+this.position,t);return this.position+=1*t,e},DataStream.prototype.readInt32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Int32Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readInt16Array=function(t,e){t=null==t?this.byteLength-this.position/2:t;var i=new Int16Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readInt8Array=function(t){t=null==t?this.byteLength-this.position:t;var e=new Int8Array(t);return DataStream.memcpy(e.buffer,0,this.buffer,this.byteOffset+this.position,t*e.BYTES_PER_ELEMENT),this.position+=e.byteLength,e},DataStream.prototype.readUint32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Uint32Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readUint16Array=function(t,e){t=null==t?this.byteLength-this.position/2:t;var i=new Uint16Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readUint8Array=function(t){t=null==t?this.byteLength-this.position:t;var e=new Uint8Array(t);return DataStream.memcpy(e.buffer,0,this.buffer,this.byteOffset+this.position,t*e.BYTES_PER_ELEMENT),this.position+=e.byteLength,e},DataStream.prototype.readFloat64Array=function(t,e){t=null==t?this.byteLength-this.position/8:t;var i=new Float64Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readFloat32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Float32Array(t);return DataStream.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},DataStream.prototype.readInt32=function(t){var e=this._dataView.getInt32(this.position,null==t?this.endianness:t);return this.position+=4,e},DataStream.prototype.readInt16=function(t){var e=this._dataView.getInt16(this.position,null==t?this.endianness:t);return this.position+=2,e},DataStream.prototype.readInt8=function(){var t=this._dataView.getInt8(this.position);return this.position+=1,t},DataStream.prototype.readUint32=function(t){var e=this._dataView.getUint32(this.position,null==t?this.endianness:t);return this.position+=4,e},DataStream.prototype.readUint16=function(t){var e=this._dataView.getUint16(this.position,null==t?this.endianness:t);return this.position+=2,e},DataStream.prototype.readUint8=function(){var t=this._dataView.getUint8(this.position);return this.position+=1,t},DataStream.prototype.readFloat32=function(t){var e=this._dataView.getFloat32(this.position,null==t?this.endianness:t);return this.position+=4,e},DataStream.prototype.readFloat64=function(t){var e=this._dataView.getFloat64(this.position,null==t?this.endianness:t);return this.position+=8,e},DataStream.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,DataStream.memcpy=function(t,e,i,r,s){var a=new Uint8Array(t,e,s),n=new Uint8Array(i,r,s);a.set(n)},DataStream.arrayToNative=function(t,e){return e==this.endianness?t:this.flipArrayEndianness(t)},DataStream.nativeToEndian=function(t,e){return this.endianness==e?t:this.flipArrayEndianness(t)},DataStream.flipArrayEndianness=function(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i=0;is;r--,s++){var a=e[s];e[s]=e[r],e[r]=a}return t},DataStream.prototype.failurePosition=0,String.fromCharCodeUint8=function(t){for(var e=[],i=0;i>16),this.writeUint8((65280&t)>>8),this.writeUint8(255&t)},DataStream.prototype.adjustUint32=function(t,e){var i=this.position;this.seek(t),this.writeUint32(e),this.seek(i)},DataStream.prototype.mapInt32Array=function(t,e){this._realloc(4*t);var i=new Int32Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i},DataStream.prototype.mapInt16Array=function(t,e){this._realloc(2*t);var i=new Int16Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=2*t,i},DataStream.prototype.mapInt8Array=function(t){this._realloc(1*t);var e=new Int8Array(this._buffer,this.byteOffset+this.position,t);return this.position+=1*t,e},DataStream.prototype.mapUint32Array=function(t,e){this._realloc(4*t);var i=new Uint32Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i},DataStream.prototype.mapUint16Array=function(t,e){this._realloc(2*t);var i=new Uint16Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=2*t,i},DataStream.prototype.mapFloat64Array=function(t,e){this._realloc(8*t);var i=new Float64Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=8*t,i},DataStream.prototype.mapFloat32Array=function(t,e){this._realloc(4*t);var i=new Float32Array(this._buffer,this.byteOffset+this.position,t);return DataStream.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i};var MultiBufferStream=function(t){this.buffers=[],this.bufferIndex=-1,t&&(this.insertBuffer(t),this.bufferIndex=0)};MultiBufferStream.prototype=new DataStream(new ArrayBuffer,0,DataStream.BIG_ENDIAN),MultiBufferStream.prototype.initialized=function(){var t;return this.bufferIndex>-1||(this.buffers.length>0?0===(t=this.buffers[0]).fileStart?(this.buffer=t,this.bufferIndex=0,Log.debug("MultiBufferStream","Stream ready for parsing"),!0):(Log.warn("MultiBufferStream","The first buffer should have a fileStart of 0"),this.logBufferLevel(),!1):(Log.warn("MultiBufferStream","No buffer to start parsing from"),this.logBufferLevel(),!1))},ArrayBuffer.concat=function(t,e){Log.debug("ArrayBuffer","Trying to create a new buffer of size: "+(t.byteLength+e.byteLength));var i=new Uint8Array(t.byteLength+e.byteLength);return i.set(new Uint8Array(t),0),i.set(new Uint8Array(e),t.byteLength),i.buffer},MultiBufferStream.prototype.reduceBuffer=function(t,e,i){var r;return(r=new Uint8Array(i)).set(new Uint8Array(t,e,i)),r.buffer.fileStart=t.fileStart+e,r.buffer.usedBytes=0,r.buffer},MultiBufferStream.prototype.insertBuffer=function(t){for(var e=!0,i=0;ir.byteLength){this.buffers.splice(i,1),i--;continue}Log.warn("MultiBufferStream","Buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+") already appended, ignoring")}else t.fileStart+t.byteLength<=r.fileStart||(t=this.reduceBuffer(t,0,r.fileStart-t.fileStart)),Log.debug("MultiBufferStream","Appending new buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+")"),this.buffers.splice(i,0,t),0===i&&(this.buffer=t);e=!1;break}if(t.fileStart0)){e=!1;break}t=this.reduceBuffer(t,s,a)}}e&&(Log.debug("MultiBufferStream","Appending new buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+")"),this.buffers.push(t),0===i&&(this.buffer=t))},MultiBufferStream.prototype.logBufferLevel=function(t){var e,i,r,s,a,n=[],o="";for(r=0,s=0,e=0;e0&&(o+=a.end-1+"]");var h=t?Log.info:Log.debug;0===this.buffers.length?h("MultiBufferStream","No more buffer in memory"):h("MultiBufferStream",this.buffers.length+" stored buffer(s) ("+r+"/"+s+" bytes), continuous ranges: "+o)},MultiBufferStream.prototype.cleanBuffers=function(){var t,e;for(t=0;t"+this.buffer.byteLength+")"),!0}return!1}return!1},MultiBufferStream.prototype.findPosition=function(t,e,i){var r,s=null,a=-1;for(r=!0===t?0:this.bufferIndex;r=e?(Log.debug("MultiBufferStream","Found position in existing buffer #"+a),a):-1},MultiBufferStream.prototype.findEndContiguousBuf=function(t){var e,i,r,s=void 0!==t?t:this.bufferIndex;if(i=this.buffers[s],this.buffers.length>s+1)for(e=s+1;e>3;return 31===r&&i.data.length>=2&&(r=32+((7&i.data[0])<<3)+((224&i.data[1])>>5)),r}return null},i.DecoderConfigDescriptor=function(t){i.Descriptor.call(this,4,t)},i.DecoderConfigDescriptor.prototype=new i.Descriptor,i.DecoderConfigDescriptor.prototype.parse=function(t){this.oti=t.readUint8(),this.streamType=t.readUint8(),this.upStream=!!(this.streamType>>1&1),this.streamType=this.streamType>>>2,this.bufferSize=t.readUint24(),this.maxBitrate=t.readUint32(),this.avgBitrate=t.readUint32(),this.size-=13,this.parseRemainingDescriptors(t)},i.DecoderSpecificInfo=function(t){i.Descriptor.call(this,5,t)},i.DecoderSpecificInfo.prototype=new i.Descriptor,i.SLConfigDescriptor=function(t){i.Descriptor.call(this,6,t)},i.SLConfigDescriptor.prototype=new i.Descriptor,this};"undefined"!=typeof exports&&(exports.MPEG4DescriptorParser=MPEG4DescriptorParser);var BoxParser={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"],["grpl"],["j2kH"],["etyp",["tyco"]]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){BoxParser.FullBox.prototype=new BoxParser.Box,BoxParser.ContainerBox.prototype=new BoxParser.Box,BoxParser.SampleEntry.prototype=new BoxParser.Box,BoxParser.TrackGroupTypeBox.prototype=new BoxParser.FullBox,BoxParser.BASIC_BOXES.forEach(function(t){BoxParser.createBoxCtor(t)}),BoxParser.FULL_BOXES.forEach(function(t){BoxParser.createFullBoxCtor(t)}),BoxParser.CONTAINER_BOXES.forEach(function(t){BoxParser.createContainerBoxCtor(t[0],null,t[1])})},Box:function(t,e,i){this.type=t,this.size=e,this.uuid=i},FullBox:function(t,e,i){BoxParser.Box.call(this,t,e,i),this.flags=0,this.version=0},ContainerBox:function(t,e,i){BoxParser.Box.call(this,t,e,i),this.boxes=[]},SampleEntry:function(t,e,i,r){BoxParser.ContainerBox.call(this,t,e),this.hdr_size=i,this.start=r},SampleGroupEntry:function(t){this.grouping_type=t},TrackGroupTypeBox:function(t,e){BoxParser.FullBox.call(this,t,e)},createBoxCtor:function(t,e){BoxParser.boxCodes.push(t),BoxParser[t+"Box"]=function(e){BoxParser.Box.call(this,t,e)},BoxParser[t+"Box"].prototype=new BoxParser.Box,e&&(BoxParser[t+"Box"].prototype.parse=e)},createFullBoxCtor:function(t,e){BoxParser[t+"Box"]=function(e){BoxParser.FullBox.call(this,t,e)},BoxParser[t+"Box"].prototype=new BoxParser.FullBox,BoxParser[t+"Box"].prototype.parse=function(t){this.parseFullHeader(t),e&&e.call(this,t)}},addSubBoxArrays:function(t){if(t){this.subBoxNames=t;for(var e=t.length,i=0;i",e+=""+r.length+"",e+="",e+=r.nalu.reduce(function(t,e){return t+e.toString(16).padStart(2,"0")},"0x"),e+=""}return e+=""}function ColorPoint(t,e){this.x=t,this.y=e}function Pixel(t,e){this.bad_pixel_row=t,this.bad_pixel_column=e}BoxParser.initialize(),BoxParser.TKHD_FLAG_ENABLED=1,BoxParser.TKHD_FLAG_IN_MOVIE=2,BoxParser.TKHD_FLAG_IN_PREVIEW=4,BoxParser.TFHD_FLAG_BASE_DATA_OFFSET=1,BoxParser.TFHD_FLAG_SAMPLE_DESC=2,BoxParser.TFHD_FLAG_SAMPLE_DUR=8,BoxParser.TFHD_FLAG_SAMPLE_SIZE=16,BoxParser.TFHD_FLAG_SAMPLE_FLAGS=32,BoxParser.TFHD_FLAG_DUR_EMPTY=65536,BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,BoxParser.TRUN_FLAGS_DATA_OFFSET=1,BoxParser.TRUN_FLAGS_FIRST_FLAG=4,BoxParser.TRUN_FLAGS_DURATION=256,BoxParser.TRUN_FLAGS_SIZE=512,BoxParser.TRUN_FLAGS_FLAGS=1024,BoxParser.TRUN_FLAGS_CTS_OFFSET=2048,BoxParser.Box.prototype.add=function(t){return this.addBox(new BoxParser[t+"Box"])},BoxParser.Box.prototype.addBox=function(t){return this.boxes.push(t),this[t.type+"s"]?this[t.type+"s"].push(t):this[t.type]=t,t},BoxParser.Box.prototype.set=function(t,e){return this[t]=e,this},BoxParser.Box.prototype.addEntry=function(t,e){var i=e||"entries";return this[i]||(this[i]=[]),this[i].push(t),this},"undefined"!=typeof exports&&(exports.BoxParser=BoxParser),BoxParser.parseUUID=function(t){return BoxParser.parseHex16(t)},BoxParser.parseHex16=function(t){for(var e="",i=0;i<16;i++){var r=t.readUint8().toString(16);e+=1===r.length?"0"+r:r}return e},BoxParser.parseOneBox=function(t,e,i){var r,s,a,n=t.getPosition(),o=0;if(t.getEndPosition()-n<8)return Log.debug("BoxParser","Not enough data in stream to parse the type and size of the box"),{code:BoxParser.ERR_NOT_ENOUGH_DATA};if(i&&i<8)return Log.debug("BoxParser","Not enough bytes left in the parent box to parse a new box"),{code:BoxParser.ERR_NOT_ENOUGH_DATA};var h=t.readUint32(),d=t.readString(4),l=d;if(Log.debug("BoxParser","Found box of type '"+d+"' and size "+h+" at position "+n),o=8,"uuid"==d){if(t.getEndPosition()-t.getPosition()<16||i-o<16)return t.seek(n),Log.debug("BoxParser","Not enough bytes left in the parent box to parse a UUID box"),{code:BoxParser.ERR_NOT_ENOUGH_DATA};o+=16,l=a=BoxParser.parseUUID(t)}if(1==h){if(t.getEndPosition()-t.getPosition()<8||i&&i-o<8)return t.seek(n),Log.warn("BoxParser",'Not enough data in stream to parse the extended size of the "'+d+'" box'),{code:BoxParser.ERR_NOT_ENOUGH_DATA};h=t.readUint64(),o+=8}else if(0===h)if(i)h=i;else if("mdat"!==d)return Log.error("BoxParser","Unlimited box size not supported for type: '"+d+"'"),r=new BoxParser.Box(d,h),{code:BoxParser.OK,box:r,size:r.size};return 0!==h&&hi?(Log.error("BoxParser","Box of type '"+d+"' has a size "+h+" greater than its container size "+i),{code:BoxParser.ERR_NOT_ENOUGH_DATA,type:d,size:h,hdr_size:o,start:n}):0!==h&&n+h>t.getEndPosition()?(t.seek(n),Log.info("BoxParser","Not enough data in stream to parse the entire '"+d+"' box"),{code:BoxParser.ERR_NOT_ENOUGH_DATA,type:d,size:h,hdr_size:o,start:n}):e?{code:BoxParser.OK,type:d,size:h,hdr_size:o,start:n}:(BoxParser[d+"Box"]?r=new BoxParser[d+"Box"](h):"uuid"!==d?(Log.warn("BoxParser","Unknown box type: '"+d+"'"),(r=new BoxParser.Box(d,h)).has_unparsed_data=!0):BoxParser.UUIDBoxes[a]?r=new BoxParser.UUIDBoxes[a](h):(Log.warn("BoxParser","Unknown uuid type: '"+a+"'"),(r=new BoxParser.Box(d,h)).uuid=a,r.has_unparsed_data=!0),r.hdr_size=o,r.start=n,r.write===BoxParser.Box.prototype.write&&"mdat"!==r.type&&(Log.info("BoxParser","'"+l+"' box writing not yet implemented, keeping unparsed data in memory for later write"),r.parseDataAndRewind(t)),r.parse(t),(s=t.getPosition()-(r.start+r.size))<0?(Log.warn("BoxParser","Parsing of box '"+l+"' did not read the entire indicated box data size (missing "+-s+" bytes), seeking forward"),t.seek(r.start+r.size)):s>0&&(Log.error("BoxParser","Parsing of box '"+l+"' read "+s+" more bytes than the indicated box data size, seeking backwards"),0!==r.size&&t.seek(r.start+r.size)),{code:BoxParser.OK,box:r,size:r.size})},BoxParser.Box.prototype.parse=function(t){"mdat"!=this.type?this.data=t.readUint8Array(this.size-this.hdr_size):0===this.size?t.seek(t.getEndPosition()):t.seek(this.start+this.size)},BoxParser.Box.prototype.parseDataAndRewind=function(t){this.data=t.readUint8Array(this.size-this.hdr_size),t.position-=this.size-this.hdr_size},BoxParser.FullBox.prototype.parseDataAndRewind=function(t){this.parseFullHeader(t),this.data=t.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,t.position-=this.size-this.hdr_size},BoxParser.FullBox.prototype.parseFullHeader=function(t){this.version=t.readUint8(),this.flags=t.readUint24(),this.hdr_size+=4},BoxParser.FullBox.prototype.parse=function(t){this.parseFullHeader(t),this.data=t.readUint8Array(this.size-this.hdr_size)},BoxParser.ContainerBox.prototype.parse=function(t){for(var e,i;t.getPosition()>10&31,e[1]=this.language>>5&31,e[2]=31&this.language,this.languageString=String.fromCharCode(e[0]+96,e[1]+96,e[2]+96)},BoxParser.SAMPLE_ENTRY_TYPE_VISUAL="Visual",BoxParser.SAMPLE_ENTRY_TYPE_AUDIO="Audio",BoxParser.SAMPLE_ENTRY_TYPE_HINT="Hint",BoxParser.SAMPLE_ENTRY_TYPE_METADATA="Metadata",BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE="Subtitle",BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM="System",BoxParser.SAMPLE_ENTRY_TYPE_TEXT="Text",BoxParser.SampleEntry.prototype.parseHeader=function(t){t.readUint8Array(6),this.data_reference_index=t.readUint16(),this.hdr_size+=8},BoxParser.SampleEntry.prototype.parse=function(t){this.parseHeader(t),this.data=t.readUint8Array(this.size-this.hdr_size)},BoxParser.SampleEntry.prototype.parseDataAndRewind=function(t){this.parseHeader(t),this.data=t.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,t.position-=this.size-this.hdr_size},BoxParser.SampleEntry.prototype.parseFooter=function(t){BoxParser.ContainerBox.prototype.parse.call(this,t)},BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_HINT),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,function(t){var e;this.parseHeader(t),t.readUint16(),t.readUint16(),t.readUint32Array(3),this.width=t.readUint16(),this.height=t.readUint16(),this.horizresolution=t.readUint32(),this.vertresolution=t.readUint32(),t.readUint32(),this.frame_count=t.readUint16(),e=Math.min(31,t.readUint8()),this.compressorname=t.readString(e),e<31&&t.readString(31-e),this.depth=t.readUint16(),t.readUint16(),this.parseFooter(t)}),BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,function(t){this.parseHeader(t),t.readUint32Array(2),this.channel_count=t.readUint16(),this.samplesize=t.readUint16(),t.readUint16(),t.readUint16(),this.samplerate=t.readUint32()/65536,this.parseFooter(t)}),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"avc1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"avc2"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"avc3"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"avc4"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"av01"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"dav1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"hvc1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"hev1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"hvt1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"lhe1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"dvh1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"dvhe"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vvc1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vvi1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vvs1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vvcN"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vp08"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"vp09"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"avs3"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"j2ki"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"mjp2"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"mjpg"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"uncv"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"mp4a"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"ac-3"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"ac-4"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"ec-3"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"Opus"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"mha1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"mha2"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"mhm1"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"mhm2"),BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"fLaC"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL,"encv"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO,"enca"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE,"encu"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM,"encs"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT,"enct"),BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA,"encm"),BoxParser.createBoxCtor("a1lx",function(t){var e=16*(1+(1&(1&t.readUint8())));this.layer_size=[];for(var i=0;i<3;i++)this.layer_size[i]=16==e?t.readUint16():t.readUint32()}),BoxParser.createBoxCtor("a1op",function(t){this.op_index=t.readUint8()}),BoxParser.createFullBoxCtor("auxC",function(t){this.aux_type=t.readCString();var e=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=t.readUint8Array(e)}),BoxParser.createBoxCtor("av1C",function(t){var e=t.readUint8();if(e>>7&!1)Log.error("av1C marker problem");else if(this.version=127&e,1===this.version)if(e=t.readUint8(),this.seq_profile=e>>5&7,this.seq_level_idx_0=31&e,e=t.readUint8(),this.seq_tier_0=e>>7&1,this.high_bitdepth=e>>6&1,this.twelve_bit=e>>5&1,this.monochrome=e>>4&1,this.chroma_subsampling_x=e>>3&1,this.chroma_subsampling_y=e>>2&1,this.chroma_sample_position=3&e,e=t.readUint8(),this.reserved_1=e>>5&7,0===this.reserved_1){if(this.initial_presentation_delay_present=e>>4&1,1===this.initial_presentation_delay_present)this.initial_presentation_delay_minus_one=15&e;else if(this.reserved_2=15&e,0!==this.reserved_2)return void Log.error("av1C reserved_2 parsing problem");var i=this.size-this.hdr_size-4;this.configOBUs=t.readUint8Array(i)}else Log.error("av1C reserved_1 parsing problem");else Log.error("av1C version "+this.version+" not supported")}),BoxParser.createBoxCtor("avcC",function(t){var e,i;for(this.configurationVersion=t.readUint8(),this.AVCProfileIndication=t.readUint8(),this.profile_compatibility=t.readUint8(),this.AVCLevelIndication=t.readUint8(),this.lengthSizeMinusOne=3&t.readUint8(),this.nb_SPS_nalus=31&t.readUint8(),i=this.size-this.hdr_size-6,this.SPS=[],this.SPS.toString=function(){return printPS(this)},e=0;e0&&(this.ext=t.readUint8Array(i))}),BoxParser.createBoxCtor("btrt",function(t){this.bufferSizeDB=t.readUint32(),this.maxBitrate=t.readUint32(),this.avgBitrate=t.readUint32()}),BoxParser.createFullBoxCtor("ccst",function(t){var e=t.readUint8();this.all_ref_pics_intra=!(128&~e),this.intra_pred_used=!(64&~e),this.max_ref_per_pic=(63&e)>>2,t.readUint24()}),BoxParser.createBoxCtor("cdef",function(t){var e;for(this.channel_count=t.readUint16(),this.channel_indexes=[],this.channel_types=[],this.channel_associations=[],e=0;e=32768&&this.component_type_urls.push(t.readCString())}}),BoxParser.createFullBoxCtor("co64",function(t){var e,i;if(e=t.readUint32(),this.chunk_offsets=[],0===this.version)for(i=0;i>7}else("rICC"===this.colour_type||"prof"===this.colour_type)&&(this.ICC_profile=t.readUint8Array(this.size-4))}),BoxParser.createFullBoxCtor("cprt",function(t){this.parseLanguage(t),this.notice=t.readCString()}),BoxParser.createFullBoxCtor("cslg",function(t){0===this.version&&(this.compositionToDTSShift=t.readInt32(),this.leastDecodeToDisplayDelta=t.readInt32(),this.greatestDecodeToDisplayDelta=t.readInt32(),this.compositionStartTime=t.readInt32(),this.compositionEndTime=t.readInt32())}),BoxParser.createFullBoxCtor("ctts",function(t){var e,i;if(e=t.readUint32(),this.sample_counts=[],this.sample_offsets=[],0===this.version)for(i=0;i>6,this.bsid=e>>1&31,this.bsmod=(1&e)<<2|i>>6&3,this.acmod=i>>3&7,this.lfeon=i>>2&1,this.bit_rate_code=3&i|r>>5&7}),BoxParser.createBoxCtor("dec3",function(t){var e=t.readUint16();this.data_rate=e>>3,this.num_ind_sub=7&e,this.ind_subs=[];for(var i=0;i>6,r.bsid=s>>1&31,r.bsmod=(1&s)<<4|a>>4&15,r.acmod=a>>1&7,r.lfeon=1&a,r.num_dep_sub=n>>1&15,r.num_dep_sub>0&&(r.chan_loc=(1&n)<<8|t.readUint8())}}),BoxParser.createFullBoxCtor("dfLa",function(t){for(var e=[],i=["STREAMINFO","PADDING","APPLICATION","SEEKTABLE","VORBIS_COMMENT","CUESHEET","PICTURE","RESERVED"];;){var r=t.readUint8(),s=Math.min(127&r,i.length-1);if(s?t.readUint8Array(t.readUint24()):(t.readUint8Array(13),this.samplerate=t.readUint32()>>12,t.readUint8Array(20)),e.push(i[s]),128&r)break}this.numMetadataBlocks=e.length+" ("+e.join(", ")+")"}),BoxParser.createBoxCtor("dimm",function(t){this.bytessent=t.readUint64()}),BoxParser.createBoxCtor("dmax",function(t){this.time=t.readUint32()}),BoxParser.createBoxCtor("dmed",function(t){this.bytessent=t.readUint64()}),BoxParser.createBoxCtor("dOps",function(t){if(this.Version=t.readUint8(),this.OutputChannelCount=t.readUint8(),this.PreSkip=t.readUint16(),this.InputSampleRate=t.readUint32(),this.OutputGain=t.readInt16(),this.ChannelMappingFamily=t.readUint8(),0!==this.ChannelMappingFamily){this.StreamCount=t.readUint8(),this.CoupledCount=t.readUint8(),this.ChannelMapping=[];for(var e=0;e=4;)this.compatible_brands[i]=t.readString(4),e-=4,i++}),BoxParser.createFullBoxCtor("hdlr",function(t){0===this.version&&(t.readUint32(),this.handler=t.readString(4),t.readUint32Array(3),this.name=t.readString(this.size-this.hdr_size-20),"\0"===this.name[this.name.length-1]&&(this.name=this.name.slice(0,-1)))}),BoxParser.createBoxCtor("hvcC",function(t){var e,i,r,s;this.configurationVersion=t.readUint8(),s=t.readUint8(),this.general_profile_space=s>>6,this.general_tier_flag=(32&s)>>5,this.general_profile_idc=31&s,this.general_profile_compatibility=t.readUint32(),this.general_constraint_indicator=t.readUint8Array(6),this.general_level_idc=t.readUint8(),this.min_spatial_segmentation_idc=4095&t.readUint16(),this.parallelismType=3&t.readUint8(),this.chroma_format_idc=3&t.readUint8(),this.bit_depth_luma_minus8=7&t.readUint8(),this.bit_depth_chroma_minus8=7&t.readUint8(),this.avgFrameRate=t.readUint16(),s=t.readUint8(),this.constantFrameRate=s>>6,this.numTemporalLayers=(13&s)>>3,this.temporalIdNested=(4&s)>>2,this.lengthSizeMinusOne=3&s,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var t="";t+="",t+="";for(var e=0;e",t+="",t+="";for(var r=0;r"),t+=""}}return t+="
completenessnalu_typenalu_data
"+i.completeness+""+i.nalu_type+"",t+=i[r].data.reduce(function(t,e){return t+e.toString(16).padStart(2,"0")},"0x"),t+="
"};var a=t.readUint8();for(e=0;e>7,n.nalu_type=63&s;var o=t.readUint16();for(i=0;i>4&15,this.length_size=15&e,e=t.readUint8(),this.base_offset_size=e>>4&15,1===this.version||2===this.version?this.index_size=15&e:this.index_size=0,this.items=[];var i=0;if(this.version<2)i=t.readUint16();else{if(2!==this.version)throw"version of iloc box not supported";i=t.readUint32()}for(var r=0;r>7,this.axis=1&e}),BoxParser.createFullBoxCtor("infe",function(t){if(0!==this.version&&1!==this.version||(this.item_ID=t.readUint16(),this.item_protection_index=t.readUint16(),this.item_name=t.readCString(),this.content_type=t.readCString(),this.content_encoding=t.readCString()),1===this.version)return this.extension_type=t.readString(4),Log.warn("BoxParser","Cannot parse extension type"),void t.seek(this.start+this.size);this.version>=2&&(2===this.version?this.item_ID=t.readUint16():3===this.version&&(this.item_ID=t.readUint32()),this.item_protection_index=t.readUint16(),this.item_type=t.readString(4),this.item_name=t.readCString(),"mime"===this.item_type?(this.content_type=t.readCString(),this.content_encoding=t.readCString()):"uri "===this.item_type&&(this.item_uri_type=t.readCString()))}),BoxParser.createFullBoxCtor("ipma",function(t){var e,i;for(entry_count=t.readUint32(),this.associations=[],e=0;e>7==1,1&this.flags?n.property_index=(127&a)<<8|t.readUint8():n.property_index=127&a}}}),BoxParser.createFullBoxCtor("iref",function(t){var e,i;for(this.references=[];t.getPosition()>7,r.assignment_type=127&s,r.assignment_type){case 0:r.grouping_type=t.readString(4);break;case 1:r.grouping_type=t.readString(4),r.grouping_type_parameter=t.readUint32();break;case 2:case 3:break;case 4:r.sub_track_id=t.readUint32();break;default:Log.warn("BoxParser","Unknown leva assignement type")}}}),BoxParser.createBoxCtor("lhvC",function(t){var e,i,r;this.configurationVersion=t.readUint8(),this.min_spatial_segmentation_idc=4095&t.readUint16(),this.parallelismType=3&t.readUint8(),r=t.readUint8(),this.numTemporalLayers=(13&r)>>3,this.temporalIdNested=(4&r)>>2,this.lengthSizeMinusOne=3&r,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var t="";t+="",t+="";for(var e=0;e",t+="",t+="";for(var r=0;r"),t+=""}}return t+="
completenessnalu_typenalu_data
"+i.completeness+""+i.nalu_type+"",t+=i[r].data.reduce(function(t,e){return t+e.toString(16).padStart(2,"0")},"0x"),t+="
"};var s=t.readUint8();for(e=0;e>7,a.nalu_type=63&r;var n=t.readUint16();for(i=0;i>8,t.readUint16(),t.readUint32Array(2),this.matrix=t.readUint32Array(9),t.readUint32Array(6),this.next_track_id=t.readUint32()}),BoxParser.createBoxCtor("npck",function(t){this.packetssent=t.readUint32()}),BoxParser.createBoxCtor("nump",function(t){this.packetssent=t.readUint64()}),BoxParser.createFullBoxCtor("padb",function(t){var e=t.readUint32();this.padbits=[];for(var i=0;i0){var e=t.readUint32();this.kid=[];for(var i=0;i0&&(this.data=t.readUint8Array(r))}),BoxParser.createFullBoxCtor("clef",function(t){this.width=t.readUint32(),this.height=t.readUint32()}),BoxParser.createFullBoxCtor("enof",function(t){this.width=t.readUint32(),this.height=t.readUint32()}),BoxParser.createFullBoxCtor("prof",function(t){this.width=t.readUint32(),this.height=t.readUint32()}),BoxParser.createContainerBoxCtor("tapt",null,["clef","prof","enof"]),BoxParser.createBoxCtor("rtp ",function(t){this.descriptionformat=t.readString(4),this.sdptext=t.readString(this.size-this.hdr_size-4)}),BoxParser.createFullBoxCtor("saio",function(t){1&this.flags&&(this.aux_info_type=t.readString(4),this.aux_info_type_parameter=t.readUint32());var e=t.readUint32();this.offset=[];for(var i=0;i>7,this.avgRateFlag=e>>6&1,this.durationFlag&&(this.duration=t.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=t.readUint8(),this.avgBitRate=t.readUint16(),this.avgFrameRate=t.readUint16()),this.dependency=[];for(var i=t.readUint8(),r=0;r>7,this.num_leading_samples=127&e}),BoxParser.createSampleGroupCtor("rash",function(t){if(this.operation_point_count=t.readUint16(),this.description_length!==2+(1===this.operation_point_count?2:6*this.operation_point_count)+9)Log.warn("BoxParser","Mismatch in "+this.grouping_type+" sample group length"),this.data=t.readUint8Array(this.description_length-2);else{if(1===this.operation_point_count)this.target_rate_share=t.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var e=0;e>4,this.skip_byte_block=15&e,this.isProtected=t.readUint8(),this.Per_Sample_IV_Size=t.readUint8(),this.KID=BoxParser.parseHex16(t),this.constant_IV_size=0,this.constant_IV=0,1===this.isProtected&&0===this.Per_Sample_IV_Size&&(this.constant_IV_size=t.readUint8(),this.constant_IV=t.readUint8Array(this.constant_IV_size))}),BoxParser.createSampleGroupCtor("stsa",function(t){Log.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),BoxParser.createSampleGroupCtor("sync",function(t){var e=t.readUint8();this.NAL_unit_type=63&e}),BoxParser.createSampleGroupCtor("tele",function(t){var e=t.readUint8();this.level_independently_decodable=e>>7}),BoxParser.createSampleGroupCtor("tsas",function(t){Log.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),BoxParser.createSampleGroupCtor("tscl",function(t){Log.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),BoxParser.createSampleGroupCtor("vipr",function(t){Log.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),BoxParser.createFullBoxCtor("sbgp",function(t){this.grouping_type=t.readString(4),1===this.version?this.grouping_type_parameter=t.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var e=t.readUint32(),i=0;i>6,this.sample_depends_on[r]=e>>4&3,this.sample_is_depended_on[r]=e>>2&3,this.sample_has_redundancy[r]=3&e}),BoxParser.createFullBoxCtor("senc"),BoxParser.createFullBoxCtor("sgpd",function(t){this.grouping_type=t.readString(4),Log.debug("BoxParser","Found Sample Groups of type "+this.grouping_type),1===this.version?this.default_length=t.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=t.readUint32()),this.entries=[];for(var e=t.readUint32(),i=0;i>31&1,r.referenced_size=2147483647&s,r.subsegment_duration=t.readUint32(),s=t.readUint32(),r.starts_with_SAP=s>>31&1,r.SAP_type=s>>28&7,r.SAP_delta_time=268435455&s}}),BoxParser.SingleItemTypeReferenceBox=function(t,e,i,r){BoxParser.Box.call(this,t,e),this.hdr_size=i,this.start=r},BoxParser.SingleItemTypeReferenceBox.prototype=new BoxParser.Box,BoxParser.SingleItemTypeReferenceBox.prototype.parse=function(t){this.from_item_ID=t.readUint16();var e=t.readUint16();this.references=[];for(var i=0;i>4&15,this.sample_sizes[e+1]=15&r}else if(8===this.field_size)for(e=0;e0)for(i=0;i>4&15,this.default_skip_byte_block=15&e}this.default_isProtected=t.readUint8(),this.default_Per_Sample_IV_Size=t.readUint8(),this.default_KID=BoxParser.parseHex16(t),1===this.default_isProtected&&0===this.default_Per_Sample_IV_Size&&(this.default_constant_IV_size=t.readUint8(),this.default_constant_IV=t.readUint8Array(this.default_constant_IV_size))}),BoxParser.createFullBoxCtor("tfdt",function(t){1==this.version?this.baseMediaDecodeTime=t.readUint64():this.baseMediaDecodeTime=t.readUint32()}),BoxParser.createFullBoxCtor("tfhd",function(t){var e=0;this.track_id=t.readUint32(),this.size-this.hdr_size>e&&this.flags&BoxParser.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=t.readUint64(),e+=8):this.base_data_offset=0,this.size-this.hdr_size>e&&this.flags&BoxParser.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=t.readUint32(),e+=4):this.default_sample_description_index=0,this.size-this.hdr_size>e&&this.flags&BoxParser.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=t.readUint32(),e+=4):this.default_sample_duration=0,this.size-this.hdr_size>e&&this.flags&BoxParser.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=t.readUint32(),e+=4):this.default_sample_size=0,this.size-this.hdr_size>e&&this.flags&BoxParser.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=t.readUint32(),e+=4):this.default_sample_flags=0}),BoxParser.createFullBoxCtor("tfra",function(t){this.track_ID=t.readUint32(),t.readUint24();var e=t.readUint8();this.length_size_of_traf_num=e>>4&3,this.length_size_of_trun_num=e>>2&3,this.length_size_of_sample_num=3&e,this.entries=[];for(var i=t.readUint32(),r=0;r>8,t.readUint16(),this.matrix=t.readInt32Array(9),this.width=t.readUint32(),this.height=t.readUint32()}),BoxParser.createBoxCtor("tmax",function(t){this.time=t.readUint32()}),BoxParser.createBoxCtor("tmin",function(t){this.time=t.readUint32()}),BoxParser.createBoxCtor("totl",function(t){this.bytessent=t.readUint32()}),BoxParser.createBoxCtor("tpay",function(t){this.bytessent=t.readUint32()}),BoxParser.createBoxCtor("tpyl",function(t){this.bytessent=t.readUint64()}),BoxParser.TrackGroupTypeBox.prototype.parse=function(t){this.parseFullHeader(t),this.track_group_id=t.readUint32()},BoxParser.createTrackGroupCtor("msrc"),BoxParser.TrackReferenceTypeBox=function(t,e,i,r){BoxParser.Box.call(this,t,e),this.hdr_size=i,this.start=r},BoxParser.TrackReferenceTypeBox.prototype=new BoxParser.Box,BoxParser.TrackReferenceTypeBox.prototype.parse=function(t){this.track_ids=t.readUint32Array((this.size-this.hdr_size)/4)},BoxParser.trefBox.prototype.parse=function(t){for(var e,i;t.getPosition()e&&this.flags&BoxParser.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=t.readInt32(),e+=4):this.data_offset=0,this.size-this.hdr_size>e&&this.flags&BoxParser.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=t.readUint32(),e+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>e)for(var i=0;i>7&1,this.block_pad_lsb=i>>6&1,this.block_little_endian=i>>5&1,this.block_reversed=i>>4&1,this.pad_unknown=i>>3&1,this.pixel_size=t.readUint32(),this.row_align_size=t.readUint32(),this.tile_align_size=t.readUint32(),this.num_tile_cols_minus_one=t.readUint32(),this.num_tile_rows_minus_one=t.readUint32()}}),BoxParser.createFullBoxCtor("url ",function(t){1!==this.flags&&(this.location=t.readCString())}),BoxParser.createFullBoxCtor("urn ",function(t){this.name=t.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=t.readCString())}),BoxParser.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66",!0,!1,function(t){this.LiveServerManifest=t.readString(this.size-this.hdr_size).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}),BoxParser.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3",!0,!1,function(t){this.system_id=BoxParser.parseHex16(t);var e=t.readUint32();e>0&&(this.data=t.readUint8Array(e))}),BoxParser.createUUIDBox("a2394f525a9b4f14a2446c427c648df4",!0,!1),BoxParser.createUUIDBox("8974dbce7be74c5184f97148f9882554",!0,!1,function(t){this.default_AlgorithmID=t.readUint24(),this.default_IV_size=t.readUint8(),this.default_KID=BoxParser.parseHex16(t)}),BoxParser.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f",!0,!1,function(t){this.fragment_count=t.readUint8(),this.entries=[];for(var e=0;e>4,this.chromaSubsampling=e>>1&7,this.videoFullRangeFlag=1&e,this.colourPrimaries=t.readUint8(),this.transferCharacteristics=t.readUint8(),this.matrixCoefficients=t.readUint8(),this.codecIntializationDataSize=t.readUint16(),this.codecIntializationData=t.readUint8Array(this.codecIntializationDataSize)):(this.profile=t.readUint8(),this.level=t.readUint8(),e=t.readUint8(),this.bitDepth=e>>4&15,this.colorSpace=15&e,e=t.readUint8(),this.chromaSubsampling=e>>4&15,this.transferFunction=e>>1&7,this.videoFullRangeFlag=1&e,this.codecIntializationDataSize=t.readUint16(),this.codecIntializationData=t.readUint8Array(this.codecIntializationDataSize))}),BoxParser.createBoxCtor("vttC",function(t){this.text=t.readString(this.size-this.hdr_size)}),BoxParser.createFullBoxCtor("vvcC",function(t){var e,i,r={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(t){this.held_bits=t.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(t){this.held_bits=t.readUint16(),this.num_held_bits=16},extract_bits:function(t){var e=this.held_bits>>this.num_held_bits-t&(1<1){for(r.stream_read_1_bytes(t),this.ptl_sublayer_present_mask=0,i=this.num_sublayers-2;i>=0;--i){var n=r.extract_bits(1);this.ptl_sublayer_present_mask|=n<1;++i)r.extract_bits(1);for(this.sublayer_level_idc=[],i=this.num_sublayers-2;i>=0;--i)this.ptl_sublayer_present_mask&1<>=1;e+=BoxParser.decimalToHex(r,0),e+=".",0===this.hvcC.general_tier_flag?e+="L":e+="H",e+=this.hvcC.general_level_idc;var s=!1,a="";for(t=5;t>=0;t--)(this.hvcC.general_constraint_indicator[t]||s)&&(a="."+BoxParser.decimalToHex(this.hvcC.general_constraint_indicator[t],0)+a,s=!0);e+=a}return e},BoxParser.vvc1SampleEntry.prototype.getCodec=BoxParser.vvi1SampleEntry.prototype.getCodec=function(){var t,e=BoxParser.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){e+="."+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?e+=".H":e+=".L",e+=this.vvcC.general_level_idc;var i="";if(this.vvcC.general_constraint_info){var r,s=[],a=0;for(a|=this.vvcC.ptl_frame_only_constraint<<7,a|=this.vvcC.ptl_multilayer_enabled<<6,t=0;t>2&63,s.push(a),a&&(r=t),a=this.vvcC.general_constraint_info[t]>>2&3;if(void 0===r)i=".CA";else{i=".C";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",o=0,h=0;for(t=0;t<=r;++t)for(o=o<<8|s[t],h+=8;h>=5;){i+=n[o>>h-5&31],o&=(1<<(h-=5))-1}h&&(i+=n[31&(o<<=5-h)])}}e+=i}return e},BoxParser.mp4aSampleEntry.prototype.getCodec=function(){var t=BoxParser.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var e=this.esds.esd.getOTI(),i=this.esds.esd.getAudioConfig();return t+"."+BoxParser.decimalToHex(e)+(i?"."+i:"")}return t},BoxParser.stxtSampleEntry.prototype.getCodec=function(){var t=BoxParser.SampleEntry.prototype.getCodec.call(this);return this.mime_format?t+"."+this.mime_format:t},BoxParser.vp08SampleEntry.prototype.getCodec=BoxParser.vp09SampleEntry.prototype.getCodec=function(){var t=BoxParser.SampleEntry.prototype.getCodec.call(this),e=this.vpcC.level;0==e&&(e="00");var i=this.vpcC.bitDepth;return 8==i&&(i="08"),t+".0"+this.vpcC.profile+"."+e+"."+i},BoxParser.av01SampleEntry.prototype.getCodec=function(){var t,e=BoxParser.SampleEntry.prototype.getCodec.call(this),i=this.av1C.seq_level_idx_0;return i<10&&(i="0"+i),2===this.av1C.seq_profile&&1===this.av1C.high_bitdepth?t=1===this.av1C.twelve_bit?"12":"10":this.av1C.seq_profile<=2&&(t=1===this.av1C.high_bitdepth?"10":"08"),e+"."+this.av1C.seq_profile+"."+i+(this.av1C.seq_tier_0?"H":"M")+"."+t},BoxParser.Box.prototype.writeHeader=function(t,e){this.size+=8,this.size>MAX_SIZE&&(this.size+=8),"uuid"===this.type&&(this.size+=16),Log.debug("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+t.getPosition()+(e||"")),this.size>MAX_SIZE?t.writeUint32(1):(this.sizePosition=t.getPosition(),t.writeUint32(this.size)),t.writeString(this.type,null,4),"uuid"===this.type&&t.writeUint8Array(this.uuid),this.size>MAX_SIZE&&t.writeUint64(this.size)},BoxParser.FullBox.prototype.writeHeader=function(t){this.size+=4,BoxParser.Box.prototype.writeHeader.call(this,t," v="+this.version+" f="+this.flags),t.writeUint8(this.version),t.writeUint24(this.flags)},BoxParser.Box.prototype.write=function(t){"mdat"===this.type?this.data&&(this.size=this.data.length,this.writeHeader(t),t.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(t),this.data&&t.writeUint8Array(this.data))},BoxParser.ContainerBox.prototype.write=function(t){this.size=0,this.writeHeader(t);for(var e=0;e=2&&t.writeUint32(this.default_sample_description_index),t.writeUint32(this.entries.length),e=0;e0)for(e=0;e+1e?1:0,this.flags=0,this.size=4,1===this.version&&(this.size+=4),this.writeHeader(t),1===this.version?t.writeUint64(this.baseMediaDecodeTime):t.writeUint32(this.baseMediaDecodeTime)},BoxParser.tfhdBox.prototype.write=function(t){this.version=0,this.size=4,this.flags&BoxParser.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&BoxParser.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&BoxParser.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&BoxParser.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&BoxParser.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(t),t.writeUint32(this.track_id),this.flags&BoxParser.TFHD_FLAG_BASE_DATA_OFFSET&&t.writeUint64(this.base_data_offset),this.flags&BoxParser.TFHD_FLAG_SAMPLE_DESC&&t.writeUint32(this.default_sample_description_index),this.flags&BoxParser.TFHD_FLAG_SAMPLE_DUR&&t.writeUint32(this.default_sample_duration),this.flags&BoxParser.TFHD_FLAG_SAMPLE_SIZE&&t.writeUint32(this.default_sample_size),this.flags&BoxParser.TFHD_FLAG_SAMPLE_FLAGS&&t.writeUint32(this.default_sample_flags)},BoxParser.tkhdBox.prototype.write=function(t){this.version=0,this.size=80,this.writeHeader(t),t.writeUint32(this.creation_time),t.writeUint32(this.modification_time),t.writeUint32(this.track_id),t.writeUint32(0),t.writeUint32(this.duration),t.writeUint32(0),t.writeUint32(0),t.writeInt16(this.layer),t.writeInt16(this.alternate_group),t.writeInt16(this.volume<<8),t.writeUint16(0),t.writeInt32Array(this.matrix),t.writeUint32(this.width),t.writeUint32(this.height)},BoxParser.trexBox.prototype.write=function(t){this.version=0,this.flags=0,this.size=20,this.writeHeader(t),t.writeUint32(this.track_id),t.writeUint32(this.default_sample_description_index),t.writeUint32(this.default_sample_duration),t.writeUint32(this.default_sample_size),t.writeUint32(this.default_sample_flags)},BoxParser.trunBox.prototype.write=function(t){this.version=0,this.size=4,this.flags&BoxParser.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&BoxParser.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&BoxParser.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&BoxParser.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&BoxParser.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&BoxParser.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(t),t.writeUint32(this.sample_count),this.flags&BoxParser.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=t.getPosition(),t.writeInt32(this.data_offset)),this.flags&BoxParser.TRUN_FLAGS_FIRST_FLAG&&t.writeUint32(this.first_sample_flags);for(var e=0;e-1||t[i]instanceof BoxParser.Box||e[i]instanceof BoxParser.Box||void 0===t[i]||void 0===e[i]||"function"==typeof t[i]||"function"==typeof e[i]||t.subBoxNames&&t.subBoxNames.indexOf(i.slice(0,4))>-1||e.subBoxNames&&e.subBoxNames.indexOf(i.slice(0,4))>-1||"data"===i||"start"===i||"size"===i||"creation_time"===i||"modification_time"===i||BoxParser.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(i)>-1||t[i]===e[i]))return!1;return!0},BoxParser.boxEqual=function(t,e){if(!BoxParser.boxEqualFields(t,e))return!1;for(var i=0;i=e?t:new Array(e-t.length+1).join(i)+t}function s(t){var e=Math.floor(t/3600),i=Math.floor((t-3600*e)/60),s=Math.floor(t-3600*e-60*i),a=Math.floor(1e3*(t-3600*e-60*i-s));return r(e,2)+":"+r(i,2)+":"+r(s,2)+"."+r(a,3)}for(var a=this.parseSample(i),n="",o=0;o1)for(e=1;e-1&&this.fragmentedTracks.splice(e,1)},ISOFile.prototype.setExtractionOptions=function(t,e,i){var r=this.getTrackById(t);if(r){var s={};this.extractedTracks.push(s),s.id=t,s.user=e,s.trak=r,r.nextSample=0,s.nb_samples=1e3,s.samples=[],i&&i.nbSamples&&(s.nb_samples=i.nbSamples)}},ISOFile.prototype.unsetExtractionOptions=function(t){for(var e=-1,i=0;i-1&&this.extractedTracks.splice(e,1)},ISOFile.prototype.parse=function(){var t,e;if(!this.restoreParsePosition||this.restoreParsePosition())for(;;){if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}if(this.saveParsePosition&&this.saveParsePosition(),(t=BoxParser.parseOneBox(this.stream,false)).code===BoxParser.ERR_NOT_ENOUGH_DATA){if(this.processIncompleteBox){if(this.processIncompleteBox(t))continue;return}return}var i;switch(i="uuid"!==(e=t.box).type?e.type:e.uuid,this.boxes.push(e),i){case"mdat":this.mdats.push(e);break;case"moof":this.moofs.push(e);break;case"moov":this.moovStartFound=!0,0===this.mdats.length&&(this.isProgressive=!0);default:void 0!==this[i]&&Log.warn("ISOFile","Duplicate Box of type: "+i+", overriding previous occurrence"),this[i]=e}this.updateUsedBytes&&this.updateUsedBytes(e,t)}},ISOFile.prototype.checkBuffer=function(t){if(null==t)throw"Buffer must be defined and non empty";if(void 0===t.fileStart)throw"Buffer must have a fileStart property";return 0===t.byteLength?(Log.warn("ISOFile","Ignoring empty buffer (fileStart: "+t.fileStart+")"),this.stream.logBufferLevel(),!1):(Log.info("ISOFile","Processing buffer (fileStart: "+t.fileStart+")"),t.usedBytes=0,this.stream.insertBuffer(t),this.stream.logBufferLevel(),!!this.stream.initialized()||(Log.warn("ISOFile","Not ready to start parsing"),!1))},ISOFile.prototype.appendBuffer=function(t,e){var i;if(this.checkBuffer(t))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||(this.buildSampleLists(),this.sampleListBuilt=!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(e),this.nextSeekPosition?(i=this.nextSeekPosition,this.nextSeekPosition=void 0):i=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(i=this.stream.getEndFilePositionAfter(i))):i=this.nextParsePosition?this.nextParsePosition:0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(Log.info("ISOFile","Done processing buffer (fileStart: "+t.fileStart+") - next buffer to fetch should have a fileStart position of "+i),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),Log.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize())),i},ISOFile.prototype.getInfo=function(){var t,e,i,r,s,a,n={},o=new Date("1904-01-01T00:00:00Z").getTime();if(this.moov)for(n.hasMoov=!0,n.duration=this.moov.mvhd.duration,n.timescale=this.moov.mvhd.timescale,n.isFragmented=null!=this.moov.mvex,n.isFragmented&&this.moov.mvex.mehd&&(n.fragment_duration=this.moov.mvex.mehd.fragment_duration),n.isProgressive=this.isProgressive,n.hasIOD=null!=this.moov.iods,n.brands=[],n.brands.push(this.ftyp.major_brand),n.brands=n.brands.concat(this.ftyp.compatible_brands),n.created=new Date(o+1e3*this.moov.mvhd.creation_time),n.modified=new Date(o+1e3*this.moov.mvhd.modification_time),n.tracks=[],n.audioTracks=[],n.videoTracks=[],n.subtitleTracks=[],n.metadataTracks=[],n.hintTracks=[],n.otherTracks=[],t=0;t0?n.mime+='video/mp4; codecs="':n.audioTracks&&n.audioTracks.length>0?n.mime+='audio/mp4; codecs="':n.mime+='application/mp4; codecs="',t=0;t=i.samples.length)&&(Log.info("ISOFile","Sending fragmented data on track #"+r.id+" for samples ["+Math.max(0,i.nextSample-r.nb_samples)+","+(i.nextSample-1)+"]"),Log.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(r.id,r.user,r.segmentStream.buffer,i.nextSample,t||i.nextSample>=i.samples.length),r.segmentStream=null,r!==this.fragmentedTracks[e]))break}}if(null!==this.onSamples)for(e=0;e=i.samples.length)&&(Log.debug("ISOFile","Sending samples on track #"+a.id+" for sample "+i.nextSample),this.onSamples&&this.onSamples(a.id,a.user,a.samples),a.samples=[],a!==this.extractedTracks[e]))break}}}},ISOFile.prototype.getBox=function(t){var e=this.getBoxes(t,!0);return e.length?e[0]:null},ISOFile.prototype.getBoxes=function(t,e){var i=[];return ISOFile._sweep.call(this,t,i,e),i},ISOFile._sweep=function(t,e,i){for(var r in this.type&&this.type==t&&e.push(this),this.boxes){if(e.length&&i)return;ISOFile._sweep.call(this.boxes[r],t,e,i)}},ISOFile.prototype.getTrackSamplesInfo=function(t){var e=this.getTrackById(t);return e?e.samples:void 0},ISOFile.prototype.getTrackSample=function(t,e){var i=this.getTrackById(t);return this.getSample(i,e)},ISOFile.prototype.releaseUsedSamples=function(t,e){var i=0,r=this.getTrackById(t);r.lastValidSample||(r.lastValidSample=0);for(var s=r.lastValidSample;st*s.timescale){h=r-1;break}e&&s.is_sync&&(o=r)}for(e&&(h=o),t=i.samples[h].cts,i.nextSample=h;i.samples[h].alreadyRead===i.samples[h].size&&i.samples[h+1];)h++;return a=i.samples[h].offset+i.samples[h].alreadyRead,Log.info("ISOFile","Seeking to "+(e?"RAP":"")+" sample #"+i.nextSample+" on track "+i.tkhd.track_id+", time "+Log.getDurationString(t,n)+" and offset: "+a),{offset:a,time:t/n}},ISOFile.prototype.getTrackDuration=function(t){var e;return t.samples?((e=t.samples[t.samples.length-1]).cts+e.duration)/e.timescale:1/0},ISOFile.prototype.seek=function(t,e){var i,r,s,a=this.moov,n={offset:1/0,time:1/0};if(this.moov){for(s=0;sthis.getTrackDuration(i)||((r=this.seekTrack(t,e,i)).offset-1){n=o;break}switch(n){case"Visual":if(s.add("vmhd").set("graphicsmode",0).set("opcolor",[0,0,0]),a.set("width",e.width).set("height",e.height).set("horizresolution",72<<16).set("vertresolution",72<<16).set("frame_count",1).set("compressorname",e.type+" Compressor").set("depth",24),e.avcDecoderConfigRecord){var l=new BoxParser.avcCBox;l.parse(new MP4BoxStream(e.avcDecoderConfigRecord)),a.addBox(l)}else if(e.hevcDecoderConfigRecord){var p=new BoxParser.hvcCBox;p.parse(new MP4BoxStream(e.hevcDecoderConfigRecord)),a.addBox(p)}break;case"Audio":s.add("smhd").set("balance",e.balance||0),a.set("channel_count",e.channel_count||2).set("samplesize",e.samplesize||16).set("samplerate",e.samplerate||65536);break;case"Hint":s.add("hmhd");break;case"Subtitle":if(s.add("sthd"),"stpp"===e.type)a.set("namespace",e.namespace||"nonamespace").set("schema_location",e.schema_location||"").set("auxiliary_mime_types",e.auxiliary_mime_types||"");break;default:s.add("nmhd")}e.description&&a.addBox(e.description),e.description_boxes&&e.description_boxes.forEach(function(t){a.addBox(t)}),s.add("dinf").add("dref").addEntry((new BoxParser["url Box"]).set("flags",1));var f=s.add("stbl");return f.add("stsd").addEntry(a),f.add("stts").set("sample_counts",[]).set("sample_deltas",[]),f.add("stsc").set("first_chunk",[]).set("samples_per_chunk",[]).set("sample_description_index",[]),f.add("stco").set("chunk_offsets",[]),f.add("stsz").set("sample_sizes",[]),this.moov.mvex.add("trex").set("track_id",e.id).set("default_sample_description_index",e.default_sample_description_index||1).set("default_sample_duration",e.default_sample_duration||0).set("default_sample_size",e.default_sample_size||0).set("default_sample_flags",e.default_sample_flags||0),this.buildTrakSampleLists(i),e.id}},BoxParser.Box.prototype.computeSize=function(t){var e=t||new DataStream;e.endianness=DataStream.BIG_ENDIAN,this.write(e)},ISOFile.prototype.addSample=function(t,e,i){var r=i||{},s={},a=this.getTrackById(t);if(null!==a){s.number=a.samples.length,s.track_id=a.tkhd.track_id,s.timescale=a.mdia.mdhd.timescale,s.description_index=r.sample_description_index?r.sample_description_index-1:0,s.description=a.mdia.minf.stbl.stsd.entries[s.description_index],s.data=e,s.size=e.byteLength,s.alreadyRead=s.size,s.duration=r.duration||1,s.cts=r.cts||0,s.dts=r.dts||0,s.is_sync=r.is_sync||!1,s.is_leading=r.is_leading||0,s.depends_on=r.depends_on||0,s.is_depended_on=r.is_depended_on||0,s.has_redundancy=r.has_redundancy||0,s.degradation_priority=r.degradation_priority||0,s.offset=0,s.subsamples=r.subsamples,a.samples.push(s),a.samples_size+=s.size,a.samples_duration+=s.duration,void 0===a.first_dts&&(a.first_dts=r.dts),this.processSamples();var n=this.createSingleSampleMoof(s);return this.addBox(n),n.computeSize(),n.trafs[0].truns[0].data_offset=n.size+8,this.add("mdat").data=new Uint8Array(e),s}},ISOFile.prototype.createSingleSampleMoof=function(t){var e=0;e=t.is_sync?1<<25:65536;var i=new BoxParser.moofBox;i.add("mfhd").set("sequence_number",this.nextMoofNumber),this.nextMoofNumber++;var r=i.add("traf"),s=this.getTrackById(t.track_id);return r.add("tfhd").set("track_id",t.track_id).set("flags",BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),r.add("tfdt").set("baseMediaDecodeTime",t.dts-(s.first_dts||0)),r.add("trun").set("flags",BoxParser.TRUN_FLAGS_DATA_OFFSET|BoxParser.TRUN_FLAGS_DURATION|BoxParser.TRUN_FLAGS_SIZE|BoxParser.TRUN_FLAGS_FLAGS|BoxParser.TRUN_FLAGS_CTS_OFFSET).set("data_offset",0).set("first_sample_flags",0).set("sample_count",1).set("sample_duration",[t.duration]).set("sample_size",[t.size]).set("sample_flags",[e]).set("sample_composition_time_offset",[t.cts-t.dts]),i},ISOFile.prototype.lastMoofIndex=0,ISOFile.prototype.samplesDataSize=0,ISOFile.prototype.resetTables=function(){var t,e,i,r,s,a;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,t=0;t=2&&(h=s[n].grouping_type+"/0",(o=new d(s[n].grouping_type,0)).is_fragment=!0,e.sample_groups_info[h]||(e.sample_groups_info[h]=o))}else for(n=0;n=2&&(h=r[n].grouping_type+"/0",o=new d(r[n].grouping_type,0),t.sample_groups_info[h]||(t.sample_groups_info[h]=o))},ISOFile.setSampleGroupProperties=function(t,e,i,r){var s,a;for(s in e.sample_groups=[],r){var n;if(e.sample_groups[s]={},e.sample_groups[s].grouping_type=r[s].grouping_type,e.sample_groups[s].grouping_type_parameter=r[s].grouping_type_parameter,i>=r[s].last_sample_in_run&&(r[s].last_sample_in_run<0&&(r[s].last_sample_in_run=0),r[s].entry_index++,r[s].entry_index<=r[s].sbgp.entries.length-1&&(r[s].last_sample_in_run+=r[s].sbgp.entries[r[s].entry_index].sample_count)),r[s].entry_index<=r[s].sbgp.entries.length-1?e.sample_groups[s].group_description_index=r[s].sbgp.entries[r[s].entry_index].group_description_index:e.sample_groups[s].group_description_index=-1,0!==e.sample_groups[s].group_description_index)n=r[s].fragment_description?r[s].fragment_description:r[s].description,e.sample_groups[s].group_description_index>0?(a=e.sample_groups[s].group_description_index>65535?(e.sample_groups[s].group_description_index>>16)-1:e.sample_groups[s].group_description_index-1,n&&a>=0&&(e.sample_groups[s].description=n.entries[a])):n&&n.version>=2&&n.default_group_description_index>0&&(e.sample_groups[s].description=n.entries[n.default_group_description_index-1])}},ISOFile.process_sdtp=function(t,e,i){e&&(t?(e.is_leading=t.is_leading[i],e.depends_on=t.sample_depends_on[i],e.is_depended_on=t.sample_is_depended_on[i],e.has_redundancy=t.sample_has_redundancy[i]):(e.is_leading=0,e.depends_on=0,e.is_depended_on=0,e.has_redundancy=0))},ISOFile.prototype.buildSampleLists=function(){var t,e;for(t=0;tx&&(y++,x<0&&(x=0),x+=a.sample_counts[y]),e>0?(t.samples[e-1].duration=a.sample_deltas[y],t.samples_duration+=t.samples[e-1].duration,v.dts=t.samples[e-1].dts+t.samples[e-1].duration):v.dts=0,n?(e>=B&&(S++,B<0&&(B=0),B+=n.sample_counts[S]),v.cts=t.samples[e].dts+n.sample_offsets[S]):v.cts=v.dts,o?(e==o.sample_numbers[P]-1?(v.is_sync=!0,P++):(v.is_sync=!1,v.degradation_priority=0),d&&d.entries[U].sample_delta+b==e+1&&(v.subsamples=d.entries[U].subsamples,b+=d.entries[U].sample_delta,U++)):v.is_sync=!0,ISOFile.process_sdtp(t.mdia.minf.stbl.sdtp,v,v.number),v.degradation_priority=f?f.priority[e]:0,d&&d.entries[U].sample_delta+b==e&&(v.subsamples=d.entries[U].subsamples,b+=d.entries[U].sample_delta),(l.length>0||p.length>0)&&ISOFile.setSampleGroupProperties(t,v,e,t.sample_groups_info)}e>0&&(t.samples[e-1].duration=Math.max(t.mdia.mdhd.duration-t.samples[e-1].dts,0),t.samples_duration+=t.samples[e-1].duration)}},ISOFile.prototype.updateSampleLists=function(){var t,e,i,r,s,a,n,o,h,d,l,p,f,u,_;if(void 0!==this.moov)for(;this.lastMoofIndex0&&ISOFile.initSampleGroups(p,l,l.sbgps,p.mdia.minf.stbl.sgpds,l.sgpds),e=0;e0?u.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration:(l.tfdt?u.dts=l.tfdt.baseMediaDecodeTime:u.dts=0,p.first_traf_merged=!0),u.cts=u.dts,c.flags&BoxParser.TRUN_FLAGS_CTS_OFFSET&&(u.cts=u.dts+c.sample_composition_time_offset[i]),_=n,c.flags&BoxParser.TRUN_FLAGS_FLAGS?_=c.sample_flags[i]:0===i&&c.flags&BoxParser.TRUN_FLAGS_FIRST_FLAG&&(_=c.first_sample_flags),u.is_sync=!(_>>16&1),u.is_leading=_>>26&3,u.depends_on=_>>24&3,u.is_depended_on=_>>22&3,u.has_redundancy=_>>20&3,u.degradation_priority=65535&_;var m=!!(l.tfhd.flags&BoxParser.TFHD_FLAG_BASE_DATA_OFFSET),g=!!(l.tfhd.flags&BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),x=!!(c.flags&BoxParser.TRUN_FLAGS_DATA_OFFSET),y=0;y=m?l.tfhd.base_data_offset:g||0===e?d.start:o,u.offset=0===e&&0===i?x?y+c.data_offset:y:o,o=u.offset+u.size,(l.sbgps.length>0||l.sgpds.length>0||p.mdia.minf.stbl.sbgps.length>0||p.mdia.minf.stbl.sgpds.length>0)&&ISOFile.setSampleGroupProperties(p,u,u.number_in_traf,l.sample_groups_info)}}if(l.subs){p.has_fragment_subsamples=!0;var B=l.first_sample_index;for(e=0;e-1))return null;var a=(i=this.stream.buffers[s]).byteLength-(r.offset+r.alreadyRead-i.fileStart);if(r.size-r.alreadyRead<=a)return Log.debug("ISOFile","Getting sample #"+e+" data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+(r.size-r.alreadyRead)+" full size: "+r.size+")"),DataStream.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,r.size-r.alreadyRead),i.usedBytes+=r.size-r.alreadyRead,this.stream.logBufferLevel(),r.alreadyRead=r.size,r;if(0===a)return null;Log.debug("ISOFile","Getting sample #"+e+" partial data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+a+" full size: "+r.size+")"),DataStream.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,a),r.alreadyRead+=a,i.usedBytes+=a,this.stream.logBufferLevel()}},ISOFile.prototype.releaseSample=function(t,e){var i=t.samples[e];return i.data?(this.samplesDataSize-=i.size,i.data=null,i.alreadyRead=0,i.size):0},ISOFile.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},ISOFile.prototype.getCodecs=function(){var t,e="";for(t=0;t0&&(e+=","),e+=this.moov.traks[t].mdia.minf.stbl.stsd.entries[0].getCodec()}return e},ISOFile.prototype.getTrexById=function(t){var e;if(!this.moov||!this.moov.mvex)return null;for(e=0;e0&&(i.protection=a.ipro.protections[a.iinf.item_infos[t].protection_index-1]),a.iinf.item_infos[t].item_type?i.type=a.iinf.item_infos[t].item_type:i.type="mime",i.content_type=a.iinf.item_infos[t].content_type,i.content_encoding=a.iinf.item_infos[t].content_encoding,i.item_uri_type=a.iinf.item_infos[t].item_uri_type;if(a.grpl)for(t=0;t0&&p.property_index-1-1))return null;var n=(e=this.stream.buffers[a]).byteLength-(s.offset+s.alreadyRead-e.fileStart);if(!(s.length-s.alreadyRead<=n))return Log.debug("ISOFile","Getting item #"+t+" extent #"+r+" partial data (alreadyRead: "+s.alreadyRead+" offset: "+(s.offset+s.alreadyRead-e.fileStart)+" read size: "+n+" full extent size: "+s.length+" full item size: "+i.size+")"),DataStream.memcpy(i.data.buffer,i.alreadyRead,e,s.offset+s.alreadyRead-e.fileStart,n),s.alreadyRead+=n,i.alreadyRead+=n,e.usedBytes+=n,this.stream.logBufferLevel(),null;Log.debug("ISOFile","Getting item #"+t+" extent #"+r+" data (alreadyRead: "+s.alreadyRead+" offset: "+(s.offset+s.alreadyRead-e.fileStart)+" read size: "+(s.length-s.alreadyRead)+" full extent size: "+s.length+" full item size: "+i.size+")"),DataStream.memcpy(i.data.buffer,i.alreadyRead,e,s.offset+s.alreadyRead-e.fileStart,s.length-s.alreadyRead),e.usedBytes+=s.length-s.alreadyRead,this.stream.logBufferLevel(),i.alreadyRead+=s.length-s.alreadyRead,s.alreadyRead=s.length}}return i.alreadyRead===i.size?i:null},ISOFile.prototype.releaseItem=function(t){var e=this.items[t];if(e.data){this.itemsDataSize-=e.size,e.data=null,e.alreadyRead=0;for(var i=0;i0?this.moov.traks[t].samples[0].duration:0),e.push(r)}return e},BoxParser.Box.prototype.printHeader=function(t){this.size+=8,this.size>MAX_SIZE&&(this.size+=8),"uuid"===this.type&&(this.size+=16),t.log(t.indent+"size:"+this.size),t.log(t.indent+"type:"+this.type)},BoxParser.FullBox.prototype.printHeader=function(t){this.size+=4,BoxParser.Box.prototype.printHeader.call(this,t),t.log(t.indent+"version:"+this.version),t.log(t.indent+"flags:"+this.flags)},BoxParser.Box.prototype.print=function(t){this.printHeader(t)},BoxParser.ContainerBox.prototype.print=function(t){this.printHeader(t);for(var e=0;e>8)),t.log(t.indent+"matrix: "+this.matrix.join(", ")),t.log(t.indent+"next_track_id: "+this.next_track_id)},BoxParser.tkhdBox.prototype.print=function(t){BoxParser.FullBox.prototype.printHeader.call(this,t),t.log(t.indent+"creation_time: "+this.creation_time),t.log(t.indent+"modification_time: "+this.modification_time),t.log(t.indent+"track_id: "+this.track_id),t.log(t.indent+"duration: "+this.duration),t.log(t.indent+"volume: "+(this.volume>>8)),t.log(t.indent+"matrix: "+this.matrix.join(", ")),t.log(t.indent+"layer: "+this.layer),t.log(t.indent+"alternate_group: "+this.alternate_group),t.log(t.indent+"width: "+this.width),t.log(t.indent+"height: "+this.height)};var MP4Box={createFile:function(t,e){var i=void 0===t||t,r=new ISOFile(e);return r.discardMdatData=!i,r}};"undefined"!=typeof exports&&(exports.createFile=MP4Box.createFile); \ No newline at end of file diff --git a/public/assets/zhanKu.woff b/public/assets/zhanKu.woff new file mode 100644 index 0000000..1821172 Binary files /dev/null and b/public/assets/zhanKu.woff differ diff --git a/public/assets/zijie1.json b/public/assets/zijie1.json new file mode 100644 index 0000000..f6d19ba --- /dev/null +++ b/public/assets/zijie1.json @@ -0,0 +1,5248 @@ +[ + { + "scene": "多情感", + "name": "冷酷哥哥", + "voice_type": "zh_male_lengkugege_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "生气、冷漠、恐惧、开心、厌恶、中性、悲伤、沮丧", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "生气", + "value": "angry" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "开心", + "value": "happy" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "沮丧", + "value": "depressed" + } + ], + "vip": true, + "avatar": "/assets/avatars1/冷酷哥哥.png" + }, + { + "scene": "多情感", + "name": "甜心小美", + "voice_type": "zh_female_tianxinxiaomei_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "悲伤、恐惧、厌恶、中性", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/甜心小美.png" + }, + { + "scene": "多情感", + "name": "高冷御姐", + "voice_type": "zh_female_gaolengyujie_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心、悲伤、生气、惊讶、恐惧、厌恶、激动、冷漠、中性", + "tags": "剪映同款", + "ecov2": "高冷御姐 2.0", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/高冷御姐.png" + }, + { + "scene": "多情感", + "name": "傲娇霸总", + "voice_type": "zh_male_aojiaobazong_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "中性、开心、愤怒、厌恶", + "tags": "剪映同款", + "ecov2": "傲娇霸总 2.0", + "是否支持MIX": "否", + "emotions": [ + { + "name": "中性", + "value": "neutral" + }, + { + "name": "开心", + "value": "happy" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "厌恶", + "value": "hate" + } + ], + "vip": true, + "avatar": "/assets/avatars1/傲娇霸总.png" + }, + { + "scene": "多情感", + "name": "广州德哥", + "voice_type": "zh_male_guangzhoudege_emo_mars_bigtts", + "info": "中文", + "emostr": "生气、恐惧、中性", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [ + { + "name": "生气", + "value": "angry" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/广州德哥.png" + }, + { + "scene": "多情感", + "name": "京腔侃爷", + "voice_type": "zh_male_jingqiangkanye_emo_mars_bigtts", + "info": "中文", + "emostr": "开心、生气、惊讶、厌恶、中性", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/京腔侃爷.png" + }, + { + "scene": "多情感", + "name": "邻居阿姨", + "voice_type": "zh_female_linjuayi_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "中性、愤怒、冷漠、沮丧、惊讶", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "中性", + "value": "neutral" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "沮丧", + "value": "depressed" + }, + { + "name": "惊讶", + "value": "surprised" + } + ], + "vip": true, + "avatar": "/assets/avatars1/邻居阿姨.png" + }, + { + "scene": "多情感", + "name": "优柔公子", + "voice_type": "zh_male_yourougongzi_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心、生气、恐惧、厌恶、激动、中性、沮丧", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "沮丧", + "value": "depressed" + } + ], + "vip": true, + "avatar": "/assets/avatars1/优柔公子.png" + }, + { + "scene": "多情感", + "name": "儒雅男友", + "voice_type": "zh_male_ruyayichen_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心、悲伤、生气、恐惧、激动、冷漠、中性", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/儒雅男友.png" + }, + { + "scene": "多情感", + "name": "俊朗男友", + "voice_type": "zh_male_junlangnanyou_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心、悲伤、生气、惊讶、恐惧、中性", + "tags": "剪映同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/俊朗男友.png" + }, + { + "scene": "多情感", + "name": "北京小爷", + "voice_type": "zh_male_beijingxiaoye_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "生气,惊讶,恐惧,激动,冷漠,中性", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/北京小爷.png" + }, + { + "scene": "多情感", + "name": "柔美女友", + "voice_type": "zh_female_roumeinvyou_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心,悲伤,生气,惊讶,恐惧,厌恶,激动,冷漠,中性", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/柔美女友.png" + }, + { + "scene": "多情感", + "name": "阳光青年", + "voice_type": "zh_male_yangguangqingnian_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "开心,悲伤,生气,恐惧,激动,冷漠,中性", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/阳光青年.png" + }, + { + "scene": "多情感", + "name": "魅力女友", + "voice_type": "zh_female_meilinvyou_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "悲伤,恐惧,中性", + "tags": "", + "version": "v1", + "ecov2": "魅力女友 2.0", + "是否支持MIX": "否", + "emotions": [ + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/魅力女友.png" + }, + { + "scene": "多情感", + "name": "爽快思思", + "voice_type": "zh_female_shuangkuaisisi_emo_v2_mars_bigtts", + "info": "中文,英式英语", + "emostr": "开心,悲伤,生气,惊讶,激动,冷漠,中性", + "tags": "", + "version": "v1", + "ecov2": "爽快思思 2.0", + "是否支持MIX": "否", + "emotions": [ + { + "name": "开心", + "value": "happy" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "生气", + "value": "angry" + }, + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "中性", + "value": "neutral" + } + ], + "vip": true, + "avatar": "/assets/avatars1/爽快思思.png" + }, + { + "scene": "多情感", + "name": "Candice", + "voice_type": "en_female_candice_emo_v2_mars_bigtts", + "info": "美式英语", + "emostr": "深情、愤怒、ASMR、对话/闲聊、兴奋、愉悦、中性、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Candice.png" + }, + { + "scene": "多情感", + "name": "Serena", + "voice_type": "en_female_skye_emo_v2_mars_bigtts", + "info": "美式英语", + "emostr": "深情、愤怒、ASMR、对话/闲聊、兴奋、愉悦、中性、悲伤、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Charlie.png" + }, + { + "scene": "多情感", + "name": "Glen", + "voice_type": "en_male_glen_emo_v2_mars_bigtts", + "info": "美式英语", + "emostr": "深情、愤怒、ASMR、对话/闲聊、深情、兴奋、愉悦、中性、悲伤、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Glen.png" + }, + { + "scene": "多情感", + "name": "Sylus", + "voice_type": "en_male_sylus_emo_v2_mars_bigtts", + "info": "美式英语", + "emostr": "深情、愤怒、ASMR、权威、对话/闲聊、兴奋、愉悦、中性、悲伤、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "权威", + "value": "authoritative" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Sylus.png" + }, + { + "scene": "多情感", + "name": "Corey", + "voice_type": "en_male_corey_emo_v2_mars_bigtts", + "info": "英式英语", + "emostr": "愤怒、ASMR、权威、对话/闲聊、深情、兴奋、愉悦、中性、悲伤、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "权威", + "value": "authoritative" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Corey.png" + }, + { + "scene": "多情感", + "name": "Nadia", + "voice_type": "en_female_nadia_tips_emo_v2_mars_bigtts", + "info": "英式英语", + "emostr": "深情、愤怒、ASMR、对话/闲聊、深情、兴奋、愉悦、中性、悲伤、温暖", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [ + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "愤怒", + "value": "angry" + }, + { + "name": "ASMR", + "value": "ASMR" + }, + { + "name": "对话/闲聊", + "value": "chat" + }, + { + "name": "深情", + "value": "affectionate" + }, + { + "name": "兴奋", + "value": "excited" + }, + { + "name": "愉悦", + "value": "happy" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "温暖", + "value": "warm" + } + ], + "vip": true, + "avatar": "/assets/avatars1/Nadia.png" + }, + { + "scene": "多情感", + "name": "深夜播客", + "voice_type": "zh_male_shenyeboke_emo_v2_mars_bigtts", + "info": "中文", + "emostr": "惊讶、悲伤、中性、厌恶、开心、恐惧、激动、沮丧、冷漠、生气", + "tags": "猫箱同款", + "ecov2": "深夜播客 2.0", + "是否支持MIX": "否", + "emotions": [ + { + "name": "惊讶", + "value": "surprised" + }, + { + "name": "悲伤", + "value": "sad" + }, + { + "name": "中性", + "value": "neutral" + }, + { + "name": "厌恶", + "value": "hate" + }, + { + "name": "开心", + "value": "happy" + }, + { + "name": "恐惧", + "value": "fear" + }, + { + "name": "激动", + "value": "excited" + }, + { + "name": "沮丧", + "value": "depressed" + }, + { + "name": "冷漠", + "value": "coldness" + }, + { + "name": "生气", + "value": "angry" + } + ], + "vip": true, + "avatar": "/assets/avatars1/深夜播客.png" + }, + { + "scene": "教育场景", + "name": "Tina老师", + "voice_type": "zh_female_yingyujiaoyu_mars_bigtts", + "info": "中文,英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "Tina老师 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Tina老师.png" + }, + { + "scene": "通用场景", + "name": "温柔女神", + "voice_type": "ICL_zh_female_wenrounvshen_239eff5e8ffa_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔女神.png" + }, + { + "scene": "通用场景", + "name": "Vivi", + "voice_type": "zh_female_vv_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "Vivi 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Vivi.png" + }, + { + "scene": "通用场景", + "name": "亲切女声", + "voice_type": "zh_female_qinqienvsheng_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "亲切女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/亲切女声.png" + }, + { + "scene": "通用场景", + "name": "机灵小伙", + "voice_type": "ICL_zh_male_shenmi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/机灵小伙.png" + }, + { + "scene": "通用场景", + "name": "元气甜妹", + "voice_type": "ICL_zh_female_wuxi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/元气甜妹.png" + }, + { + "scene": "通用场景", + "name": "知心姐姐", + "voice_type": "ICL_zh_female_wenyinvsheng_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/知心姐姐.png" + }, + { + "scene": "通用场景", + "name": "阳光阿辰", + "voice_type": "zh_male_qingyiyuxuan_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/阳光阿辰.png" + }, + { + "scene": "通用场景", + "name": "快乐小东", + "voice_type": "zh_male_xudong_conversation_wvae_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "快乐小东 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/快乐小东.png" + }, + { + "scene": "通用场景", + "name": "冷酷哥哥", + "voice_type": "ICL_zh_male_lengkugege_v1_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷酷哥哥.png" + }, + { + "scene": "通用场景", + "name": "纯澈女生", + "voice_type": "ICL_zh_female_feicui_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/纯澈女生.png" + }, + { + "scene": "通用场景", + "name": "初恋女友", + "voice_type": "ICL_zh_female_yuxin_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/初恋女友.png" + }, + { + "scene": "通用场景", + "name": "贴心闺蜜", + "voice_type": "ICL_zh_female_xnx_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心闺蜜.png" + }, + { + "scene": "通用场景", + "name": "温柔白月光", + "voice_type": "ICL_zh_female_yry_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔白月光.png" + }, + { + "scene": "通用场景", + "name": "炀炀", + "voice_type": "ICL_zh_male_BV705_streaming_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars2/小天.png" + }, + { + "scene": "通用场景", + "name": "开朗学长", + "voice_type": "en_male_jason_conversation_wvae_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "开朗学长 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗学长.png" + }, + { + "scene": "通用场景", + "name": "魅力苏菲", + "voice_type": "zh_female_sophie_conversation_wvae_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "魅力苏菲 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/魅力苏菲.png" + }, + { + "scene": "通用场景", + "name": "贴心妹妹", + "voice_type": "ICL_zh_female_yilin_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心妹妹.png" + }, + { + "scene": "通用场景", + "name": "甜美桃子", + "voice_type": "zh_female_tianmeitaozi_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "甜美桃子 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美桃子.png" + }, + { + "scene": "通用场景", + "name": "清新女声", + "voice_type": "zh_female_qingxinnvsheng_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "清新女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清新女声.png" + }, + { + "scene": "通用场景", + "name": "知性女声", + "voice_type": "zh_female_zhixingnvsheng_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "知性女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/知性女声.png" + }, + { + "scene": "通用场景", + "name": "清爽男大", + "voice_type": "zh_male_qingshuangnanda_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "清爽男大 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清爽男大.png" + }, + { + "scene": "通用场景", + "name": "邻家女孩", + "voice_type": "zh_female_linjianvhai_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "邻家女孩 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/邻家女孩.png" + }, + { + "scene": "通用场景", + "name": "渊博小叔", + "voice_type": "zh_male_yuanboxiaoshu_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "渊博小叔 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/渊博小叔.png" + }, + { + "scene": "通用场景", + "name": "阳光青年", + "voice_type": "zh_male_yangguangqingnian_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "阳光青年 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/阳光青年.png" + }, + { + "scene": "通用场景", + "name": "甜美小源", + "voice_type": "zh_female_tianmeixiaoyuan_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "甜美小源 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美小源.png" + }, + { + "scene": "通用场景", + "name": "清澈梓梓", + "voice_type": "zh_female_qingchezizi_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "清澈梓梓 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清澈梓梓.png" + }, + { + "scene": "通用场景", + "name": "解说小明", + "voice_type": "zh_male_jieshuoxiaoming_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "解说小明 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/解说小明.png" + }, + { + "scene": "通用场景", + "name": "开朗姐姐", + "voice_type": "zh_female_kailangjiejie_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "开朗姐姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗姐姐.png" + }, + { + "scene": "通用场景", + "name": "邻家男孩", + "voice_type": "zh_male_linjiananhai_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "邻家男孩 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/邻家男孩.png" + }, + { + "scene": "通用场景", + "name": "甜美悦悦", + "voice_type": "zh_female_tianmeiyueyue_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "甜美悦悦 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美悦悦.png" + }, + { + "scene": "通用场景", + "name": "心灵鸡汤", + "voice_type": "zh_female_xinlingjitang_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "心灵鸡汤 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/心灵鸡汤.png" + }, + { + "scene": "通用场景", + "name": "知性温婉", + "voice_type": "ICL_zh_female_zhixingwenwan_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/知性温婉.png" + }, + { + "scene": "通用场景", + "name": "暖心体贴", + "voice_type": "ICL_zh_male_nuanxintitie_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/暖心体贴.png" + }, + { + "scene": "通用场景", + "name": "开朗轻快", + "voice_type": "ICL_zh_male_kailangqingkuai_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗轻快.png" + }, + { + "scene": "通用场景", + "name": "活泼爽朗", + "voice_type": "ICL_zh_male_huoposhuanglang_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活泼爽朗.png" + }, + { + "scene": "通用场景", + "name": "率真小伙", + "voice_type": "ICL_zh_male_shuaizhenxiaohuo_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/率真小伙.png" + }, + { + "scene": "通用场景", + "name": "温柔小哥", + "voice_type": "zh_male_wenrouxiaoge_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "温柔小哥 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔小哥.png" + }, + { + "scene": "通用场景", + "name": "灿灿/Shiny", + "voice_type": "zh_female_cancan_mars_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "知性灿灿 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/灿灿.png" + }, + { + "scene": "通用场景", + "name": "爽快思思/Skye", + "voice_type": "zh_female_shuangkuaisisi_moon_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "爽快思思 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/爽快思思.png" + }, + { + "scene": "通用场景", + "name": "温暖阿虎/Alvin", + "voice_type": "zh_male_wennuanahu_moon_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "温暖阿虎/Alvin 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温暖阿虎.png" + }, + { + "scene": "通用场景", + "name": "少年梓辛/Brayan", + "voice_type": "zh_male_shaonianzixin_moon_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "少年梓辛/Brayan 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/少年梓辛.png" + }, + { + "scene": "通用场景、S2S-SC", + "name": "温柔文雅", + "voice_type": "ICL_zh_female_wenrouwenya_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔文雅.png" + }, + { + "scene": "IP仿音", + "name": "沪普男", + "voice_type": "zh_male_hupunan_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/沪普男.png" + }, + { + "scene": "IP仿音", + "name": "鲁班七号", + "voice_type": "zh_male_lubanqihao_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "鲁班七号 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/鲁班七号.png" + }, + { + "scene": "IP仿音", + "name": "林潇", + "voice_type": "zh_female_yangmi_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "林潇 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/林潇.png" + }, + { + "scene": "IP仿音", + "name": "玲玲姐姐", + "voice_type": "zh_female_linzhiling_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "玲玲姐姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/玲玲姐姐.png" + }, + { + "scene": "IP仿音", + "name": "春日部姐姐", + "voice_type": "zh_female_jiyejizi2_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "春日部姐姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/春日部姐姐.png" + }, + { + "scene": "IP仿音", + "name": "唐僧", + "voice_type": "zh_male_tangseng_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "抖音同款、豆包同款", + "ecov2": "唐僧 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/唐僧.png" + }, + { + "scene": "IP仿音", + "name": "庄周", + "voice_type": "zh_male_zhuangzhou_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款", + "ecov2": "庄周 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/庄周.png" + }, + { + "scene": "IP仿音", + "name": "猪八戒", + "voice_type": "zh_male_zhubajie_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、豆包同款", + "ecov2": "猪八戒 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/猪八戒.png" + }, + { + "scene": "IP仿音", + "name": "感冒电音姐姐", + "voice_type": "zh_female_ganmaodianyin_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款", + "ecov2": "感冒电音姐姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/感冒电音姐姐.png" + }, + { + "scene": "IP仿音", + "name": "直率英子", + "voice_type": "zh_female_naying_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "直率英子 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/直率英子.png" + }, + { + "scene": "IP仿音", + "name": "女雷神", + "voice_type": "zh_female_leidian_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、豆包同款", + "ecov2": "女雷神 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/女雷神.png" + }, + { + "scene": "趣味口音", + "name": "粤语小溏", + "voice_type": "zh_female_yueyunv_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/粤语小溏.png" + }, + { + "scene": "趣味口音", + "name": "豫州子轩", + "voice_type": "zh_male_yuzhouzixuan_moon_bigtts", + "info": "中文-河南口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/豫州子轩.png" + }, + { + "scene": "趣味口音", + "name": "呆萌川妹", + "voice_type": "zh_female_daimengchuanmei_moon_bigtts", + "info": "中文-四川口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/呆萌川妹.png" + }, + { + "scene": "趣味口音", + "name": "广西远舟", + "voice_type": "zh_male_guangxiyuanzhou_moon_bigtts", + "info": "中文-广西口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/广西远舟.png" + }, + { + "scene": "趣味口音", + "name": "双节棍小哥", + "voice_type": "zh_male_zhoujielun_emo_v2_mars_bigtts", + "info": "中文-台湾口音", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "", + "是否支持MIX": "否", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/双节棍小哥.png" + }, + { + "scene": "趣味口音", + "name": "湾湾小何", + "voice_type": "zh_female_wanwanxiaohe_moon_bigtts", + "info": "中文-台湾口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "小何 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/湾湾小何.png" + }, + { + "scene": "趣味口音", + "name": "湾区大叔", + "voice_type": "zh_female_wanqudashu_moon_bigtts", + "info": "中文-广东口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/湾区大叔.png" + }, + { + "scene": "趣味口音", + "name": "广州德哥", + "voice_type": "zh_male_guozhoudege_moon_bigtts", + "info": "中文-广东口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/广州德哥.png" + }, + { + "scene": "趣味口音", + "name": "浩宇小哥", + "voice_type": "zh_male_haoyuxiaoge_moon_bigtts", + "info": "中文-青岛口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/浩宇小哥.png" + }, + { + "scene": "趣味口音", + "name": "北京小爷", + "voice_type": "zh_male_beijingxiaoye_moon_bigtts", + "info": "中文-北京口音", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/北京小爷.png" + }, + { + "scene": "趣味口音", + "name": "京腔侃爷/Harmony", + "voice_type": "zh_male_jingqiangkanye_moon_bigtts", + "info": "中文-北京口音,美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/京腔侃爷.png" + }, + { + "scene": "趣味口音", + "name": "妹坨洁儿", + "voice_type": "zh_female_meituojieer_moon_bigtts", + "info": "中文-长沙口音", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/妹坨洁儿.png" + }, + { + "scene": "角色扮演", + "name": "纯真少女", + "voice_type": "ICL_zh_female_chunzhenshaonv_e588402fb8ad_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/纯真少女.png" + }, + { + "scene": "角色扮演", + "name": "奶气小生", + "voice_type": "ICL_zh_male_xiaonaigou_edf58cf28b8b_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/奶气小生.png" + }, + { + "scene": "角色扮演", + "name": "精灵向导", + "voice_type": "ICL_zh_female_jinglingxiangdao_1beb294a9e3e_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/精灵向导.png" + }, + { + "scene": "角色扮演", + "name": "闷油瓶小哥", + "voice_type": "ICL_zh_male_menyoupingxiaoge_ffed9fc2fee7_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/闷油瓶小哥.png" + }, + { + "scene": "角色扮演", + "name": "黯刃秦主", + "voice_type": "ICL_zh_male_anrenqinzhu_cd62e63dcdab_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/黯刃秦主.png" + }, + { + "scene": "角色扮演", + "name": "霸道总裁", + "voice_type": "ICL_zh_male_badaozongcai_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/霸道总裁.png" + }, + { + "scene": "角色扮演", + "name": "妩媚可人", + "voice_type": "ICL_zh_female_ganli_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/妩媚可人.png" + }, + { + "scene": "角色扮演", + "name": "邪魅御姐", + "voice_type": "ICL_zh_female_xiangliangya_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/邪魅御姐.png" + }, + { + "scene": "角色扮演", + "name": "嚣张小哥", + "voice_type": "ICL_zh_male_ms_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/嚣张小哥.png" + }, + { + "scene": "角色扮演", + "name": "油腻大叔", + "voice_type": "ICL_zh_male_you_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/油腻大叔.png" + }, + { + "scene": "角色扮演", + "name": "孤傲公子", + "voice_type": "ICL_zh_male_guaogongzi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/孤傲公子.png" + }, + { + "scene": "角色扮演", + "name": "胡子叔叔", + "voice_type": "ICL_zh_male_huzi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/胡子叔叔.png" + }, + { + "scene": "角色扮演", + "name": "性感魅惑", + "voice_type": "ICL_zh_female_luoqing_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/性感魅惑.png" + }, + { + "scene": "角色扮演", + "name": "病弱公子", + "voice_type": "ICL_zh_male_bingruogongzi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病弱公子.png" + }, + { + "scene": "角色扮演", + "name": "邪魅女王", + "voice_type": "ICL_zh_female_bingjiao3_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/邪魅女王.png" + }, + { + "scene": "角色扮演", + "name": "傲慢青年", + "voice_type": "ICL_zh_male_aomanqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲慢青年.png" + }, + { + "scene": "角色扮演", + "name": "醋精男生", + "voice_type": "ICL_zh_male_cujingnansheng_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/醋精男生.png" + }, + { + "scene": "角色扮演", + "name": "爽朗少年", + "voice_type": "ICL_zh_male_shuanglangshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/爽朗少年.png" + }, + { + "scene": "角色扮演", + "name": "撒娇男友", + "voice_type": "ICL_zh_male_sajiaonanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/撒娇男友.png" + }, + { + "scene": "角色扮演", + "name": "温柔男友", + "voice_type": "ICL_zh_male_wenrounanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔男友.png" + }, + { + "scene": "角色扮演", + "name": "温顺少年", + "voice_type": "ICL_zh_male_wenshunshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温顺少年.png" + }, + { + "scene": "角色扮演", + "name": "粘人男友", + "voice_type": "ICL_zh_male_naigounanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/粘人男友.png" + }, + { + "scene": "角色扮演", + "name": "撒娇男生", + "voice_type": "ICL_zh_male_sajiaonansheng_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/撒娇男生.png" + }, + { + "scene": "角色扮演", + "name": "活泼男友", + "voice_type": "ICL_zh_male_huoponanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活泼男友.png" + }, + { + "scene": "角色扮演", + "name": "甜系男友", + "voice_type": "ICL_zh_male_tianxinanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜系男友.png" + }, + { + "scene": "角色扮演", + "name": "活力青年", + "voice_type": "ICL_zh_male_huoliqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活力青年.png" + }, + { + "scene": "角色扮演", + "name": "开朗青年", + "voice_type": "ICL_zh_male_kailangqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗青年.png" + }, + { + "scene": "角色扮演", + "name": "冷漠兄长", + "voice_type": "ICL_zh_male_lengmoxiongzhang_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷漠兄长.png" + }, + { + "scene": "角色扮演", + "name": "天才同桌", + "voice_type": "ICL_zh_male_tiancaitongzhuo_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/天才同桌.png" + }, + { + "scene": "角色扮演", + "name": "翩翩公子", + "voice_type": "ICL_zh_male_pianpiangongzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/翩翩公子.png" + }, + { + "scene": "角色扮演", + "name": "懵懂青年", + "voice_type": "ICL_zh_male_mengdongqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/懵懂青年.png" + }, + { + "scene": "角色扮演", + "name": "冷脸兄长", + "voice_type": "ICL_zh_male_lenglianxiongzhang_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷脸兄长.png" + }, + { + "scene": "角色扮演", + "name": "病娇少年", + "voice_type": "ICL_zh_male_bingjiaoshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇少年.png" + }, + { + "scene": "角色扮演", + "name": "病娇男友", + "voice_type": "ICL_zh_male_bingjiaonanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇男友.png" + }, + { + "scene": "角色扮演", + "name": "病弱少年", + "voice_type": "ICL_zh_male_bingruoshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病弱少年.png" + }, + { + "scene": "角色扮演", + "name": "意气少年", + "voice_type": "ICL_zh_male_yiqishaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/意气少年.png" + }, + { + "scene": "角色扮演", + "name": "干净少年", + "voice_type": "ICL_zh_male_ganjingshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/干净少年.png" + }, + { + "scene": "角色扮演", + "name": "冷漠男友", + "voice_type": "ICL_zh_male_lengmonanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷漠男友.png" + }, + { + "scene": "角色扮演", + "name": "精英青年", + "voice_type": "ICL_zh_male_jingyingqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/精英青年.png" + }, + { + "scene": "角色扮演", + "name": "热血少年", + "voice_type": "ICL_zh_male_rexueshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/热血少年.png" + }, + { + "scene": "角色扮演", + "name": "清爽少年", + "voice_type": "ICL_zh_male_qingshuangshaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清爽少年.png" + }, + { + "scene": "角色扮演", + "name": "中二青年", + "voice_type": "ICL_zh_male_zhongerqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/中二青年.png" + }, + { + "scene": "角色扮演", + "name": "凌云青年", + "voice_type": "ICL_zh_male_lingyunqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/凌云青年.png" + }, + { + "scene": "角色扮演", + "name": "自负青年", + "voice_type": "ICL_zh_male_zifuqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/自负青年.png" + }, + { + "scene": "角色扮演", + "name": "不羁青年", + "voice_type": "ICL_zh_male_bujiqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/不羁青年.png" + }, + { + "scene": "角色扮演", + "name": "儒雅君子", + "voice_type": "ICL_zh_male_ruyajunzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/儒雅君子.png" + }, + { + "scene": "角色扮演", + "name": "低音沉郁", + "voice_type": "ICL_zh_male_diyinchenyu_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/低音沉郁.png" + }, + { + "scene": "角色扮演", + "name": "冷脸学霸", + "voice_type": "ICL_zh_male_lenglianxueba_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷脸学霸.png" + }, + { + "scene": "角色扮演", + "name": "儒雅总裁", + "voice_type": "ICL_zh_male_ruyazongcai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/儒雅总裁.png" + }, + { + "scene": "角色扮演", + "name": "深沉总裁", + "voice_type": "ICL_zh_male_shenchenzongcai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/深沉总裁.png" + }, + { + "scene": "角色扮演", + "name": "小侯爷", + "voice_type": "ICL_zh_male_xiaohouye_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/小侯爷.png" + }, + { + "scene": "角色扮演", + "name": "孤高公子", + "voice_type": "ICL_zh_male_gugaogongzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/孤高公子.png" + }, + { + "scene": "角色扮演", + "name": "仗剑君子", + "voice_type": "ICL_zh_male_zhangjianjunzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/仗剑君子.png" + }, + { + "scene": "角色扮演", + "name": "温润学者", + "voice_type": "ICL_zh_male_wenrunxuezhe_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温润学者.png" + }, + { + "scene": "角色扮演", + "name": "亲切青年", + "voice_type": "ICL_zh_male_qinqieqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/亲切青年.png" + }, + { + "scene": "角色扮演", + "name": "温柔学长", + "voice_type": "ICL_zh_male_wenrouxuezhang_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔学长.png" + }, + { + "scene": "角色扮演", + "name": "高冷总裁", + "voice_type": "ICL_zh_male_gaolengzongcai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/高冷总裁.png" + }, + { + "scene": "角色扮演", + "name": "冷峻高智", + "voice_type": "ICL_zh_male_lengjungaozhi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷峻高智.png" + }, + { + "scene": "角色扮演", + "name": "孱弱少爷", + "voice_type": "ICL_zh_male_chanruoshaoye_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/孱弱少爷.png" + }, + { + "scene": "角色扮演", + "name": "自信青年", + "voice_type": "ICL_zh_male_zixinqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/自信青年.png" + }, + { + "scene": "角色扮演", + "name": "青涩青年", + "voice_type": "ICL_zh_male_qingseqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/青涩青年.png" + }, + { + "scene": "角色扮演", + "name": "学霸同桌", + "voice_type": "ICL_zh_male_xuebatongzhuo_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/学霸同桌.png" + }, + { + "scene": "角色扮演", + "name": "冷傲总裁", + "voice_type": "ICL_zh_male_lengaozongcai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷傲总裁.png" + }, + { + "scene": "角色扮演", + "name": "元气少年", + "voice_type": "ICL_zh_male_yuanqishaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/元气少年.png" + }, + { + "scene": "角色扮演", + "name": "洒脱青年", + "voice_type": "ICL_zh_male_satuoqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/洒脱青年.png" + }, + { + "scene": "角色扮演", + "name": "直率青年", + "voice_type": "ICL_zh_male_zhishuaiqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/直率青年.png" + }, + { + "scene": "角色扮演", + "name": "斯文青年", + "voice_type": "ICL_zh_male_siwenqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/斯文青年.png" + }, + { + "scene": "角色扮演", + "name": "俊逸公子", + "voice_type": "ICL_zh_male_junyigongzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/俊逸公子.png" + }, + { + "scene": "角色扮演", + "name": "仗剑侠客", + "voice_type": "ICL_zh_male_zhangjianxiake_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/仗剑侠客.png" + }, + { + "scene": "角色扮演", + "name": "机甲智能", + "voice_type": "ICL_zh_male_jijiaozhineng_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/机甲智能.png" + }, + { + "scene": "角色扮演", + "name": "奶气萌娃", + "voice_type": "zh_male_naiqimengwa_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款、豆包同款", + "ecov2": "奶气萌娃 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/奶气萌娃.png" + }, + { + "scene": "角色扮演", + "name": "婆婆", + "voice_type": "zh_female_popo_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "婆婆 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/婆婆.png" + }, + { + "scene": "角色扮演", + "name": "高冷御姐", + "voice_type": "zh_female_gaolengyujie_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "高冷御姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/高冷御姐.png" + }, + { + "scene": "角色扮演", + "name": "傲娇霸总", + "voice_type": "zh_male_aojiaobazong_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "傲娇霸总 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲娇霸总.png" + }, + { + "scene": "角色扮演", + "name": "魅力女友", + "voice_type": "zh_female_meilinvyou_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "魅力女友 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/魅力女友.png" + }, + { + "scene": "角色扮演", + "name": "深夜播客", + "voice_type": "zh_male_shenyeboke_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "深夜播客 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/深夜播客.png" + }, + { + "scene": "角色扮演", + "name": "柔美女友", + "voice_type": "zh_female_sajiaonvyou_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "柔美女友 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/柔美女友.png" + }, + { + "scene": "角色扮演", + "name": "撒娇学妹", + "voice_type": "zh_female_yuanqinvyou_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款、剪映同款", + "ecov2": "撒娇学妹 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/撒娇学妹.png" + }, + { + "scene": "角色扮演", + "name": "病弱少女", + "voice_type": "ICL_zh_female_bingruoshaonv_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病弱少女.png" + }, + { + "scene": "角色扮演", + "name": "活泼女孩", + "voice_type": "ICL_zh_female_huoponvhai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活泼女孩.png" + }, + { + "scene": "角色扮演", + "name": "东方浩然", + "voice_type": "zh_male_dongfanghaoran_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "东方浩然 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/东方浩然.png" + }, + { + "scene": "角色扮演", + "name": "绿茶小哥", + "voice_type": "ICL_zh_male_lvchaxiaoge_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/绿茶小哥.png" + }, + { + "scene": "角色扮演", + "name": "娇弱萝莉", + "voice_type": "ICL_zh_female_jiaoruoluoli_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/娇弱萝莉.png" + }, + { + "scene": "角色扮演", + "name": "冷淡疏离", + "voice_type": "ICL_zh_male_lengdanshuli_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷淡疏离.png" + }, + { + "scene": "角色扮演", + "name": "憨厚敦实", + "voice_type": "ICL_zh_male_hanhoudunshi_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/憨厚敦实.png" + }, + { + "scene": "角色扮演", + "name": "活泼刁蛮", + "voice_type": "ICL_zh_female_huopodiaoman_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活泼刁蛮.png" + }, + { + "scene": "角色扮演", + "name": "固执病娇", + "voice_type": "ICL_zh_male_guzhibingjiao_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/固执病娇.png" + }, + { + "scene": "角色扮演", + "name": "撒娇粘人", + "voice_type": "ICL_zh_male_sajiaonianren_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/撒娇粘人.png" + }, + { + "scene": "角色扮演", + "name": "傲慢娇声", + "voice_type": "ICL_zh_female_aomanjiaosheng_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲慢娇声.png" + }, + { + "scene": "角色扮演", + "name": "潇洒随性", + "voice_type": "ICL_zh_male_xiaosasuixing_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/潇洒随性.png" + }, + { + "scene": "角色扮演", + "name": "诡异神秘", + "voice_type": "ICL_zh_male_guiyishenmi_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/诡异神秘.png" + }, + { + "scene": "角色扮演", + "name": "儒雅才俊", + "voice_type": "ICL_zh_male_ruyacaijun_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/儒雅才俊.png" + }, + { + "scene": "角色扮演", + "name": "正直青年", + "voice_type": "ICL_zh_male_zhengzhiqingnian_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/正直青年.png" + }, + { + "scene": "角色扮演", + "name": "娇憨女王", + "voice_type": "ICL_zh_female_jiaohannvwang_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/娇憨女王.png" + }, + { + "scene": "角色扮演", + "name": "病娇萌妹", + "voice_type": "ICL_zh_female_bingjiaomengmei_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇萌妹.png" + }, + { + "scene": "角色扮演", + "name": "青涩小生", + "voice_type": "ICL_zh_male_qingsenaigou_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/青涩小生.png" + }, + { + "scene": "角色扮演", + "name": "纯真学弟", + "voice_type": "ICL_zh_male_chunzhenxuedi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/纯真学弟.png" + }, + { + "scene": "角色扮演", + "name": "优柔帮主", + "voice_type": "ICL_zh_male_youroubangzhu_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/优柔帮主.png" + }, + { + "scene": "角色扮演", + "name": "优柔公子", + "voice_type": "ICL_zh_male_yourougongzi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/优柔公子.png" + }, + { + "scene": "角色扮演", + "name": "调皮公主", + "voice_type": "ICL_zh_female_tiaopigongzhu_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/调皮公主.png" + }, + { + "scene": "角色扮演", + "name": "贴心男友", + "voice_type": "ICL_zh_male_tiexinnanyou_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心男友.png" + }, + { + "scene": "角色扮演", + "name": "少年将军", + "voice_type": "ICL_zh_male_shaonianjiangjun_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/少年将军.png" + }, + { + "scene": "角色扮演", + "name": "病娇哥哥", + "voice_type": "ICL_zh_male_bingjiaogege_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇哥哥.png" + }, + { + "scene": "角色扮演", + "name": "学霸男同桌", + "voice_type": "ICL_zh_male_xuebanantongzhuo_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/学霸男同桌.png" + }, + { + "scene": "角色扮演", + "name": "幽默叔叔", + "voice_type": "ICL_zh_male_youmoshushu_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/幽默叔叔.png" + }, + { + "scene": "角色扮演", + "name": "假小子", + "voice_type": "ICL_zh_female_jiaxiaozi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/假小子.png" + }, + { + "scene": "角色扮演", + "name": "温柔男同桌", + "voice_type": "ICL_zh_male_wenrounantongzhuo_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔男同桌.png" + }, + { + "scene": "角色扮演", + "name": "幽默大爷", + "voice_type": "ICL_zh_male_youmodaye_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/幽默大爷.png" + }, + { + "scene": "角色扮演", + "name": "枕边低语", + "voice_type": "ICL_zh_male_asmryexiu_tob", + "info": "中文", + "emostr": "", + "tags": "抖音同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/枕边低语.png" + }, + { + "scene": "角色扮演", + "name": "神秘法师", + "voice_type": "ICL_zh_male_shenmifashi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/神秘法师.png" + }, + { + "scene": "角色扮演", + "name": "娇喘女声", + "voice_type": "zh_female_jiaochuan_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款", + "ecov2": "娇喘女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/娇喘女声.png" + }, + { + "scene": "角色扮演", + "name": "开朗弟弟", + "voice_type": "zh_male_livelybro_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款", + "ecov2": "开朗弟弟 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗弟弟.png" + }, + { + "scene": "角色扮演", + "name": "谄媚女声", + "voice_type": "zh_female_flattery_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "剪映同款、抖音同款", + "ecov2": "谄媚女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/谄媚女声.png" + }, + { + "scene": "角色扮演", + "name": "冷峻上司", + "voice_type": "ICL_zh_male_lengjunshangsi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷峻上司.png" + }, + { + "scene": "角色扮演", + "name": "寡言小哥", + "voice_type": "ICL_zh_male_xiaoge_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/冷淡疏离.png" + }, + { + "scene": "角色扮演", + "name": "清朗温润", + "voice_type": "ICL_zh_male_renyuwangzi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清朗温润.png" + }, + { + "scene": "角色扮演", + "name": "潇洒随性", + "voice_type": "ICL_zh_male_xiaosha_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/潇洒随性.png" + }, + { + "scene": "角色扮演", + "name": "清冷矜贵", + "voice_type": "ICL_zh_male_liyisheng_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清冷矜贵.png" + }, + { + "scene": "角色扮演", + "name": "沉稳优雅", + "voice_type": "ICL_zh_male_qinglen_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/沉稳优雅.png" + }, + { + "scene": "角色扮演", + "name": "清逸苏感", + "voice_type": "ICL_zh_male_chongqingzhanzhan_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清逸苏感.png" + }, + { + "scene": "角色扮演", + "name": "温柔内敛", + "voice_type": "ICL_zh_male_xingjiwangzi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔内敛.png" + }, + { + "scene": "角色扮演", + "name": "低沉缠绻", + "voice_type": "ICL_zh_male_sigeshiye_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/低沉缠绻.png" + }, + { + "scene": "角色扮演", + "name": "蓝银草魂师", + "voice_type": "ICL_zh_male_lanyingcaohunshi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/蓝银草魂师.png" + }, + { + "scene": "角色扮演", + "name": "清冷高雅", + "voice_type": "ICL_zh_female_liumengdie_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清冷高雅.png" + }, + { + "scene": "角色扮演", + "name": "甜美娇俏", + "voice_type": "ICL_zh_female_linxueying_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美娇俏.png" + }, + { + "scene": "角色扮演", + "name": "柔骨魂师", + "voice_type": "ICL_zh_female_rouguhunshi_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/柔骨魂师.png" + }, + { + "scene": "角色扮演", + "name": "甜美活泼", + "voice_type": "ICL_zh_female_tianmei_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美活泼.png" + }, + { + "scene": "角色扮演", + "name": "成熟温柔", + "voice_type": "ICL_zh_female_chengshu_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/成熟温柔.png" + }, + { + "scene": "角色扮演", + "name": "贴心闺蜜", + "voice_type": "ICL_zh_female_xnx_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心闺蜜.png" + }, + { + "scene": "角色扮演", + "name": "温柔白月光", + "voice_type": "ICL_zh_female_yry_v1_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔白月光.png" + }, + { + "scene": "角色扮演", + "name": "高冷沉稳", + "voice_type": "zh_male_bv139_audiobook_ummv3_bigtts", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "高冷沉稳 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/高冷沉稳.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "醋精男友", + "voice_type": "ICL_zh_male_cujingnanyou_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/醋精男友.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "风发少年", + "voice_type": "ICL_zh_male_fengfashaonian_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/风发少年.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "磁性男嗓", + "voice_type": "ICL_zh_male_cixingnansang_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/磁性男嗓.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "成熟总裁", + "voice_type": "ICL_zh_male_chengshuzongcai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/成熟总裁.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "傲娇精英", + "voice_type": "ICL_zh_male_aojiaojingying_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲娇精英.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "傲娇公子", + "voice_type": "ICL_zh_male_aojiaogongzi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲娇公子.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "霸道少爷", + "voice_type": "ICL_zh_male_badaoshaoye_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/霸道少爷.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "腹黑公子", + "voice_type": "ICL_zh_male_fuheigongzi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/腹黑公子.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "暖心学姐", + "voice_type": "ICL_zh_female_nuanxinxuejie_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/暖心学姐.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "可爱女生", + "voice_type": "ICL_zh_female_keainvsheng_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/可爱女生.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "成熟姐姐", + "voice_type": "ICL_zh_female_chengshujiejie_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/成熟姐姐.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "病娇姐姐", + "voice_type": "ICL_zh_female_bingjiaojiejie_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇姐姐.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "妩媚御姐", + "voice_type": "ICL_zh_female_wumeiyujie_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/妩媚御姐.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "傲娇女友", + "voice_type": "ICL_zh_female_aojiaonvyou_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲娇女友.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "贴心女友", + "voice_type": "ICL_zh_female_tiexinnvyou_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心女友.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "性感御姐", + "voice_type": "ICL_zh_female_xingganyujie_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/性感御姐.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "病娇弟弟", + "voice_type": "ICL_zh_male_bingjiaodidi_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇弟弟.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "傲慢少爷", + "voice_type": "ICL_zh_male_aomanshaoye_tob", + "info": "中文", + "emostr": "", + "tags": "豆包同款、猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲慢少爷.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "傲气凌人", + "voice_type": "ICL_zh_male_aiqilingren_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/傲气凌人.png" + }, + { + "scene": "角色扮演、S2S-SC", + "name": "病娇白莲", + "voice_type": "ICL_zh_male_bingjiaobailian_tob", + "info": "中文", + "emostr": "", + "tags": "猫箱同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/病娇白莲.png" + }, + { + "scene": "多语种", + "name": "Lauren", + "voice_type": "en_female_lauren_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Lauren.png" + }, + { + "scene": "多语种", + "name": "EnergeticMaleII", + "voice_type": "en_male_campaign_jamal_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/EnergeticMaleII.png" + }, + { + "scene": "多语种", + "name": "GothamHero", + "voice_type": "en_male_chris_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/GothamHero.png" + }, + { + "scene": "多语种", + "name": "FlirtyFemale", + "voice_type": "en_female_product_darcie_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/FlirtyFemale.png" + }, + { + "scene": "多语种", + "name": "PeacefulFemale", + "voice_type": "en_female_emotional_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/PeacefulFemale.png" + }, + { + "scene": "多语种", + "name": "Nara", + "voice_type": "en_female_nara_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Nara.png" + }, + { + "scene": "多语种", + "name": "Bruce", + "voice_type": "en_male_bruce_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Bruce.png" + }, + { + "scene": "多语种", + "name": "Michael", + "voice_type": "en_male_michael_moon_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Michael.png" + }, + { + "scene": "多语种", + "name": "Cartoon Chef", + "voice_type": "ICL_en_male_cc_sha_v1_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Cartoon Chef.png" + }, + { + "scene": "多语种", + "name": "Lucas", + "voice_type": "zh_male_M100_conversation_wvae_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Lucas.png" + }, + { + "scene": "多语种", + "name": "Sophie", + "voice_type": "zh_female_sophie_conversation_wvae_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Sophie.png" + }, + { + "scene": "多语种", + "name": "Daisy", + "voice_type": "en_female_dacey_conversation_wvae_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Daisy.png" + }, + { + "scene": "多语种", + "name": "Owen", + "voice_type": "en_male_charlie_conversation_wvae_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Owen.png" + }, + { + "scene": "多语种", + "name": "Luna", + "voice_type": "en_female_sarah_new_conversation_wvae_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Luna.png" + }, + { + "scene": "多语种", + "name": "Michael", + "voice_type": "ICL_en_male_michael_tob", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Michael.png" + }, + { + "scene": "多语种", + "name": "Charlie", + "voice_type": "ICL_en_female_cc_cm_v1_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Charlie.png" + }, + { + "scene": "多语种", + "name": "Big Boogie", + "voice_type": "ICL_en_male_oogie2_tob", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Big Boogie.png" + }, + { + "scene": "多语种", + "name": "Frosty Man", + "voice_type": "ICL_en_male_frosty1_tob", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Frosty Man.png" + }, + { + "scene": "多语种", + "name": "The Grinch", + "voice_type": "ICL_en_male_grinch2_tob", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/The Grinch.png" + }, + { + "scene": "多语种", + "name": "Zayne", + "voice_type": "ICL_en_male_zayne_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Zayne.png" + }, + { + "scene": "多语种", + "name": "Jigsaw", + "voice_type": "ICL_en_male_cc_jigsaw_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Jigsaw.png" + }, + { + "scene": "多语种", + "name": "Chucky", + "voice_type": "ICL_en_male_cc_chucky_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Chucky.png" + }, + { + "scene": "多语种", + "name": "Clown Man", + "voice_type": "ICL_en_male_cc_penny_v1_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Clown Man.png" + }, + { + "scene": "多语种", + "name": "Kevin McCallister", + "voice_type": "ICL_en_male_kevin2_tob", + "info": "美式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Kevin McCallister.png" + }, + { + "scene": "多语种", + "name": "Xavier", + "voice_type": "ICL_en_male_xavier1_v1_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Xavier.png" + }, + { + "scene": "多语种", + "name": "Noah", + "voice_type": "ICL_en_male_cc_dracula_v1_tob", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Noah.png" + }, + { + "scene": "多语种", + "name": "Adam", + "voice_type": "en_male_adam_mars_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Adam.png" + }, + { + "scene": "多语种", + "name": "Amanda", + "voice_type": "en_female_amanda_mars_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Amanda.png" + }, + { + "scene": "多语种", + "name": "Jackson", + "voice_type": "en_male_jackson_mars_bigtts", + "info": "美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Jackson.png" + }, + { + "scene": "多语种", + "name": "DelicateGirl", + "voice_type": "en_female_daisy_moon_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/DelicateGirl.png" + }, + { + "scene": "多语种", + "name": "Dave", + "voice_type": "en_male_dave_moon_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Dave.png" + }, + { + "scene": "多语种", + "name": "Hades", + "voice_type": "en_male_hades_moon_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Hades.png" + }, + { + "scene": "多语种", + "name": "Onez", + "voice_type": "en_female_onez_moon_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Onez.png" + }, + { + "scene": "多语种", + "name": "Emily", + "voice_type": "en_female_emily_mars_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Emily.png" + }, + { + "scene": "多语种", + "name": "Daniel", + "voice_type": "zh_male_xudong_conversation_wvae_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "豆包同款", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Daniel.png" + }, + { + "scene": "多语种", + "name": "Alastor", + "voice_type": "ICL_en_male_cc_alastor_tob", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Alastor.png" + }, + { + "scene": "多语种", + "name": "Smith", + "voice_type": "en_male_smith_mars_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Smith.png" + }, + { + "scene": "多语种", + "name": "Anna", + "voice_type": "en_female_anna_mars_bigtts", + "info": "英式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Anna.png" + }, + { + "scene": "多语种", + "name": "Ethan", + "voice_type": "ICL_en_male_aussie_v1_tob", + "info": "澳洲英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Ethan.png" + }, + { + "scene": "多语种", + "name": "Sarah", + "voice_type": "en_female_sarah_mars_bigtts", + "info": "澳洲英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Sarah.png" + }, + { + "scene": "多语种", + "name": "Dryw", + "voice_type": "en_male_dryw_mars_bigtts", + "info": "澳洲英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/Dryw.png" + }, + { + "scene": "客服场景", + "name": "理性圆子", + "voice_type": "ICL_zh_female_lixingyuanzi_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/理性圆子.png" + }, + { + "scene": "客服场景", + "name": "清甜桃桃", + "voice_type": "ICL_zh_female_qingtiantaotao_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清甜桃桃.png" + }, + { + "scene": "客服场景", + "name": "清晰小雪", + "voice_type": "ICL_zh_female_qingxixiaoxue_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清晰小雪.png" + }, + { + "scene": "客服场景", + "name": "清甜莓莓", + "voice_type": "ICL_zh_female_qingtianmeimei_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清甜莓莓.png" + }, + { + "scene": "客服场景", + "name": "开朗婷婷", + "voice_type": "ICL_zh_female_kailangtingting_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开朗婷婷.png" + }, + { + "scene": "客服场景", + "name": "清新沐沐", + "voice_type": "ICL_zh_male_qingxinmumu_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "清新沐沐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清新沐沐.png" + }, + { + "scene": "客服场景", + "name": "爽朗小阳", + "voice_type": "ICL_zh_male_shuanglangxiaoyang_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/爽朗小阳.png" + }, + { + "scene": "客服场景", + "name": "清新波波", + "voice_type": "ICL_zh_male_qingxinbobo_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/清新波波.png" + }, + { + "scene": "客服场景", + "name": "温婉珊珊", + "voice_type": "ICL_zh_female_wenwanshanshan_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "温婉珊珊 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温婉珊珊.png" + }, + { + "scene": "客服场景", + "name": "甜美小雨", + "voice_type": "ICL_zh_female_tianmeixiaoyu_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美小雨.png" + }, + { + "scene": "客服场景", + "name": "热情艾娜", + "voice_type": "ICL_zh_female_reqingaina_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "热情艾娜 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/热情艾娜.png" + }, + { + "scene": "客服场景", + "name": "甜美小橘", + "voice_type": "ICL_zh_female_tianmeixiaoju_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/甜美小橘.png" + }, + { + "scene": "客服场景", + "name": "沉稳明仔", + "voice_type": "ICL_zh_male_chenwenmingzai_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/沉稳明仔.png" + }, + { + "scene": "客服场景", + "name": "亲切小卓", + "voice_type": "ICL_zh_male_qinqiexiaozhuo_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/亲切小卓.png" + }, + { + "scene": "客服场景", + "name": "灵动欣欣", + "voice_type": "ICL_zh_female_lingdongxinxin_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/灵动欣欣.png" + }, + { + "scene": "客服场景", + "name": "乖巧可儿", + "voice_type": "ICL_zh_female_guaiqiaokeer_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/乖巧可儿.png" + }, + { + "scene": "客服场景", + "name": "暖心茜茜", + "voice_type": "ICL_zh_female_nuanxinqianqian_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/暖心茜茜.png" + }, + { + "scene": "客服场景", + "name": "软萌团子", + "voice_type": "ICL_zh_female_ruanmengtuanzi_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/软萌团子.png" + }, + { + "scene": "客服场景", + "name": "阳光洋洋", + "voice_type": "ICL_zh_male_yangguangyangyang_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/阳光洋洋.png" + }, + { + "scene": "客服场景", + "name": "软萌糖糖", + "voice_type": "ICL_zh_female_ruanmengtangtang_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/软萌糖糖.png" + }, + { + "scene": "客服场景", + "name": "秀丽倩倩", + "voice_type": "ICL_zh_female_xiuliqianqian_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/秀丽倩倩.png" + }, + { + "scene": "客服场景", + "name": "开心小鸿", + "voice_type": "ICL_zh_female_kaixinxiaohong_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/开心小鸿.png" + }, + { + "scene": "客服场景", + "name": "轻盈朵朵", + "voice_type": "ICL_zh_female_qingyingduoduo_cs_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "轻盈朵朵 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/轻盈朵朵.png" + }, + { + "scene": "客服场景", + "name": "暖阳女声", + "voice_type": "zh_female_kefunvsheng_mars_bigtts", + "info": "仅中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "暖阳女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/暖阳女声.png" + }, + { + "scene": "视频配音", + "name": "悠悠君子", + "voice_type": "zh_male_M100_conversation_wvae_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "悠悠君子 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/悠悠君子.png" + }, + { + "scene": "视频配音", + "name": "文静毛毛", + "voice_type": "zh_female_maomao_conversation_wvae_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "文静毛毛 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/文静毛毛.png" + }, + { + "scene": "视频配音", + "name": "倾心少女", + "voice_type": "ICL_zh_female_qiuling_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/倾心少女.png" + }, + { + "scene": "视频配音", + "name": "醇厚低音", + "voice_type": "ICL_zh_male_buyan_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/醇厚低音.png" + }, + { + "scene": "视频配音", + "name": "咆哮小哥", + "voice_type": "ICL_zh_male_BV144_paoxiaoge_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/咆哮小哥.png" + }, + { + "scene": "视频配音", + "name": "和蔼奶奶", + "voice_type": "ICL_zh_female_heainainai_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/和蔼奶奶.png" + }, + { + "scene": "视频配音", + "name": "邻居阿姨", + "voice_type": "ICL_zh_female_linjuayi_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/邻居阿姨.png" + }, + { + "scene": "视频配音", + "name": "温柔小雅", + "voice_type": "zh_female_wenrouxiaoya_moon_bigtts", + "info": "中文", + "emostr": "", + "tags": "豆包同款", + "ecov2": "温柔小雅 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔小雅.png" + }, + { + "scene": "视频配音", + "name": "天才童声", + "voice_type": "zh_male_tiancaitongsheng_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "天才童声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/天才童声.png" + }, + { + "scene": "视频配音", + "name": "猴哥", + "voice_type": "zh_male_sunwukong_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "猴哥 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/猴哥.png" + }, + { + "scene": "视频配音", + "name": "熊二", + "voice_type": "zh_male_xionger_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "熊二 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/熊二.png" + }, + { + "scene": "视频配音", + "name": "佩奇猪", + "voice_type": "zh_female_peiqi_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "佩奇猪 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/佩奇猪.png" + }, + { + "scene": "视频配音", + "name": "武则天", + "voice_type": "zh_female_wuzetian_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款", + "ecov2": "武则天 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/武则天.png" + }, + { + "scene": "视频配音", + "name": "顾姐", + "voice_type": "zh_female_gujie_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "抖音同款、剪映同款", + "ecov2": "顾姐 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/顾姐.png" + }, + { + "scene": "视频配音", + "name": "樱桃丸子", + "voice_type": "zh_female_yingtaowanzi_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "樱桃丸子 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/樱桃丸子.png" + }, + { + "scene": "视频配音", + "name": "广告解说", + "voice_type": "zh_male_chunhui_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款", + "ecov2": "广告解说 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/广告解说.png" + }, + { + "scene": "视频配音", + "name": "少儿故事", + "voice_type": "zh_female_shaoergushi_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "少儿故事 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/少儿故事.png" + }, + { + "scene": "视频配音", + "name": "四郎", + "voice_type": "zh_male_silang_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "抖音同款、剪映同款、豆包同款", + "ecov2": "四郎 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/四郎.png" + }, + { + "scene": "视频配音", + "name": "俏皮女声", + "voice_type": "zh_female_qiaopinvsheng_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "俏皮女声 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/俏皮女声.png" + }, + { + "scene": "视频配音", + "name": "懒音绵宝", + "voice_type": "zh_male_lanxiaoyang_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "懒音绵宝 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/懒音绵宝.png" + }, + { + "scene": "视频配音", + "name": "亮嗓萌仔", + "voice_type": "zh_male_dongmanhaimian_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "亮嗓萌仔 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/亮嗓萌仔.png" + }, + { + "scene": "视频配音", + "name": "磁性解说男声/Morgan", + "voice_type": "zh_male_jieshuonansheng_mars_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "抖音同款、剪映同款", + "ecov2": "磁性解说男声/Morgan 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/磁性解说男声.png" + }, + { + "scene": "视频配音", + "name": "鸡汤妹妹/Hope", + "voice_type": "zh_female_jitangmeimei_mars_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "抖音同款、豆包同款", + "ecov2": "鸡汤妹妹/Hope 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/鸡汤妹妹.png" + }, + { + "scene": "视频配音", + "name": "贴心女声/Candy", + "voice_type": "zh_female_tiexinnvsheng_mars_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "贴心女声/Candy 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/贴心女声.png" + }, + { + "scene": "视频配音", + "name": "萌丫头/Cutey", + "voice_type": "zh_female_mengyatou_mars_bigtts", + "info": "中文,美式英语", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "萌丫头/Cutey 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/萌丫头.png" + }, + { + "scene": "有声阅读", + "name": "内敛才俊", + "voice_type": "ICL_zh_male_neiliancaijun_e991be511569_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/内敛才俊.png" + }, + { + "scene": "有声阅读", + "name": "温暖少年", + "voice_type": "ICL_zh_male_yangyang_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温暖少年.png" + }, + { + "scene": "有声阅读", + "name": "儒雅公子", + "voice_type": "ICL_zh_male_flc_v1_tob", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/儒雅公子.png" + }, + { + "scene": "有声阅读", + "name": "悬疑解说", + "voice_type": "zh_male_changtianyi_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "剪映同款、抖音同款、豆包同款", + "ecov2": "悬疑解说 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/悬疑解说.png" + }, + { + "scene": "有声阅读", + "name": "儒雅青年", + "voice_type": "zh_male_ruyaqingnian_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "番茄小说同款、豆包同款、剪映同款", + "ecov2": "儒雅青年 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/儒雅青年.png" + }, + { + "scene": "有声阅读", + "name": "霸气青叔", + "voice_type": "zh_male_baqiqingshu_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "番茄小说同款、豆包同款、剪映同款", + "ecov2": "霸气青叔 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/霸气青叔.png" + }, + { + "scene": "有声阅读", + "name": "擎苍", + "voice_type": "zh_male_qingcang_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "番茄小说同款、剪映同款、豆包同款、抖音同款", + "ecov2": "擎苍 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/擎苍.png" + }, + { + "scene": "有声阅读", + "name": "活力小哥", + "voice_type": "zh_male_yangguangqingnian_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "活力小哥 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/活力小哥.png" + }, + { + "scene": "有声阅读", + "name": "古风少御", + "voice_type": "zh_female_gufengshaoyu_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "古风少御 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/古风少御.png" + }, + { + "scene": "有声阅读", + "name": "温柔淑女", + "voice_type": "zh_female_wenroushunv_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "番茄小说同款、豆包同款、剪映同款", + "ecov2": "温柔淑女 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/温柔淑女.png" + }, + { + "scene": "有声阅读", + "name": "反卷青年", + "voice_type": "zh_male_fanjuanqingnian_mars_bigtts", + "info": "中文", + "emostr": "", + "tags": "", + "version": "v1", + "ecov2": "反卷青年 2.0", + "是否支持MIX": "是", + "emotions": [], + "vip": true, + "avatar": "/assets/avatars1/反卷青年.png" + } +] diff --git a/public/assets/zijie2.json b/public/assets/zijie2.json new file mode 100644 index 0000000..0759981 --- /dev/null +++ b/public/assets/zijie2.json @@ -0,0 +1,920 @@ +[ + { + "scene": "通用场景", + "name": "Vivi 2.0", + "voice_type": "zh_female_vv_uranus_bigtts", + "info": "中文、日文、印尼、墨西哥西班牙语\n方言: 四川、陕西、东北", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/Vivi.png" + }, + { + "scene": "通用场景", + "name": "小何 2.0", + "voice_type": "zh_female_xiaohe_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/湾湾小何.png" + }, + { + "scene": "通用场景", + "name": "云舟 2.0", + "voice_type": "zh_male_m191_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/云舟.png" + }, + { + "scene": "通用场景", + "name": "小天 2.0", + "voice_type": "zh_male_taocheng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/小天.png" + }, + { + "scene": "通用场景", + "name": "刘飞 2.0", + "voice_type": "zh_male_liufei_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/刘飞.png" + }, + { + "scene": "通用场景", + "name": "魅力苏菲 2.0", + "voice_type": "zh_female_sophie_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/魅力苏菲.png" + }, + { + "scene": "通用场景", + "name": "清新女声 2.0", + "voice_type": "zh_female_qingxinnvsheng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/清新女声.png" + }, + { + "scene": "角色扮演", + "name": "知性灿灿 2.0", + "voice_type": "zh_female_cancan_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/灿灿.png" + }, + { + "scene": "角色扮演", + "name": "撒娇学妹 2.0", + "voice_type": "zh_female_sajiaoxuemei_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/撒娇学妹.png" + }, + { + "scene": "通用场景", + "name": "甜美小源 2.0", + "voice_type": "zh_female_tianmeixiaoyuan_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/甜美小源.png" + }, + { + "scene": "通用场景", + "name": "甜美桃子 2.0", + "voice_type": "zh_female_tianmeitaozi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/甜美桃子.png" + }, + { + "scene": "通用场景", + "name": "爽快思思 2.0", + "voice_type": "zh_female_shuangkuaisisi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/爽快思思.png" + }, + { + "scene": "视频配音", + "name": "佩奇猪 2.0", + "voice_type": "zh_female_peiqi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/佩奇猪.png" + }, + { + "scene": "通用场景", + "name": "邻家女孩 2.0", + "voice_type": "zh_female_linjianvhai_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/邻家女孩.png" + }, + { + "scene": "通用场景", + "name": "少年梓辛/Brayan 2.0", + "voice_type": "zh_male_shaonianzixin_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/少年梓辛.png" + }, + { + "scene": "视频配音", + "name": "猴哥 2.0", + "voice_type": "zh_male_sunwukong_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/猴哥.png" + }, + { + "scene": "教育场景", + "name": "Tina老师 2.0", + "voice_type": "zh_female_yingyujiaoxue_uranus_bigtts", + "info": "中文、英式英语", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/Tina老师.png" + }, + { + "scene": "客服场景", + "name": "暖阳女声 2.0", + "voice_type": "zh_female_kefunvsheng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/暖阳女声.png" + }, + { + "scene": "有声阅读", + "name": "儿童绘本 2.0", + "voice_type": "zh_female_xiaoxue_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/儿童绘本.png" + }, + { + "scene": "视频配音", + "name": "大壹 2.0", + "voice_type": "zh_male_dayi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/大壹.png" + }, + { + "scene": "视频配音", + "name": "黑猫侦探社咪仔 2.0", + "voice_type": "zh_female_mizai_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/黑猫侦探社咪仔.png" + }, + { + "scene": "视频配音", + "name": "鸡汤女 2.0", + "voice_type": "zh_female_jitangnv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/鸡汤女.png" + }, + { + "scene": "通用场景", + "name": "魅力女友 2.0", + "voice_type": "zh_female_meilinvyou_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/魅力女友.png" + }, + { + "scene": "视频配音", + "name": "流畅女声 2.0", + "voice_type": "zh_female_liuchangnv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/流畅女声.png" + }, + { + "scene": "视频配音", + "name": "儒雅逸辰 2.0", + "voice_type": "zh_male_ruyayichen_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/儒雅逸辰.png" + }, + { + "scene": "多语种", + "name": "Tim", + "voice_type": "en_male_tim_uranus_bigtts", + "info": "美式英语", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/Tina老师.png" + }, + { + "scene": "多语种", + "name": "Dacey", + "voice_type": "en_female_dacey_uranus_bigtts", + "info": "美式英语", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/Dacey.png" + }, + { + "scene": "多语种", + "name": "Stokie", + "voice_type": "en_female_stokie_uranus_bigtts", + "info": "美式英语", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/Stokie.png" + }, + { + "scene": "通用场景", + "name": "温柔妈妈 2.0", + "voice_type": "zh_female_wenroumama_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/知性女声.png" + }, + { + "scene": "通用场景", + "name": "解说小明 2.0", + "voice_type": "zh_male_jieshuoxiaoming_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/解说小明.png" + }, + { + "scene": "通用场景", + "name": "TVB女声 2.0", + "voice_type": "zh_female_tvbnv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/TVB女声.png" + }, + { + "scene": "通用场景", + "name": "译制片男 2.0", + "voice_type": "zh_male_yizhipiannan_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/译制片男.png" + }, + { + "scene": "通用场景", + "name": "俏皮女声 2.0", + "voice_type": "zh_female_qiaopinv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/俏皮女声.png" + }, + { + "scene": "角色扮演", + "name": "直率英子 2.0", + "voice_type": "zh_female_zhishuaiyingzi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/直率英子.png" + }, + { + "scene": "通用场景", + "name": "邻家男孩 2.0", + "voice_type": "zh_male_linjiananhai_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/邻家男孩.png" + }, + { + "scene": "角色扮演", + "name": "四郎 2.0", + "voice_type": "zh_male_silang_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/四郎.png" + }, + { + "scene": "通用场景", + "name": "儒雅青年 2.0", + "voice_type": "zh_male_ruyaqingnian_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/儒雅青年.png" + }, + { + "scene": "角色扮演", + "name": "擎苍 2.0", + "voice_type": "zh_male_qingcang_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/擎苍.png" + }, + { + "scene": "角色扮演", + "name": "熊二 2.0", + "voice_type": "zh_male_xionger_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/熊二.png" + }, + { + "scene": "角色扮演", + "name": "樱桃丸子 2.0", + "voice_type": "zh_female_yingtaowanzi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/樱桃丸子.png" + }, + { + "scene": "通用场景", + "name": "温暖阿虎/Alvin 2.0", + "voice_type": "zh_male_wennuanahu_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/温暖阿虎.png" + }, + { + "scene": "通用场景", + "name": "奶气萌娃 2.0", + "voice_type": "zh_male_naiqimengwa_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/奶气萌娃.png" + }, + { + "scene": "通用场景", + "name": "婆婆 2.0", + "voice_type": "zh_female_popo_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/婆婆.png" + }, + { + "scene": "通用场景", + "name": "高冷御姐 2.0", + "voice_type": "zh_female_gaolengyujie_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/高冷御姐.png" + }, + { + "scene": "通用场景", + "name": "傲娇霸总 2.0", + "voice_type": "zh_male_aojiaobazong_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/傲娇霸总.png" + }, + { + "scene": "角色扮演", + "name": "懒音绵宝 2.0", + "voice_type": "zh_male_lanyinmianbao_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/懒音绵宝.png" + }, + { + "scene": "通用场景", + "name": "反卷青年 2.0", + "voice_type": "zh_male_fanjuanqingnian_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/反卷青年.png" + }, + { + "scene": "通用场景", + "name": "温柔淑女 2.0", + "voice_type": "zh_female_wenroushunv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/温柔淑女.png" + }, + { + "scene": "角色扮演", + "name": "古风少御 2.0", + "voice_type": "zh_female_gufengshaoyu_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/庄周.png" + }, + { + "scene": "通用场景", + "name": "活力小哥 2.0", + "voice_type": "zh_male_huolixiaoge_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/活力小哥.png" + }, + { + "scene": "有声阅读", + "name": "霸气青叔 2.0", + "voice_type": "zh_male_baqiqingshu_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/霸气青叔.png" + }, + { + "scene": "有声阅读", + "name": "悬疑解说 2.0", + "voice_type": "zh_male_xuanyijieshuo_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/悬疑解说.png" + }, + { + "scene": "通用场景", + "name": "萌丫头/Cutey 2.0", + "voice_type": "zh_female_mengyatou_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/萌丫头.png" + }, + { + "scene": "通用场景", + "name": "贴心女声/Candy 2.0", + "voice_type": "zh_female_tiexinnvsheng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/贴心女声.png" + }, + { + "scene": "通用场景", + "name": "鸡汤妹妹/Hope 2.0", + "voice_type": "zh_female_jitangmei_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/鸡汤妹妹.png" + }, + { + "scene": "通用场景", + "name": "磁性解说男声/Morgan 2.0", + "voice_type": "zh_male_cixingjieshuonan_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/磁性解说男声.png" + }, + { + "scene": "通用场景", + "name": "亮嗓萌仔 2.0", + "voice_type": "zh_male_liangsangmengzai_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/亮嗓萌仔.png" + }, + { + "scene": "通用场景", + "name": "开朗姐姐 2.0", + "voice_type": "zh_female_kailangjiejie_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/开朗姐姐.png" + }, + { + "scene": "通用场景", + "name": "高冷沉稳 2.0", + "voice_type": "zh_male_gaolengchenwen_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/渊博小叔.png" + }, + { + "scene": "通用场景", + "name": "深夜播客 2.0", + "voice_type": "zh_male_shenyeboke_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/深夜播客.png" + }, + { + "scene": "角色扮演", + "name": "鲁班七号 2.0", + "voice_type": "zh_male_lubanqihao_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/鲁班七号.png" + }, + { + "scene": "通用场景", + "name": "娇喘女声 2.0", + "voice_type": "zh_female_jiaochuannv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/娇喘女声.png" + }, + { + "scene": "角色扮演", + "name": "林潇 2.0", + "voice_type": "zh_female_linxiao_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/林潇.png" + }, + { + "scene": "角色扮演", + "name": "玲玲姐姐 2.0", + "voice_type": "zh_female_lingling_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/玲玲姐姐.png" + }, + { + "scene": "角色扮演", + "name": "春日部姐姐 2.0", + "voice_type": "zh_female_chunribu_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/春日部姐姐.png" + }, + { + "scene": "角色扮演", + "name": "唐僧 2.0", + "voice_type": "zh_male_tangseng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/唐僧.png" + }, + { + "scene": "角色扮演", + "name": "庄周 2.0", + "voice_type": "zh_male_zhuangzhou_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/庄周.png" + }, + { + "scene": "通用场景", + "name": "开朗弟弟 2.0", + "voice_type": "zh_male_kailangdidi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/开朗弟弟.png" + }, + { + "scene": "角色扮演", + "name": "猪八戒 2.0", + "voice_type": "zh_male_zhubajie_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/猪八戒.png" + }, + { + "scene": "角色扮演", + "name": "感冒电音姐姐 2.0", + "voice_type": "zh_female_ganmaodianyin_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/感冒电音姐姐.png" + }, + { + "scene": "通用场景", + "name": "谄媚女声 2.0", + "voice_type": "zh_female_chanmeinv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/谄媚女声.png" + }, + { + "scene": "角色扮演", + "name": "女雷神 2.0", + "voice_type": "zh_female_nvleishen_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/女雷神.png" + }, + { + "scene": "通用场景", + "name": "亲切女声 2.0", + "voice_type": "zh_female_qinqienv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/亲切女声.png" + }, + { + "scene": "通用场景", + "name": "快乐小东 2.0", + "voice_type": "zh_male_kuailexiaodong_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/快乐小东.png" + }, + { + "scene": "通用场景", + "name": "开朗学长 2.0", + "voice_type": "zh_male_kailangxuezhang_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/开朗学长.png" + }, + { + "scene": "通用场景", + "name": "悠悠君子 2.0", + "voice_type": "zh_male_youyoujunzi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/悠悠君子.png" + }, + { + "scene": "通用场景", + "name": "文静毛毛 2.0", + "voice_type": "zh_female_wenjingmaomao_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/文静毛毛.png" + }, + { + "scene": "通用场景", + "name": "知性女声 2.0", + "voice_type": "zh_female_zhixingnv_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/知性女声.png" + }, + { + "scene": "通用场景", + "name": "清爽男大 2.0", + "voice_type": "zh_male_qingshuangnanda_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/清爽男大.png" + }, + { + "scene": "通用场景", + "name": "渊博小叔 2.0", + "voice_type": "zh_male_yuanboxiaoshu_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/渊博小叔.png" + }, + { + "scene": "通用场景", + "name": "阳光青年 2.0", + "voice_type": "zh_male_yangguangqingnian_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/阳光青年.png" + }, + { + "scene": "通用场景", + "name": "清澈梓梓 2.0", + "voice_type": "zh_female_qingchezizi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/清澈梓梓.png" + }, + { + "scene": "通用场景", + "name": "甜美悦悦 2.0", + "voice_type": "zh_female_tianmeiyueyue_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/甜美悦悦.png" + }, + { + "scene": "通用场景", + "name": "心灵鸡汤 2.0", + "voice_type": "zh_female_xinlingjitang_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/心灵鸡汤.png" + }, + { + "scene": "通用场景", + "name": "温柔小哥 2.0", + "voice_type": "zh_male_wenrouxiaoge_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/温柔小哥.png" + }, + { + "scene": "通用场景", + "name": "柔美女友 2.0", + "voice_type": "zh_female_roumeinvyou_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/柔美女友.png" + }, + { + "scene": "通用场景", + "name": "东方浩然 2.0", + "voice_type": "zh_male_dongfanghaoran_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/东方浩然.png" + }, + { + "scene": "通用场景", + "name": "温柔小雅 2.0", + "voice_type": "zh_female_wenrouxiaoya_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/温柔小雅.png" + }, + { + "scene": "通用场景", + "name": "天才童声 2.0", + "voice_type": "zh_male_tiancaitongsheng_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/天才童声.png" + }, + { + "scene": "角色扮演", + "name": "武则天 2.0", + "voice_type": "zh_female_wuzetian_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/武则天.png" + }, + { + "scene": "角色扮演", + "name": "顾姐 2.0", + "voice_type": "zh_female_gujie_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/顾姐.png" + }, + { + "scene": "通用场景", + "name": "广告解说 2.0", + "voice_type": "zh_male_guanggaojieshuo_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/广告解说.png" + }, + { + "scene": "有声阅读", + "name": "少儿故事 2.0", + "voice_type": "zh_female_shaoergushi_uranus_bigtts", + "info": "中文", + "vip": true, + "skill": "情感变化、指令遵循、ASMR", + "avatar": "/assets/avatars2/少儿故事.png" + }, + { + "scene": "角色扮演", + "name": "调皮公主", + "voice_type": "saturn_zh_female_tiaopigongzhu_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循、COT/QA功能", + "avatar": "/assets/avatars2/调皮公主.png" + }, + { + "scene": "角色扮演", + "name": "可爱女生", + "voice_type": "saturn_zh_female_keainvsheng_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循、COT/QA功能", + "avatar": "/assets/avatars2/可爱女生.png" + }, + { + "scene": "角色扮演", + "name": "爽朗少年", + "voice_type": "saturn_zh_male_shuanglangshaonian_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循、COT/QA功能", + "avatar": "/assets/avatars2/爽朗少年.png" + }, + { + "scene": "角色扮演", + "name": "天才同桌", + "voice_type": "saturn_zh_male_tiancaitongzhuo_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循、COT/QA功能", + "avatar": "/assets/avatars2/天才同桌.png" + }, + { + "scene": "角色扮演", + "name": "知性灿灿", + "voice_type": "saturn_zh_female_cancan_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循、COT/QA功能", + "avatar": "/assets/avatars2/灿灿.png" + }, + { + "scene": "客服场景", + "name": "轻盈朵朵 2.0", + "voice_type": "saturn_zh_female_qingyingduoduo_cs_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循", + "avatar": "/assets/avatars2/轻盈朵朵.png" + }, + { + "scene": "客服场景", + "name": "温婉珊珊 2.0", + "voice_type": "saturn_zh_female_wenwanshanshan_cs_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循", + "avatar": "/assets/avatars2/温婉珊珊.png" + }, + { + "scene": "客服场景", + "name": "热情艾娜 2.0", + "voice_type": "saturn_zh_female_reqingaina_cs_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循", + "avatar": "/assets/avatars2/热情艾娜.png" + }, + { + "scene": "客服场景", + "name": "清新沐沐 2.0", + "voice_type": "saturn_zh_male_qingxinmumu_cs_tob", + "info": "中文", + "vip": true, + "skill": "指令遵循", + "avatar": "/assets/avatars2/清新沐沐.png" + } +] diff --git a/public/assets/zijieVoices.json b/public/assets/zijieVoices.json new file mode 100644 index 0000000..45b726a --- /dev/null +++ b/public/assets/zijieVoices.json @@ -0,0 +1,1097 @@ +[ + { + "type": "", + "name": "通用场景", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Shiny.png", + "voice_type": "灿灿/Shiny", + "temp": false, + "info": "√", + "language": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Shiny.mp3" + }, + { + "type": "", + "name": "清新女声", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/清新女声.png", + "voice_type": "zh_female_qingxinnvsheng_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/清新女声.mp3" + }, + { + "type": "", + "name": "邻家小妹/Lily", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Lily.png", + "voice_type": "zh_female_linjia_mars_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Lily.mp3" + }, + { + "type": "", + "name": "爽快思思/Skye", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Skye.png", + "voice_type": "zh_female_shuangkuaisisi_moon_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Skye.mp3" + }, + { + "type": "", + "name": "温暖阿虎/Alvin", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Alvin.png", + "voice_type": "zh_male_wennuanahu_moon_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Alvin.mp3" + }, + { + "type": "", + "name": "少年梓辛/Brayan", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Brayan.png", + "voice_type": "zh_male_shaonianzixin_moon_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Brayan.mp3" + }, + { + "type": "", + "name": "知性女声", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/知性女声.png", + "voice_type": "zh_female_zhixingnvsheng_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/知性女声.mp3" + }, + { + "type": "", + "name": "清爽男大", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/清爽男大.png", + "voice_type": "zh_male_qingshuangnanda_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/清爽男大.mp3" + }, + { + "type": "", + "name": "邻家女孩", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/邻家女孩.png", + "voice_type": "zh_female_linjianvhai_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/邻家女孩.mp3" + }, + { + "type": "", + "name": "渊博小叔", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/渊博小叔.png", + "voice_type": "zh_male_yuanboxiaoshu_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/渊博小叔.mp3" + }, + { + "type": "", + "name": "阳光青年", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/阳光青年.png", + "voice_type": "zh_male_yangguangqingnian_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/阳光青年.mp3" + }, + { + "type": "", + "name": "甜美小源", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/甜美小源.png", + "voice_type": "zh_female_tianmeixiaoyuan_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/甜美小源.mp3" + }, + { + "type": "", + "name": "清澈梓梓", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/清澈梓梓.png", + "voice_type": "zh_female_qingchezizi_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/清澈梓梓.mp3" + }, + { + "type": "", + "name": "解说小明", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/解说小明.png", + "voice_type": "zh_male_jieshuoxiaoming_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/解说小明.mp3" + }, + { + "type": "", + "name": "开朗姐姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/开朗姐姐.png", + "voice_type": "zh_female_kailangjiejie_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/开朗姐姐.mp3" + }, + { + "type": "", + "name": "邻家男孩", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/邻家男孩.png", + "voice_type": "zh_male_linjiananhai_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/邻家男孩.mp3" + }, + { + "type": "", + "name": "甜美悦悦", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/甜美悦悦.png", + "voice_type": "zh_female_tianmeiyueyue_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/甜美悦悦.mp3" + }, + { + "type": "", + "name": "心灵鸡汤", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/心灵鸡汤.png", + "voice_type": "zh_female_xinlingjitang_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/心灵鸡汤.mp3" + }, + { + "type": "", + "name": "知性温婉", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/知性温婉.png", + "voice_type": "ICL_zh_female_zhixingwenwan_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/知性温婉.mp3" + }, + { + "type": "", + "name": "暖心体贴", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/暖心体贴.png", + "voice_type": "ICL_zh_male_nuanxintitie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/暖心体贴.mp3" + }, + { + "type": "", + "name": "温柔文雅", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/温柔文雅.png", + "voice_type": "ICL_zh_female_wenrouwenya_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/温柔文雅.mp3" + }, + { + "type": "", + "name": "开朗轻快", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/开朗轻快.png", + "voice_type": "ICL_zh_male_kailangqingkuai_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/开朗轻快.mp3" + }, + { + "type": "", + "name": "活泼爽朗", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/活泼爽朗.png", + "voice_type": "ICL_zh_male_huoposhuanglang_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/活泼爽朗.mp3" + }, + { + "type": "", + "name": "率真小伙", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/率真小伙.png", + "voice_type": "ICL_zh_male_shuaizhenxiaohuo_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/率真小伙.mp3" + }, + { + "type": "", + "name": "多语种", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Smith.png", + "voice_type": "Smith", + "temp": false, + "info": "√", + "language": "英式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Smith.mp3" + }, + { + "type": "", + "name": "Anna", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Anna.png", + "voice_type": "en_female_anna_mars_bigtts", + "temp": false, + "info": "英式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Anna.mp3" + }, + { + "type": "", + "name": "Adam", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Adam.png", + "voice_type": "en_male_adam_mars_bigtts", + "temp": false, + "info": "美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Adam.mp3" + }, + { + "type": "", + "name": "Sarah", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Sarah.png", + "voice_type": "en_female_sarah_mars_bigtts", + "temp": false, + "info": "澳洲英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Sarah.mp3" + }, + { + "type": "", + "name": "Dryw", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Dryw.png", + "voice_type": "en_male_dryw_mars_bigtts", + "temp": false, + "info": "澳洲英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Dryw.mp3" + }, + { + "type": "", + "name": "かずね(和音)/Javier or Álvaro", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/和音.png", + "voice_type": "multi_male_jingqiangkanye_moon_bigtts", + "temp": false, + "info": "日语、西语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/和音.mp3" + }, + { + "type": "", + "name": "はるこ(晴子)/Esmeralda", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Esmeralda.png", + "voice_type": "multi_female_shuangkuaisisi_moon_bigtts", + "temp": false, + "info": "日语、西语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Esmeralda.mp3" + }, + { + "type": "", + "name": "ひろし(広志)/Roberto", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Roberto.png", + "voice_type": "multi_male_wanqudashu_moon_bigtts", + "temp": false, + "info": "日语、西语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Roberto.mp3" + }, + { + "type": "", + "name": "あけみ(朱美)", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/朱美.png", + "voice_type": "multi_female_gaolengyujie_moon_bigtts", + "temp": false, + "info": "日语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/朱美.mp3" + }, + { + "type": "", + "name": "趣味口音", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Harmony.png", + "voice_type": "京腔侃爷/Harmony", + "temp": false, + "info": "√", + "language": "中文-北京口音、英文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Harmony.mp3" + }, + { + "type": "", + "name": "湾湾小何", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/湾湾小何.png", + "voice_type": "zh_female_wanwanxiaohe_moon_bigtts", + "temp": false, + "info": "中文-台湾口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/湾湾小何.mp3" + }, + { + "type": "", + "name": "湾区大叔", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/湾区大叔.png", + "voice_type": "zh_female_wanqudashu_moon_bigtts", + "temp": false, + "info": "中文-广东口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/湾区大叔.mp3" + }, + { + "type": "", + "name": "呆萌川妹", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/呆萌川妹.png", + "voice_type": "zh_female_daimengchuanmei_moon_bigtts", + "temp": false, + "info": "中文-四川口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/呆萌川妹.mp3" + }, + { + "type": "", + "name": "广州德哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/广州德哥.png", + "voice_type": "zh_male_guozhoudege_moon_bigtts", + "temp": false, + "info": "中文-广东口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/广州德哥.mp3" + }, + { + "type": "", + "name": "北京小爷", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/北京小爷.png", + "voice_type": "zh_male_beijingxiaoye_moon_bigtts", + "temp": false, + "info": "中文-北京口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/北京小爷.mp3" + }, + { + "type": "", + "name": "浩宇小哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/浩宇小哥.png", + "voice_type": "zh_male_haoyuxiaoge_moon_bigtts", + "temp": false, + "info": "中文-青岛口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/浩宇小哥.mp3" + }, + { + "type": "", + "name": "广西远舟", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/广西远舟.png", + "voice_type": "zh_male_guangxiyuanzhou_moon_bigtts", + "temp": false, + "info": "中文-广西口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/广西远舟.mp3" + }, + { + "type": "", + "name": "妹坨洁儿", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/妹坨洁儿.png", + "voice_type": "zh_female_meituojieer_moon_bigtts", + "temp": false, + "info": "中文-长沙口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/妹坨洁儿.mp3" + }, + { + "type": "", + "name": "豫州子轩", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/豫州子轩.png", + "voice_type": "zh_male_yuzhouzixuan_moon_bigtts", + "temp": false, + "info": "中文-河南口音", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/豫州子轩.mp3" + }, + { + "type": "", + "name": "角色扮演", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/奶气萌娃.png", + "voice_type": "奶气萌娃", + "temp": false, + "info": "√", + "language": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/奶气萌娃.mp3" + }, + { + "type": "", + "name": "婆婆", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/婆婆.png", + "voice_type": "zh_female_popo_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/婆婆.mp3" + }, + { + "type": "", + "name": "高冷御姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/高冷御姐.png", + "voice_type": "zh_female_gaolengyujie_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/高冷御姐.mp3" + }, + { + "type": "", + "name": "傲娇霸总", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/傲娇霸总.png", + "voice_type": "zh_male_aojiaobazong_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/傲娇霸总.mp3" + }, + { + "type": "", + "name": "魅力女友", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/魅力女友.png", + "voice_type": "zh_female_meilinvyou_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/魅力女友.mp3" + }, + { + "type": "", + "name": "深夜播客", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/深夜播客.png", + "voice_type": "zh_male_shenyeboke_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/深夜播客.mp3" + }, + { + "type": "", + "name": "柔美女友", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/柔美女友.png", + "voice_type": "zh_female_sajiaonvyou_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/柔美女友.mp3" + }, + { + "type": "", + "name": "撒娇学妹", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/撒娇学妹.png", + "voice_type": "zh_female_yuanqinvyou_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/撒娇学妹.mp3" + }, + { + "type": "", + "name": "病弱少女", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病弱少女.png", + "voice_type": "ICL_zh_female_bingruoshaonv_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病弱少女.mp3" + }, + { + "type": "", + "name": "活泼女孩", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/活泼女孩.png", + "voice_type": "ICL_zh_female_huoponvhai_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/活泼女孩.mp3" + }, + { + "type": "", + "name": "东方浩然", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/东方浩然.png", + "voice_type": "zh_male_dongfanghaoran_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/东方浩然.mp3" + }, + { + "type": "", + "name": "绿茶小哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/绿茶小哥.png", + "voice_type": "ICL_zh_male_lvchaxiaoge_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/绿茶小哥.mp3" + }, + { + "type": "", + "name": "娇弱萝莉", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/娇弱萝莉.png", + "voice_type": "ICL_zh_female_jiaoruoluoli_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/娇弱萝莉.mp3" + }, + { + "type": "", + "name": "冷淡疏离", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/冷淡疏离.png", + "voice_type": "ICL_zh_male_lengdanshuli_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/冷淡疏离.mp3" + }, + { + "type": "", + "name": "憨厚敦实", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/憨厚敦实.png", + "voice_type": "ICL_zh_male_hanhoudunshi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/憨厚敦实.mp3" + }, + { + "type": "", + "name": "傲气凌人", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/傲气凌人.png", + "voice_type": "ICL_zh_male_aiqilingren_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/傲气凌人.mp3" + }, + { + "type": "", + "name": "活泼刁蛮", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/活泼刁蛮.png", + "voice_type": "ICL_zh_female_huopodiaoman_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/活泼刁蛮.mp3" + }, + { + "type": "", + "name": "固执病娇", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/固执病娇.png", + "voice_type": "ICL_zh_male_guzhibingjiao_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/固执病娇.mp3" + }, + { + "type": "", + "name": "撒娇粘人", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/撒娇粘人.png", + "voice_type": "ICL_zh_male_sajiaonianren_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/撒娇粘人.mp3" + }, + { + "type": "", + "name": "傲慢娇声", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/傲慢娇声.png", + "voice_type": "ICL_zh_female_aomanjiaosheng_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/傲慢娇声.mp3" + }, + { + "type": "", + "name": "潇洒随性", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/潇洒随性.png", + "voice_type": "ICL_zh_male_xiaosasuixing_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/潇洒随性.mp3" + }, + { + "type": "", + "name": "腹黑公子", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/腹黑公子.png", + "voice_type": "ICL_zh_male_fuheigongzi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/腹黑公子.mp3" + }, + { + "type": "", + "name": "诡异神秘", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/诡异神秘.png", + "voice_type": "ICL_zh_male_guiyishenmi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/诡异神秘.mp3" + }, + { + "type": "", + "name": "儒雅才俊", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/儒雅才俊.png", + "voice_type": "ICL_zh_male_ruyacaijun_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/儒雅才俊.mp3" + }, + { + "type": "", + "name": "病娇白莲", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病娇白莲.png", + "voice_type": "ICL_zh_male_bingjiaobailian_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病娇白莲.mp3" + }, + { + "type": "", + "name": "正直青年", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/正直青年.png", + "voice_type": "ICL_zh_male_zhengzhiqingnian_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/正直青年.mp3" + }, + { + "type": "", + "name": "娇憨女王", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/娇憨女王.png", + "voice_type": "ICL_zh_female_jiaohannvwang_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/娇憨女王.mp3" + }, + { + "type": "", + "name": "病娇萌妹", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病娇萌妹.png", + "voice_type": "ICL_zh_female_bingjiaomengmei_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病娇萌妹.mp3" + }, + { + "type": "", + "name": "青涩小生", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/青涩小生.png", + "voice_type": "ICL_zh_male_qingsenaigou_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/青涩小生.mp3" + }, + { + "type": "", + "name": "纯真学弟", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/纯真学弟.png", + "voice_type": "ICL_zh_male_chunzhenxuedi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/纯真学弟.mp3" + }, + { + "type": "", + "name": "暖心学姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/暖心学姐.png", + "voice_type": "ICL_zh_female_nuanxinxuejie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/暖心学姐.mp3" + }, + { + "type": "", + "name": "可爱女生", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/可爱女生.png", + "voice_type": "ICL_zh_female_keainvsheng_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/可爱女生.mp3" + }, + { + "type": "", + "name": "成熟姐姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/成熟姐姐.png", + "voice_type": "ICL_zh_female_chengshujiejie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/成熟姐姐.mp3" + }, + { + "type": "", + "name": "病娇姐姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病娇姐姐.png", + "voice_type": "ICL_zh_female_bingjiaojiejie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病娇姐姐.mp3" + }, + { + "type": "", + "name": "优柔帮主", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/优柔帮主.png", + "voice_type": "ICL_zh_male_youroubangzhu_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/优柔帮主.mp3" + }, + { + "type": "", + "name": "优柔公子", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/优柔公子.png", + "voice_type": "ICL_zh_male_yourougongzi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/优柔公子.mp3" + }, + { + "type": "", + "name": "妩媚御姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/妩媚御姐.png", + "voice_type": "ICL_zh_female_wumeiyujie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/妩媚御姐.mp3" + }, + { + "type": "", + "name": "调皮公主", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/调皮公主.png", + "voice_type": "ICL_zh_female_tiaopigongzhu_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/调皮公主.mp3" + }, + { + "type": "", + "name": "傲娇女友", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/傲娇女友.png", + "voice_type": "ICL_zh_female_aojiaonvyou_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/傲娇女友.mp3" + }, + { + "type": "", + "name": "贴心男友", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/贴心男友.png", + "voice_type": "ICL_zh_male_tiexinnanyou_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/贴心男友.mp3" + }, + { + "type": "", + "name": "少年将军", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/少年将军.png", + "voice_type": "ICL_zh_male_shaonianjiangjun_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/少年将军.mp3" + }, + { + "type": "", + "name": "贴心女友", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/贴心女友.png", + "voice_type": "ICL_zh_female_tiexinnvyou_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/贴心女友.mp3" + }, + { + "type": "", + "name": "病娇哥哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病娇哥哥.png", + "voice_type": "ICL_zh_male_bingjiaogege_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病娇哥哥.mp3" + }, + { + "type": "", + "name": "学霸男同桌", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/学霸男同桌.png", + "voice_type": "ICL_zh_male_xuebanantongzhuo_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/学霸男同桌.mp3" + }, + { + "type": "", + "name": "幽默叔叔", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/幽默叔叔.png", + "voice_type": "ICL_zh_male_youmoshushu_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/幽默叔叔.mp3" + }, + { + "type": "", + "name": "性感御姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/性感御姐.png", + "voice_type": "ICL_zh_female_xingganyujie_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/性感御姐.mp3" + }, + { + "type": "", + "name": "假小子", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/假小子.png", + "voice_type": "ICL_zh_female_jiaxiaozi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/假小子.mp3" + }, + { + "type": "", + "name": "冷峻上司", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/冷峻上司.png", + "voice_type": "ICL_zh_male_lengjunshangsi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/冷峻上司.mp3" + }, + { + "type": "", + "name": "温柔男同桌", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/温柔男同桌.png", + "voice_type": "ICL_zh_male_wenrounantongzhuo_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/温柔男同桌.mp3" + }, + { + "type": "", + "name": "病娇弟弟", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/病娇弟弟.png", + "voice_type": "ICL_zh_male_bingjiaodidi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/病娇弟弟.mp3" + }, + { + "type": "", + "name": "幽默大爷", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/幽默大爷.png", + "voice_type": "ICL_zh_male_youmodaye_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/幽默大爷.mp3" + }, + { + "type": "", + "name": "傲慢少爷", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/傲慢少爷.png", + "voice_type": "ICL_zh_male_aomanshaoye_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/傲慢少爷.mp3" + }, + { + "type": "", + "name": "神秘法师", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/神秘法师.png", + "voice_type": "ICL_zh_male_shenmifashi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/神秘法师.mp3" + }, + { + "type": "", + "name": "视频配音", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/和蔼奶奶.png", + "voice_type": "和蔼奶奶", + "temp": false, + "info": "√", + "language": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/和蔼奶奶.mp3" + }, + { + "type": "", + "name": "邻居阿姨", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/邻居阿姨.png", + "voice_type": "ICL_zh_female_linjuayi_tob", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/邻居阿姨.mp3" + }, + { + "type": "", + "name": "温柔小雅", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/温柔小雅.png", + "voice_type": "zh_female_wenrouxiaoya_moon_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/温柔小雅.mp3" + }, + { + "type": "", + "name": "天才童声", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/天才童声.png", + "voice_type": "zh_male_tiancaitongsheng_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/天才童声.mp3" + }, + { + "type": "", + "name": "猴哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/猴哥.png", + "voice_type": "zh_male_sunwukong_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/猴哥.mp3" + }, + { + "type": "", + "name": "熊二", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/熊二.png", + "voice_type": "zh_male_xionger_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/熊二.mp3" + }, + { + "type": "", + "name": "佩奇猪", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/佩奇猪.png", + "voice_type": "zh_female_peiqi_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/佩奇猪.mp3" + }, + { + "type": "", + "name": "武则天", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/武则天.png", + "voice_type": "zh_female_wuzetian_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/武则天.mp3" + }, + { + "type": "", + "name": "顾姐", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/顾姐.png", + "voice_type": "zh_female_gujie_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/顾姐.mp3" + }, + { + "type": "", + "name": "樱桃丸子", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/樱桃丸子.png", + "voice_type": "zh_female_yingtaowanzi_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/樱桃丸子.mp3" + }, + { + "type": "", + "name": "广告解说", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/广告解说.png", + "voice_type": "zh_male_chunhui_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/广告解说.mp3" + }, + { + "type": "", + "name": "少儿故事", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/少儿故事.png", + "voice_type": "zh_female_shaoergushi_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/少儿故事.mp3" + }, + { + "type": "", + "name": "四郎", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/四郎.png", + "voice_type": "zh_male_silang_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/四郎.mp3" + }, + { + "type": "", + "name": "磁性解说男声/Morgan", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Morgan.png", + "voice_type": "zh_male_jieshuonansheng_mars_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Morgan.mp3" + }, + { + "type": "", + "name": "鸡汤妹妹/Hope", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Hope.png", + "voice_type": "zh_female_jitangmeimei_mars_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Hope.mp3" + }, + { + "type": "", + "name": "贴心女声/Candy", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Candy.png", + "voice_type": "zh_female_tiexinnvsheng_mars_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Candy.mp3" + }, + { + "type": "", + "name": "俏皮女声", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/俏皮女声.png", + "voice_type": "zh_female_qiaopinvsheng_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/俏皮女声.mp3" + }, + { + "type": "", + "name": "萌丫头/Cutey", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/Cutey.png", + "voice_type": "zh_female_mengyatou_mars_bigtts", + "temp": false, + "info": "中文、美式英语", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/Cutey.mp3" + }, + { + "type": "", + "name": "有声阅读", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/悬疑解说.png", + "voice_type": "悬疑解说", + "temp": false, + "info": "√", + "language": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/悬疑解说.mp3" + }, + { + "type": "", + "name": "儒雅青年", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/儒雅青年.png", + "voice_type": "zh_male_ruyaqingnian_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/儒雅青年.mp3" + }, + { + "type": "", + "name": "霸气青叔", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/霸气青叔.png", + "voice_type": "zh_male_baqiqingshu_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/霸气青叔.mp3" + }, + { + "type": "", + "name": "擎苍", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/擎苍.png", + "voice_type": "zh_male_qingcang_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/擎苍.mp3" + }, + { + "type": "", + "name": "活力小哥", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/活力小哥.png", + "voice_type": "zh_male_yangguangqingnian_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/活力小哥.mp3" + }, + { + "type": "", + "name": "古风少御", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/俏皮女声.png", + "voice_type": "zh_female_gufengshaoyu_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/古风少御.mp3" + }, + { + "type": "", + "name": "温柔淑女", + "avatar": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/avatar/温柔淑女.png", + "voice_type": "zh_female_wenroushunv_mars_bigtts", + "temp": false, + "info": "中文", + "audio": "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/short_trial_url/温柔淑女.mp3" + } +] diff --git a/public/worker/decode.worker.js b/public/worker/decode.worker.js new file mode 100644 index 0000000..36e991d --- /dev/null +++ b/public/worker/decode.worker.js @@ -0,0 +1,631 @@ +importScripts('./demuxer.worker.js'); +// importScripts('./webm-demuxer.umd.js'); + +/** + * 解码指定的视频,返回帧用于绘制到画布上 + eg: + const canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + const ctx = canvas.getContext('2d'); + const offscreen = (canvas as any).transferControlToOffscreen(); + + // 创建worker + const dv = new Worker('./worker/decode.worker.js'); + + // 准备解码 + dv.postMessage({ + canvas: offscreen, // offscreen 或者 canvas对象 + type: 'initDecodeVideo', + options: {url: 'https://xxx.com/mp4', clipTime: 0 } + }, [offscreen]); // canvas的所有权转移给Worker,相当于是共享canvas,避免重复创建实例 + + // 准备OK会触发ready + function readyFun() { + // 准备就绪后就要开始解码帧 + for(let i = 0; i < 10; i+=0.1) { + dv.postMessage({type: 'decodeFrameByTime', time: i }); + // 每次调用decodeFrameByTime都会触发 draw 事件,触发draw之后会开始绘制帧图 + } + } + + // 事件 ready 准备就绪 draw 去绘制 + dv.onmessage = async (event) => { + switch(event.data.type) { + case 'ready': + console.log('准备就绪,是否有音频:', event.data.noAudioTracks); + readyFun(); + break; + case 'draw': + console.log('绘制帧到canvas了'); + const {frameIndex} = event.data; + break; + case 'end': + console.log('绘制&解码已经结束'); + break; + } + * } + * + */ +// Listen for the start request. +self.addEventListener('message', e => { + // console.log('收到消息????', e.data); + + switch (e.data.type) { + case 'initDecodeVideo': // 准备解码视频 + // options: {url, clipTime} + initDecodeVideo(e.data.options, e.data.canvas); + break; + case 'decodeFrameByTime': // 解码指定时间的帧,解码成功后会触发 draw 事件,把frame返回给画布 + decodeFrameByTime(e.data); + break; + case 'decodeFrameImage': // 将视频解码成指定的每隔1s的帧图 + // options: { frameWidth, frameHeight, maxCanvasSize } + decodeFrameImage(e.data.options, e.data.canvas); + break; + case 'destroy': // 销毁 + for (const i in self.frames) { + if (self.frames[i]) { + self.frames[i].close(); + delete self.frames[i]; + } + } + self.frames = null; + // 删除自定义的变量 + delete self.frames; + delete self.frameIndex; + delete self.hasDrawFrameIndex; + delete self.noAudioTracks; + delete self.startFrameIndex; + if (self.canvas) { + delete self.canvas; // 外部去处理canvas.remove() + delete self.ctx; + } + break; + } +}); + +/** + * 解码视频,返回时间轴的帧图 + * @param {*} options { url, canvas, frameHeight, aspectRatio} + * frameHeight 单帧高度 + * aspectRatio 浏览器中视频的宽高比 + */ +function decodeFrameImage(options, canvas) { + const { url, startTime = 0, duration, noAudioTracks, aspectRatio = 1, frameScale = 1, videoRotation = 0 } = options; + const frameHeight = options.frameHeight * frameScale; + const frameWidth = frameHeight * aspectRatio; + + self.frames = {}; + self.canvas = canvas; + // 绘制帧图完成 + const decoderFrameEnd = debounce(() => { + self.drawIndex = 0; + self.frameIndex = 0; + // self.canvas.height = frameHeight.toFixed(0); + // self.canvas.width = frameWidth.toFixed(0); + self.canvas.convertToBlob({ type: 'image/jpeg', quality: 0.7 }).then(res => { + self.postMessage({ + type: 'drawFrameImageSuccess', + data: { url: URL.createObjectURL(res), rotate: self.rotate, noAudioTracks }, + }); + }); + }, 500); + + // 创建 OffscreenCanvas + const offscreenCanvas = new OffscreenCanvas(frameHeight, frameWidth); + const offscreenCtx = offscreenCanvas.getContext('2d'); + + let stepFrameDraw = options.stepFrameDraw; + self.stepFrameDrawMark = !!options.stepFrameDraw; + + self.decoder = new VideoDecoder({ + output: async frame => { + // 绘制, 每间隔stepFrameDraw帧绘制一次 + if (self.frameIndex % stepFrameDraw === 0) { + console.log('self.rotate--->', self.rotate, videoRotation); + + let rotatedFrame = frame; + if (self.rotate) { + // 旋转帧图像 + offscreenCtx.save(); + offscreenCtx.translate(offscreenCanvas.width / 2, offscreenCanvas.height / 2); + offscreenCtx.rotate((videoRotation * Math.PI) / 180); + offscreenCtx.drawImage(frame, -frameWidth / 2, -frameHeight / 2, frameWidth, frameHeight); + offscreenCtx.restore(); + // 将旋转后的帧图像转换为 ImageBitmap + rotatedFrame = await createImageBitmap(offscreenCanvas); + } + // 绘制帧图 + if (self.stepFrameDrawMark) { + if (!options.drawRectangle) { + self.ctx.drawImage(rotatedFrame, self.drawIndex * frameWidth, 0, frameWidth, frameHeight); + } else { + // 绘制到正方形画布上, self.cavnasSizeSqrt 为正方形画布每行绘制的帧图数量 + const dIndex = self.drawIndex % self.cavnasSizeSqrt; + self.ctx.drawImage( + rotatedFrame, + dIndex * frameWidth, + Math.floor(self.drawIndex / self.cavnasSizeSqrt) * frameHeight, + frameWidth, + frameHeight, + ); + } + } else { + self.ctx.drawImage(rotatedFrame, self.drawIndex * frameWidth, 0, frameWidth, frameHeight); + } + + self.drawIndex++; + } + self.frames[self.frameIndex] = frame; + self.frameIndex++; + frame.close(); + // output是连续的,加个防抖函数判断解码是否完成 + decoderFrameEnd(); + }, + error(e) { + // setStatus('decode', e); + console.error('decode error:', e); + postMessage({ type: 'end' }); + }, + }); + + // 此方法会将视频全部fetch下来,所以该方法只能在预览模式下使用 + new MP4Demuxer(url, { + onConfig: config => { + console.log('开始解码22222', JSON.parse(JSON.stringify(config)), url); + + if (!config.error) { + // 部分AI视频因为信息不全获取不到duration + config.movie_duration = duration; + if (['hev', 'hvc'].includes(config.codec.substring(0, 3))) { + // h265不做处理 + console.log(config.codec); + } else { + // h264使用avc1.420034解码器 + config.codec = 'avc1.420034'; + } + if (duration) { + config.movie_duration = duration * config.movie_timescale; + } + // 以默认30fps计算视频时长 + if (!config.movie_duration) { + config.movie_duration = (config.nb_samples / 30) * config.movie_timescale; + } + // 脏数据纠正 + if (!config.hasAudio) { + self.noAudioTracks = true; + } else if (isNaN(config.hasAudio.bitrate)) { + self.noAudioTracks = true; + } else if (!config.hasAudio.duration) { + self.noAudioTracks = true; + } + if (self.noAudioTracks) { + config.hasAudio = false; + } + + // config.codec = 'avc1.420034'; // avc1.42001f 的编码级别比较低,没法编码2K视频 + decoder.configure(config); + // 'avc1.420034', // right 420034 和 42001f 都可以用 + self.totalFrame = config.nb_samples - 2; // 假设有4帧误差 + // self.duration = config.movie_duration / config.movie_timescale; + self.duration = duration; + // 定义变量 + // self.noAudioTracks = !config.hasAudio; + // if (config.volume !== 0 && config.hasAudio?.duration) { + // self.noAudioTracks = true; + // } + // self.noAudioTracks = noAudioTracks; + + // 旋转的判断依据是误差不能超过0.5 + const rote = Number((config.codedWidth / config.codedHeight).toFixed(1)) - Number(aspectRatio.toFixed(1)); + self.rotate = Math.abs(rote) > 0.5 ? true : false; + self.fps = Math.ceil(self.totalFrame / self.duration); + // 默认每隔1秒绘制一次帧 + if (!stepFrameDraw) { + stepFrameDraw = self.fps; + } + + // self.canvas.width = Math.ceil(self.totalFrame / stepFrameDraw) * frameWidth; + // 如果options.stepFrameDraw存在,帧图从左往右,从上往下依次绘制,画布的宽高一样 + + if (!self.stepFrameDrawMark) { + self.canvas.width = self.duration * frameWidth; + self.canvas.height = frameHeight; + } else { + // self.totalFrame张帧图绘制到正方形画布上 + if (options.drawRectangle) { + const sqrt = Math.ceil(Math.sqrt(Math.ceil(self.totalFrame / stepFrameDraw))); + self.cavnasSizeSqrt = sqrt; + self.canvas.width = sqrt * frameWidth; + self.canvas.height = sqrt * frameHeight; + } else { + self.canvas.width = Math.ceil(self.totalFrame / stepFrameDraw) * frameWidth; + self.canvas.height = frameHeight; + } + } + + self.ctx = self.canvas.getContext('2d'); + self.drawIndex = 0; + self.frameIndex = 0; + // 解码准备工作完成 + postMessage({ + type: 'drawFrameImageBefore', + data: { + noAudioTracks: self.noAudioTracks, + totalFrame: self.totalFrame, + duration: self.duration, + startFrameIndex: self.startFrameIndex, + rotate: self.rotate, + frameScale, + }, + }); + } else { + console.error('不支持的编码格式', config); + postMessage({ type: 'end' }); + } + }, + onChunk: chunk => { + self.decoder.decode(chunk); + }, + setStatus: (_type, msg) => { + console.log('msg', _type, msg); + }, + }); +} + +// 移除index之前的帧 +function removeFrame(index) { + for (let i in self.frames) { + if (self.frames[i] !== undefined && Number(i) < index) { + self.frames[i].close(); + delete self.frames[i]; + } + } +} + +function removeFrameAll() { + for (let i in self.frames) { + if (self.frames[i] !== undefined) { + self.frames[i].close(); + } + delete self.frames[i]; + } +} + +// 只执行一次 +async function decodeClipTime() { + if (!self.decodeClipTimeLock) { + self.decodeClipTimeLock = true; + // close clipTime部分的帧 + // console.log('******************', self.elementId, self.startFrameIndex, Object.keys(self.frames)); + // 首次需要解码到startFrameIndex这个下标 + while (!self.frames[self.startFrameIndex]) { + removeFrame(Math.max(self.startFrameIndex, 0)); + await sleep(8); + } + } +} + +/** + * 解码指定时间的帧 + * @param {*} frameIndex + */ +async function decodeFrameByTime(data) { + const { time, duration, relativeTime, webm } = data; + + + // 时间转化成帧(time 可能为 0,不能用 truthy 判断) + const frameIndex = time !== undefined ? Math.floor((time / self.duration) * self.totalFrame) : 0; + + self.decodeFrameByTimeFrameIndex = frameIndex; + + if (!self.frames) { + console.error('解码time失败,worker已经回收', time, self.elementId); + postMessage({ type: 'end' }); + return; + } + + // 等待帧解码就绪,否则 frameIndex 为 0 时帧可能还未解码导致空白 +// while (self.frames && !self.frames[frameIndex]) { +// await sleep(8); +// } + + // 绘制帧 + const frame = self.frames[frameIndex]; + + // 重复的帧不用重复绘制,直接截图即可 + if (frame && self.hasDrawFrameIndex !== frameIndex && self.canvas) { + // 如果传入了canvas,就直接绘制到canvas上面 + self.ctx.drawImage(frame, 0, 0, self.canvas.width, self.canvas.height); + // 记录绘制过的帧 + self.hasDrawFrameIndex = frameIndex; + } + + // 首图强制渲染,避免出现丢帧的情况 + if (frameIndex < 1) { + await self.canvas.convertToBlob({ type: 'image/png' }); + // const blobUrl = URL.createObjectURL(blob); + // console.log('drawxxxxxxxx', self.hasDrawFrameIndex, frameIndex, blobUrl); + } + postMessage({ + type: 'draw', + data: { frameIndex: frameIndex, bitmap: self.returnBitmap ? self.canvas.transferToImageBitmap() : null }, + }); + + // 时间超出全部清空 + if (relativeTime > duration) { + console.log('超出时间了'); + removeFrameAll(); + } else { + // 清空帧之前的数据(removeFrame 只删 index 小于传入值的帧) + removeFrame(frameIndex); + } + + // 解码完成,这里判断是最后一帧绘制完成后判定为解码完成, + // 实际操作中可能不需要解码到最后一帧,这时候需要调用destroy去手动销毁 + // 手动销毁: dv.postMessage({type: 'destroy' }); + if (frameIndex >= self.totalFrame) { + removeFrameAll(); + self.frames = {}; + postMessage({ type: 'end' }); + } +} + +/** + * 清理画布 + */ +function clearCanvas() { + self.ctx.fillStyle = 'rgba(0,0,0,1)'; + self.ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); +} + +function getFPS(mediaInfo) { + const videoStream = mediaInfo.streams.find(stream => stream.codec_type_string === 'video'); + + let fps = 30; + if (videoStream && videoStream.r_frame_rate) { + const [numerator, denominator] = videoStream.r_frame_rate.split('/').map(Number); + if (denominator && denominator > 0) { + fps = numerator / denominator; + } + } else if (videoStream && videoStream.avg_frame_rate) { + const [numerator, denominator] = videoStream.avg_frame_rate.split('/').map(Number); + if (denominator && denominator > 0) { + fps = numerator / denominator; + } + } + return fps; +} + +async function waittingFrame() { + while (self.waittingFrameLock) { + await sleep(8); + } + return true; +} + +/** + * 准备解码视频,从clipTime开始解码 + * url: 解码视频的url + * clipTime: 解码开始时间 + * aspectRatio: 浏览器中视频的宽高比 + * @param {*} params { url, clipTime, aspectRatio } + */ +function initDecodeVideo(params, canvas) { + const { + url, + clipTime = 0, + duration = 0, + aspectRatio = 1, + rotation = 0, + noAudioTracks, + elementId, + returnBitmap, + webm = false, + } = params; + // console.log('initDecodeVideo----->', params); + self.noAudioTracks = noAudioTracks; + self.elementId = elementId; + self.returnBitmap = returnBitmap; + self.frames = {}; + self.frameIndex = 0; + self.hasDrawFrameIndex = -1; + if (canvas) { + self.canvas = canvas; + self.ctx = canvas.getContext('2d', { alpha: true }); + } + + if (webm) { + fetch(url) + .then(async response => { + if (!response.ok) { + throw new Error(`HTTP 错误!状态:${response.status}`); + } + const blob = await response.blob(); + const fileName = 'video.webm'; + const selectedFile = new File([blob], fileName, { type: blob.type }); + return selectedFile; + }) + .then(async buffer => { + self.demuxer = new WebDemuxer({ + wasmFilePath: location.origin + '/worker/web-demuxer.wasm', // 你的有效 wasm 路径 + }); + await self.demuxer.load(buffer); + const mediaInfo = await demuxer.getMediaInfo(); + const fps = getFPS(mediaInfo); + const videoDecoderConfig = await self.demuxer.getDecoderConfig('video'); + + let firstDot = null; + self.decoder = new VideoDecoder({ + output: frame => { + self.ctx.clearRect(0, 0, canvas.width, canvas.height); + const scale = Math.min(self.canvas.width / frame.displayWidth, self.canvas.height / frame.displayHeight); + self.ctx.drawImage(frame, 0, 0, frame.displayWidth * scale, frame.displayHeight * scale); + + // 获取0 0 位置的像素数据 + if (!firstDot) { + const imageData1 = ctx.getImageData(0, 0, 1, 1); + firstDot = imageData1.data; + // console.log('0 0 位置像素数据', firstDot); + } + const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); + const data = imageData.data; + const ex = 20; + for (let i = 0; i < data.length; i += 4) { + // console.log('data', data[i]); + if (data[i] < firstDot[0] + ex && data[i + 1] < firstDot[1] + ex && data[i + 2] < firstDot[2] + ex) { + data[i + 3] = 0; // 设置 alpha 通道为 0,即透明 + } + } + ctx.putImageData(imageData, 0, 0); + + frame.close(); + postMessage({ + type: 'draw', + data: { + frameIndex: self.decodeFrameByTimeFrameIndex, + bitmap: self.returnBitmap ? self.canvas.transferToImageBitmap() : null, + }, + }); + }, + error: e => { + console.error('video decoder error:', e); + }, + }); + self.decoder.configure(videoDecoderConfig); + + self.totalFrame = fps * mediaInfo.duration; // 假设有4帧误差 + self.duration = mediaInfo.duration; + // 定义变量 + self.noAudioTracks = true; + self.startFrameIndex = 0; + self.rotate = false; + console.log('self.totalFrame准备好了???', self.totalFrame); + postMessage({ type: 'decodeMP4DemuxerSuccess' }); + + // 准备解码视频 + self.waittingFrameLock = true; + const reader = demuxer.read('video', 0, mediaInfo.duration).getReader(); + reader.read().then(async function processPacket({ done, value }) { + if (done) { + decoder.flush(); + // loop(); + console.log('read finished'); + return; + } + await waittingFrame(); + // await sleep(10); + decoder.decode(value); + const val = reader.read().then(processPacket); + self.waittingFrameLock = true; + return val; + }); + + loop(); + }); + } else { + /** + * 每次最多解码大概10帧左右,只有销毁了才会继续往后解码 + */ + self.decoder = new VideoDecoder({ + output: frame => { + self.frames[self.frameIndex] = frame; + self.frameIndex++; + // console.log('jm->', self.elementId, self.frameIndex, Object.keys(self.frames)); + }, + error(e) { + console.error('decode', e, params); + // setStatus('decode', e); + }, + }); + // 此方法会将视频全部fetch下来,所以该方法只能在预览模式下使用 + new MP4Demuxer(url, { + onConfig: config => { + // config.codec = 'avc1.420034'; + console.log('MP4Demuxer->config', url, params, { ...config }); + if (!config.error) { + if (['hev', 'hvc'].includes(config.codec.substring(0, 3))) { + // h265不做处理 + console.log(config.codec); + } else { + // h264使用avc1.420034解码器 + config.codec = 'avc1.420034'; + } + self.decoder.configure(config); + if (duration) { + config.movie_duration = duration * config.movie_timescale; + } + // 以默认30fps计算视频时长 + if (!config.movie_duration) { + config.movie_duration = (config.nb_samples / 30) * config.movie_timescale; + } + self.totalFrame = config.nb_samples - 2; // 假设有4帧误差 + self.duration = config.movie_duration / config.movie_timescale; + // 定义变量 + self.noAudioTracks = noAudioTracks; + console.log('计算startFrameIndex', clipTime, self.duration, self.totalFrame); + self.startFrameIndex = Math.floor((clipTime / self.duration) * self.totalFrame); + // self.rotate = config.codedWidth / config.codedHeight !== aspectRatio; + // const rote = Number((config.codedWidth / config.codedHeight).toFixed(1)) - Number(aspectRatio.toFixed(1)); + // self.rotate = Math.abs(rote) > 0.5 ? true : false; + self.rotate = rotation % 360 === 0 ? false : true; + if (rotation) { + // 旋转90度 + const scalex = self.canvas.width / self.canvas.height; + self.ctx.translate(self.canvas.width / 2, self.canvas.height / 2); + self.ctx.scale(scalex, self.canvas.height / self.canvas.width); + self.ctx.rotate((rotation * Math.PI) / 180); + self.ctx.translate(-self.canvas.width / 2, -self.canvas.height / 2); + } + console.log('开始解码?????', self.rotate, config, self.startFrameIndex); + postMessage({ type: 'decodeMP4DemuxerSuccess' }); + } else { + console.error('不支持的编码格式', config); + postMessage({ type: 'end' }); + } + }, + onChunk: chunk => { + self.decoder.decode(chunk); + }, + setStatus: async (_type, msg) => { + console.log(_type, msg); + if (msg === 'Ready') { + // 解码准备工作完成 + await decodeClipTime(); + console.log('解码准备工作完成', self); + postMessage({ + type: 'ready', + data: { + noAudioTracks: self.noAudioTracks, + totalFrame: self.totalFrame, + duration: self.duration, + startFrameIndex: self.startFrameIndex, + rotate: self.rotate, + }, + }); + } + }, + }); + } +} + +function debounce(fn, delay) { + let timer = null; + // 所以这个函数就可以使用...运算符收集js自动添加的参数到一个数组中 + return function _debounce(...arg) { + if (timer) clearTimeout(timer); + timer = setTimeout(() => { + // 通过apply绑定this和传递参数,apply第二个参数正好是传数组嘛 + fn.apply(this, arg); + }, delay); + }; +} + +function sleep(t) { + return new Promise(resolve => { + setTimeout(() => { + resolve(); + }, t); + }); +} diff --git a/public/worker/decode.worker.webgl.js b/public/worker/decode.worker.webgl.js new file mode 100644 index 0000000..5f13d94 --- /dev/null +++ b/public/worker/decode.worker.webgl.js @@ -0,0 +1,428 @@ +importScripts('./demuxer.worker.js'); +importScripts('./webgl2d.js'); + +/** + * 解码指定的视频,返回帧用于绘制到画布上 + eg: + const canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + const ctx = canvas.getContext('2d'); + // const ctx = new WebGL2D(canvas); + const offscreen = (canvas as any).transferControlToOffscreen(); + + // 创建worker + const dv = new Worker('./worker/decode.worker.js'); + + // 准备解码 + dv.postMessage({ + canvas: offscreen, // offscreen 或者 canvas对象 + type: 'initDecodeVideo', + options: {url: 'https://xxx.com/mp4', clipTime: 0 } + }, [offscreen]); // canvas的所有权转移给Worker,相当于是共享canvas,避免重复创建实例 + + // 准备OK会触发ready + function readyFun() { + // 准备就绪后就要开始解码帧 + for(let i = 0; i < 10; i+=0.1) { + dv.postMessage({type: 'decodeFrameByTime', time: i }); + // 每次调用decodeFrameByTime都会触发 draw 事件,触发draw之后会开始绘制帧图 + } + } + + // 事件 ready 准备就绪 draw 去绘制 + dv.onmessage = async (event) => { + switch(event.data.type) { + case 'ready': + console.log('准备就绪,是否有音频:', event.data.noAudioTracks); + readyFun(); + break; + case 'draw': + console.log('绘制帧到canvas了'); + const {frameIndex} = event.data; + break; + case 'end': + console.log('绘制&解码已经结束'); + break; + } + * } + * + */ +// Listen for the start request. +self.addEventListener('message', e => { + switch (e.data.type) { + case 'initDecodeVideo': // 准备解码视频 + // options: {url, clipTime} + initDecodeVideo(e.data.options, e.data.canvas); + break; + case 'decodeFrameByTime': // 解码指定时间的帧,解码成功后会触发 draw 事件,把frame返回给画布 + decodeFrameByTime(e.data); + break; + case 'decodeFrameImage': // 将视频解码成指定的每隔1s的帧图 + // options: { frameWidth, frameHeight, maxCanvasSize } + decodeFrameImage(e.data.options, e.data.canvas); + break; + case 'destroy': // 销毁 + for (const i in self.frames) { + if (self.frames[i]) { + self.frames[i].close(); + delete self.frames[i]; + } + } + self.frames = null; + // 删除自定义的变量 + delete self.frames; + delete self.frameIndex; + delete self.hasDrawFrameIndex; + delete self.noAudioTracks; + delete self.startFrameIndex; + if (self.canvas) { + delete self.canvas; // 外部去处理canvas.remove() + delete self.ctx; + } + break; + } +}); + +/** + * 解码视频,返回时间轴的帧图 + * @param {*} options { url, canvas, frameHeight, aspectRatio} + * frameHeight 单帧高度 + * aspectRatio 浏览器中视频的宽高比 + */ +function decodeFrameImage(options, canvas) { + const { url, startTime = 0, noAudioTracks, aspectRatio = 1, frameScale = 1, videoRotation = 0 } = options; + const frameHeight = options.frameHeight * frameScale; + const frameWidth = frameHeight * aspectRatio; + self.frames = {}; + self.canvas = canvas; + // 绘制帧图完成 + const decoderFrameEnd = debounce(() => { + self.drawIndex = 0; + self.frameIndex = 0; + self.canvas.convertToBlob({ type: 'image/jpeg', quality: 0.7 }).then(res => { + self.postMessage({ + type: 'drawFrameImageSuccess', + data: { url: URL.createObjectURL(res), rotate: self.rotate, noAudioTracks }, + }); + }); + }, 500); + + // 创建 OffscreenCanvas + const offscreenCanvas = new OffscreenCanvas(frameHeight, frameWidth); + // const offscreenCtx = offscreenCanvas.getContext('2d'); + const offscreenCtx = new WebGL2D(offscreenCanvas); + + const decoder = new VideoDecoder({ + output: async frame => { + // 绘制 + if (self.frameIndex % self.fps === 0) { + console.log('self.rotate--->', self.rotate, videoRotation); + + if (self.rotate) { + // 旋转帧图像 + offscreenCtx.save(); + offscreenCtx.translate(offscreenCanvas.width / 2, offscreenCanvas.height / 2); + offscreenCtx.rotate((videoRotation * Math.PI) / 180); + offscreenCtx.drawImage(frame, -frameWidth / 2, -frameHeight / 2, frameWidth, frameHeight); + offscreenCtx.restore(); + // 将旋转后的帧图像转换为 ImageBitmap + const rotatedFrame = await createImageBitmap(offscreenCanvas); + self.ctx.drawImage(rotatedFrame, self.drawIndex * frameWidth, 0, frameWidth, frameHeight); + } else { + self.ctx.drawImage(frame, self.drawIndex * frameWidth, 0, frameWidth, frameHeight); + } + + self.drawIndex++; + } + self.frames[self.frameIndex] = frame; + self.frameIndex++; + frame.close(); + // output是连续的,加个防抖函数判断解码是否完成 + decoderFrameEnd(); + }, + error(e) { + // setStatus('decode', e); + console.error('decode error:', e); + postMessage({ type: 'end' }); + }, + }); + + // 此方法会将视频全部fetch下来,所以该方法只能在预览模式下使用 + new MP4Demuxer(url, { + onConfig: config => { + console.log('开始解码2', config, url); + if (!config.error) { + if (['hev', 'hvc'].includes(config.codec.substring(0, 3))) { + // h265不做处理 + console.log(config.codec); + } else { + // h264使用avc1.420034解码器 + config.codec = 'avc1.420034'; + // config.codec = 'avc1.420034'; + } + // config.codec = 'avc1.420034'; // avc1.42001f 的编码级别比较低,没法编码2K视频 + decoder.configure(config); + // 'avc1.420034', // right 420034 和 42001f 都可以用 + self.totalFrame = config.nb_samples - 2; // 假设有4帧误差 + self.duration = config.movie_duration / config.movie_timescale; + // 定义变量 + // self.noAudioTracks = !config.hasAudio; + // if (config.volume !== 0 && config.hasAudio?.duration) { + // self.noAudioTracks = true; + // } + self.noAudioTracks = noAudioTracks; + self.startFrameIndex = Math.floor((startTime / self.duration) * self.totalFrame); + // 旋转的判断依据是误差不能超过0.5 + const rote = Number((config.codedWidth / config.codedHeight).toFixed(1)) - Number(aspectRatio.toFixed(1)); + self.rotate = Math.abs(rote) > 0.5 ? true : false; + self.fps = Math.ceil(self.totalFrame / self.duration); + self.canvas.width = self.duration * frameWidth; + self.canvas.height = frameHeight; + // self.ctx = self.canvas.getContext('2d'); + self.ctx = new WebGL2D(self.canvas); + self.drawIndex = 0; + self.frameIndex = 0; + // 解码准备工作完成 + postMessage({ + type: 'drawFrameImageBefore', + data: { + noAudioTracks: self.noAudioTracks, + totalFrame: self.totalFrame, + duration: self.duration, + startFrameIndex: self.startFrameIndex, + rotate: self.rotate, + frameScale, + }, + }); + } else { + console.error('不支持的编码格式', config); + postMessage({ type: 'end' }); + } + }, + onChunk: chunk => { + decoder.decode(chunk); + }, + setStatus: (_type, msg) => { + console.log('msg', _type, msg); + }, + }); +} + +// 移除index之前的帧 +function removeFrame(index) { + for (let i in self.frames) { + if (self.frames[i] !== undefined && Number(i) < index) { + self.frames[i].close(); + delete self.frames[i]; + } + } +} + +function removeFrameAll() { + for (let i in self.frames) { + if (self.frames[i] !== undefined) { + self.frames[i].close(); + } + delete self.frames[i]; + } +} + +// 只执行一次 +async function decodeClipTime() { + if (!self.decodeClipTimeLock) { + self.decodeClipTimeLock = true; + // close clipTime部分的帧 + // console.log('******************', self.elementId, self.startFrameIndex, Object.keys(self.frames)); + // 首次需要解码到startFrameIndex这个下标 + while (!self.frames[self.startFrameIndex]) { + removeFrame(Math.max(self.startFrameIndex, 0)); + await sleep(8); + } + } +} + +/** + * 解码指定时间的帧 + * @param {*} frameIndex + */ +async function decodeFrameByTime(data) { + const { time, duration, relativeTime } = data; + // console.log('decodeFrameByTime>', self.elementId, relativeTime); + // 时间转化成帧 + const frameIndex = time ? Math.floor((time / self.duration) * self.totalFrame) : 0; + // console.log( + // '------------------------------->', + // self.elementId, + // 'time:' + time, + // 'duration:' + duration, + // 'relativeTime:' + relativeTime, + // 'frameIndex:' + frameIndex, + // Object.keys(self.frames), + // ); + if (!self.frames) { + console.error('解码time失败,worker已经回收', time, self.elementId); + postMessage({ type: 'end' }); + return; + } + + // 绘制帧 + const frame = self.frames[frameIndex]; + + // 重复的帧不用重复绘制,直接截图即可 + if (frame && self.hasDrawFrameIndex !== frameIndex && self.canvas) { + // 如果传入了canvas,就直接绘制到canvas上面 + self.ctx.drawImage(frame, 0, 0, self.canvas.width, self.canvas.height); + // 记录绘制过的帧 + self.hasDrawFrameIndex = frameIndex; + } + postMessage({ + type: 'draw', + data: { frameIndex, bitmap: self.returnBitmap ? self.canvas.transferToImageBitmap() : null }, + }); + + // 时间超出全部清空 + if (relativeTime > duration) { + console.log('超出时间了'); + removeFrameAll(); + } else { + // 清空帧之前的数据 + removeFrame(frameIndex); + } + + // 解码完成,这里判断是最后一帧绘制完成后判定为解码完成, + // 实际操作中可能不需要解码到最后一帧,这时候需要调用destroy去手动销毁 + // 手动销毁: dv.postMessage({type: 'destroy' }); + if (frameIndex >= self.totalFrame) { + removeFrameAll(); + self.frames = {}; + postMessage({ type: 'end' }); + } +} + +/** + * 清理画布 + */ +function clearCanvas() { + self.ctx.fillStyle = 'rgba(0,0,0,1)'; + self.ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); +} + +/** + * 准备解码视频,从clipTime开始解码 + * url: 解码视频的url + * clipTime: 解码开始时间 + * aspectRatio: 浏览器中视频的宽高比 + * @param {*} params { url, clipTime, aspectRatio } + */ +function initDecodeVideo(params, canvas) { + const { url, clipTime = 0, aspectRatio = 1, rotation = 0, noAudioTracks, elementId, returnBitmap } = params; + // console.log('初始化----->', params); + self.noAudioTracks = noAudioTracks; + self.elementId = elementId; + self.returnBitmap = returnBitmap; + self.frames = {}; + self.frameIndex = 0; + self.hasDrawFrameIndex = -1; + if (canvas) { + self.canvas = canvas; + // self.ctx = canvas.getContext('2d'); + self.ctx = new WebGL2D(self.canvas); + } + + /** + * 每次最多解码大概10帧左右,只有销毁了才会继续往后解码 + */ + const decoder = new VideoDecoder({ + output: frame => { + self.frames[self.frameIndex] = frame; + self.frameIndex++; + // console.log('jm->', self.elementId, self.frameIndex, Object.keys(self.frames)); + }, + error(e) { + console.error('decode', e, params); + // setStatus('decode', e); + }, + }); + + // 此方法会将视频全部fetch下来,所以该方法只能在预览模式下使用 + new MP4Demuxer(url, { + onConfig: config => { + // config.codec = 'avc1.420034'; + console.log('MP4Demuxer->config', { ...config }); + if (!config.error) { + if (['hev', 'hvc'].includes(config.codec.substring(0, 3))) { + // h265不做处理 + console.log(config.codec); + } else { + // h264使用avc1.420034解码器 + config.codec = 'avc1.420034'; + } + decoder.configure(config); + self.totalFrame = config.nb_samples - 2; // 假设有4帧误差 + self.duration = config.movie_duration / config.movie_timescale; + // 定义变量 + self.noAudioTracks = noAudioTracks; + self.startFrameIndex = Math.floor((clipTime / self.duration) * self.totalFrame); + // self.rotate = config.codedWidth / config.codedHeight !== aspectRatio; + // const rote = Number((config.codedWidth / config.codedHeight).toFixed(1)) - Number(aspectRatio.toFixed(1)); + // self.rotate = Math.abs(rote) > 0.5 ? true : false; + self.rotate = rotation % 360 === 0 ? false : true; + if (rotation) { + // 旋转90度 + const scalex = self.canvas.width / self.canvas.height; + self.ctx.translate(self.canvas.width / 2, self.canvas.height / 2); + self.ctx.scale(scalex, self.canvas.height / self.canvas.width); + self.ctx.rotate((rotation * Math.PI) / 180); + self.ctx.translate(-self.canvas.width / 2, -self.canvas.height / 2); + } + console.log('开始解码?????', self.rotate, config, self.startFrameIndex); + postMessage({ type: 'decodeMP4DemuxerSuccess' }); + } else { + console.error('不支持的编码格式', config); + postMessage({ type: 'end' }); + } + }, + onChunk: chunk => { + decoder.decode(chunk); + }, + setStatus: async (_type, msg) => { + console.log(_type, msg); + if (msg === 'Ready') { + // 解码准备工作完成 + await decodeClipTime(); + console.log('解码准备工作完成', self); + postMessage({ + type: 'ready', + data: { + noAudioTracks: self.noAudioTracks, + totalFrame: self.totalFrame, + duration: self.duration, + startFrameIndex: self.startFrameIndex, + rotate: self.rotate, + }, + }); + } + }, + }); +} + +function debounce(fn, delay) { + let timer = null; + // 所以这个函数就可以使用...运算符收集js自动添加的参数到一个数组中 + return function _debounce(...arg) { + if (timer) clearTimeout(timer); + timer = setTimeout(() => { + // 通过apply绑定this和传递参数,apply第二个参数正好是传数组嘛 + fn.apply(this, arg); + }, delay); + }; +} + +function sleep(t) { + return new Promise(resolve => { + setTimeout(() => { + resolve(); + }, t); + }); +} diff --git a/public/worker/demuxer.worker.js b/public/worker/demuxer.worker.js new file mode 100644 index 0000000..55b44ce --- /dev/null +++ b/public/worker/demuxer.worker.js @@ -0,0 +1,142 @@ +importScripts('mp4box.all.js'); + +// Wraps an MP4Box File as a WritableStream underlying sink. +class MP4FileSink { + #setStatus = null; + #file = null; + #offset = 0; + + constructor(file, setStatus) { + this.#file = file; + this.#setStatus = setStatus; + } + + write(chunk) { + // MP4Box.js requires buffers to be ArrayBuffers, but we have a Uint8Array. + const buffer = new ArrayBuffer(chunk.byteLength); + new Uint8Array(buffer).set(chunk); + + // Inform MP4Box where in the file this chunk is from. + buffer.fileStart = this.#offset; + this.#offset += buffer.byteLength; + + // Append chunk. + this.#setStatus('fetch', (this.#offset / 1024 ** 2).toFixed(1) + ' MiB'); + this.#file.appendBuffer(buffer); + } + + close() { + this.#setStatus('fetch', 'Done'); + this.#file.flush(); + } +} + +// Demuxes the first video track of an MP4 file using MP4Box, calling +// `onConfig()` and `onChunk()` with appropriate WebCodecs objects. +class MP4Demuxer { + #onConfig = null; + #onChunk = null; + #setStatus = null; + #file = null; + + get file() { + return this.#file; + } + + constructor(uri, { onConfig, onChunk, setStatus }) { + this.#onConfig = onConfig; + this.#onChunk = onChunk; + this.#setStatus = setStatus; + + // Configure an MP4Box File for demuxing. + this.#file = MP4Box.createFile(); + this.#file.onError = error => { + console.error('MP4Box demux error:', error); + setStatus('demux', error); + }; + this.#file.onReady = this.#onReady.bind(this); + this.#file.onSamples = this.#onSamples.bind(this); + + // Fetch the file and pipe the data through. + const fileSink = new MP4FileSink(this.#file, setStatus); + fetch(uri).then(response => { + // highWaterMark should be large enough for smooth streaming, but lower is + // better for memory usage. + response.body.pipeTo(new WritableStream(fileSink, { highWaterMark: 2 })); + }); + } + + // Get the appropriate `description` for a specific track. Assumes that the + // track is H.264 or H.265. + #description(track) { + const trak = this.#file.getTrackById(track.id); + for (const entry of trak.mdia.minf.stbl.stsd.entries) { + if (entry.avcC || entry.hvcC) { + const stream = new DataStream(undefined, 0, DataStream.BIG_ENDIAN); + if (entry.avcC) { + entry.avcC.write(stream); + } else { + entry.hvcC.write(stream); + } + return new Uint8Array(stream.buffer, 8); // Remove the box header. + } + } + throw 'avcC or hvcC not found'; + } + + #track = null; + + set track(t) { + this.#track = t; + } + + get track() { + return this.#track; + } + + #onReady(info) { + this.#setStatus('demux', 'Ready'); + const track = info.videoTracks[0]; + const hasAudio = info.tracks.find(d => d.type === 'audio'); + + if (!track) { + console.warn('编码格式不支持前端解码'); + this.#onConfig({ + error: true, + hasAudio, + }); + return; + } + // Generate and emit an appropriate VideoDecoderConfig. + this.#onConfig({ + codec: track.codec, + codedHeight: track.video.height, + codedWidth: track.video.width, + nb_samples: track.nb_samples, + volume: track.volume, + hasAudio, + movie_timescale: track.movie_timescale, + movie_duration: track.movie_duration, + description: this.#description(track), + }); + + // Start demuxing. + this.#file.setExtractionOptions(track.id); + this.#file.start(); + } + + #onSamples(track_id, ref, samples) { + // console.log('onSamples', track_id, ref, samples); + // Generate and emit an EncodedVideoChunk for each demuxed sample. + for (const sample of samples) { + this.#onChunk( + new EncodedVideoChunk({ + type: sample.is_sync ? 'key' : 'delta', + timestamp: (1e6 * sample.cts) / sample.timescale, + duration: (1e6 * sample.duration) / sample.timescale, + data: sample.data, + }), + ); + } + } +} diff --git a/public/worker/gif.worker.js b/public/worker/gif.worker.js new file mode 100644 index 0000000..269624e --- /dev/null +++ b/public/worker/gif.worker.js @@ -0,0 +1,3 @@ +// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j= log_level) { + console.debug("["+Log.getDurationString(new Date()-start,1000)+"]","["+module+"]",msg); + } + }, + log : function(module, msg) { + this.debug(module.msg) + }, + info : function(module, msg) { + if (LOG_LEVEL_INFO >= log_level) { + console.info("["+Log.getDurationString(new Date()-start,1000)+"]","["+module+"]",msg); + } + }, + warn : function(module, msg) { + if (LOG_LEVEL_WARNING >= log_level) { + console.warn("["+Log.getDurationString(new Date()-start,1000)+"]","["+module+"]",msg); + } + }, + error : function(module, msg) { + if (LOG_LEVEL_ERROR >= log_level) { + console.error("["+Log.getDurationString(new Date()-start,1000)+"]","["+module+"]",msg); + } + } + }; + return logObject; + })(); + +/* Helper function to print a duration value in the form H:MM:SS.MS */ +Log.getDurationString = function(duration, _timescale) { + var neg; + /* Helper function to print a number on a fixed number of digits */ + function pad(number, length) { + var str = '' + number; + var a = str.split('.'); + while (a[0].length < length) { + a[0] = '0' + a[0]; + } + return a.join('.'); + } + if (duration < 0) { + neg = true; + duration = -duration; + } else { + neg = false; + } + var timescale = _timescale || 1; + var duration_sec = duration/timescale; + var hours = Math.floor(duration_sec/3600); + duration_sec -= hours * 3600; + var minutes = Math.floor(duration_sec/60); + duration_sec -= minutes * 60; + var msec = duration_sec*1000; + duration_sec = Math.floor(duration_sec); + msec -= duration_sec*1000; + msec = Math.floor(msec); + return (neg ? "-": "")+hours+":"+pad(minutes,2)+":"+pad(duration_sec,2)+"."+pad(msec,3); +} + +/* Helper function to stringify HTML5 TimeRanges objects */ +Log.printRanges = function(ranges) { + var length = ranges.length; + if (length > 0) { + var str = ""; + for (var i = 0; i < length; i++) { + if (i > 0) str += ","; + str += "["+Log.getDurationString(ranges.start(i))+ ","+Log.getDurationString(ranges.end(i))+"]"; + } + return str; + } else { + return "(empty)"; + } +} + +if (typeof exports !== 'undefined') { + exports.Log = Log; +} +// file:src/stream.js +var MP4BoxStream = function(arrayBuffer) { + if (arrayBuffer instanceof ArrayBuffer) { + this.buffer = arrayBuffer; + this.dataview = new DataView(arrayBuffer); + } else { + throw ("Needs an array buffer"); + } + this.position = 0; +}; + +/************************************************************************* + Common API between MultiBufferStream and SimpleStream + *************************************************************************/ +MP4BoxStream.prototype.getPosition = function() { + return this.position; +} + +MP4BoxStream.prototype.getEndPosition = function() { + return this.buffer.byteLength; +} + +MP4BoxStream.prototype.getLength = function() { + return this.buffer.byteLength; +} + +MP4BoxStream.prototype.seek = function (pos) { + var npos = Math.max(0, Math.min(this.buffer.byteLength, pos)); + this.position = (isNaN(npos) || !isFinite(npos)) ? 0 : npos; + return true; +} + +MP4BoxStream.prototype.isEos = function () { + return this.getPosition() >= this.getEndPosition(); +} + +/************************************************************************* + Read methods, simimar to DataStream but simpler + *************************************************************************/ +MP4BoxStream.prototype.readAnyInt = function(size, signed) { + var res = 0; + if (this.position + size <= this.buffer.byteLength) { + switch (size) { + case 1: + if (signed) { + res = this.dataview.getInt8(this.position); + } else { + res = this.dataview.getUint8(this.position); + } + break; + case 2: + if (signed) { + res = this.dataview.getInt16(this.position); + } else { + res = this.dataview.getUint16(this.position); + } + break; + case 3: + if (signed) { + throw ("No method for reading signed 24 bits values"); + } else { + res = this.dataview.getUint8(this.position) << 16; + res |= this.dataview.getUint8(this.position+1) << 8; + res |= this.dataview.getUint8(this.position+2); + } + break; + case 4: + if (signed) { + res = this.dataview.getInt32(this.position); + } else { + res = this.dataview.getUint32(this.position); + } + break; + case 8: + if (signed) { + throw ("No method for reading signed 64 bits values"); + } else { + res = this.dataview.getUint32(this.position) << 32; + res |= this.dataview.getUint32(this.position+4); + } + break; + default: + throw ("readInt method not implemented for size: "+size); + } + this.position+= size; + return res; + } else { + throw ("Not enough bytes in buffer"); + } +} + +MP4BoxStream.prototype.readUint8 = function() { + return this.readAnyInt(1, false); +} + +MP4BoxStream.prototype.readUint16 = function() { + return this.readAnyInt(2, false); +} + +MP4BoxStream.prototype.readUint24 = function() { + return this.readAnyInt(3, false); +} + +MP4BoxStream.prototype.readUint32 = function() { + return this.readAnyInt(4, false); +} + +MP4BoxStream.prototype.readUint64 = function() { + return this.readAnyInt(8, false); +} + +MP4BoxStream.prototype.readString = function(length) { + if (this.position + length <= this.buffer.byteLength) { + var s = ""; + for (var i = 0; i < length; i++) { + s += String.fromCharCode(this.readUint8()); + } + return s; + } else { + throw ("Not enough bytes in buffer"); + } +} + +MP4BoxStream.prototype.readCString = function() { + var arr = []; + while(true) { + var b = this.readUint8(); + if (b !== 0) { + arr.push(b); + } else { + break; + } + } + return String.fromCharCode.apply(null, arr); +} + +MP4BoxStream.prototype.readInt8 = function() { + return this.readAnyInt(1, true); +} + +MP4BoxStream.prototype.readInt16 = function() { + return this.readAnyInt(2, true); +} + +MP4BoxStream.prototype.readInt32 = function() { + return this.readAnyInt(4, true); +} + +MP4BoxStream.prototype.readInt64 = function() { + return this.readAnyInt(8, false); +} + +MP4BoxStream.prototype.readUint8Array = function(length) { + var arr = new Uint8Array(length); + for (var i = 0; i < length; i++) { + arr[i] = this.readUint8(); + } + return arr; +} + +MP4BoxStream.prototype.readInt16Array = function(length) { + var arr = new Int16Array(length); + for (var i = 0; i < length; i++) { + arr[i] = this.readInt16(); + } + return arr; +} + +MP4BoxStream.prototype.readUint16Array = function(length) { + var arr = new Int16Array(length); + for (var i = 0; i < length; i++) { + arr[i] = this.readUint16(); + } + return arr; +} + +MP4BoxStream.prototype.readUint32Array = function(length) { + var arr = new Uint32Array(length); + for (var i = 0; i < length; i++) { + arr[i] = this.readUint32(); + } + return arr; +} + +MP4BoxStream.prototype.readInt32Array = function(length) { + var arr = new Int32Array(length); + for (var i = 0; i < length; i++) { + arr[i] = this.readInt32(); + } + return arr; +} + +if (typeof exports !== 'undefined') { + exports.MP4BoxStream = MP4BoxStream; +}// file:src/DataStream.js +/** + DataStream reads scalars, arrays and structs of data from an ArrayBuffer. + It's like a file-like DataView on steroids. + + @param {ArrayBuffer} arrayBuffer ArrayBuffer to read from. + @param {?Number} byteOffset Offset from arrayBuffer beginning for the DataStream. + @param {?Boolean} endianness DataStream.BIG_ENDIAN or DataStream.LITTLE_ENDIAN (the default). + */ +var DataStream = function(arrayBuffer, byteOffset, endianness) { + this._byteOffset = byteOffset || 0; + if (arrayBuffer instanceof ArrayBuffer) { + this.buffer = arrayBuffer; + } else if (typeof arrayBuffer == "object") { + this.dataView = arrayBuffer; + if (byteOffset) { + this._byteOffset += byteOffset; + } + } else { + this.buffer = new ArrayBuffer(arrayBuffer || 0); + } + this.position = 0; + this.endianness = endianness == null ? DataStream.LITTLE_ENDIAN : endianness; +}; +DataStream.prototype = {}; + +DataStream.prototype.getPosition = function() { + return this.position; +} + +/** + Internal function to resize the DataStream buffer when required. + @param {number} extra Number of bytes to add to the buffer allocation. + @return {null} + */ +DataStream.prototype._realloc = function(extra) { + if (!this._dynamicSize) { + return; + } + var req = this._byteOffset + this.position + extra; + var blen = this._buffer.byteLength; + if (req <= blen) { + if (req > this._byteLength) { + this._byteLength = req; + } + return; + } + if (blen < 1) { + blen = 1; + } + while (req > blen) { + blen *= 2; + } + var buf = new ArrayBuffer(blen); + var src = new Uint8Array(this._buffer); + var dst = new Uint8Array(buf, 0, src.length); + dst.set(src); + this.buffer = buf; + this._byteLength = req; +}; + +/** + Internal function to trim the DataStream buffer when required. + Used for stripping out the extra bytes from the backing buffer when + the virtual byteLength is smaller than the buffer byteLength (happens after + growing the buffer with writes and not filling the extra space completely). + + @return {null} + */ +DataStream.prototype._trimAlloc = function() { + if (this._byteLength == this._buffer.byteLength) { + return; + } + var buf = new ArrayBuffer(this._byteLength); + var dst = new Uint8Array(buf); + var src = new Uint8Array(this._buffer, 0, dst.length); + dst.set(src); + this.buffer = buf; +}; + + +/** + Big-endian const to use as default endianness. + @type {boolean} + */ +DataStream.BIG_ENDIAN = false; + +/** + Little-endian const to use as default endianness. + @type {boolean} + */ +DataStream.LITTLE_ENDIAN = true; + +/** + Virtual byte length of the DataStream backing buffer. + Updated to be max of original buffer size and last written size. + If dynamicSize is false is set to buffer size. + @type {number} + */ +DataStream.prototype._byteLength = 0; + +/** + Returns the byte length of the DataStream object. + @type {number} + */ +Object.defineProperty(DataStream.prototype, 'byteLength', + { get: function() { + return this._byteLength - this._byteOffset; + }}); + +/** + Set/get the backing ArrayBuffer of the DataStream object. + The setter updates the DataView to point to the new buffer. + @type {Object} + */ +Object.defineProperty(DataStream.prototype, 'buffer', + { get: function() { + this._trimAlloc(); + return this._buffer; + }, + set: function(v) { + this._buffer = v; + this._dataView = new DataView(this._buffer, this._byteOffset); + this._byteLength = this._buffer.byteLength; + } }); + +/** + Set/get the byteOffset of the DataStream object. + The setter updates the DataView to point to the new byteOffset. + @type {number} + */ +Object.defineProperty(DataStream.prototype, 'byteOffset', + { get: function() { + return this._byteOffset; + }, + set: function(v) { + this._byteOffset = v; + this._dataView = new DataView(this._buffer, this._byteOffset); + this._byteLength = this._buffer.byteLength; + } }); + +/** + Set/get the backing DataView of the DataStream object. + The setter updates the buffer and byteOffset to point to the DataView values. + @type {Object} + */ +Object.defineProperty(DataStream.prototype, 'dataView', + { get: function() { + return this._dataView; + }, + set: function(v) { + this._byteOffset = v.byteOffset; + this._buffer = v.buffer; + this._dataView = new DataView(this._buffer, this._byteOffset); + this._byteLength = this._byteOffset + v.byteLength; + } }); + +/** + Sets the DataStream read/write position to given position. + Clamps between 0 and DataStream length. + + @param {number} pos Position to seek to. + @return {null} + */ +DataStream.prototype.seek = function(pos) { + var npos = Math.max(0, Math.min(this.byteLength, pos)); + this.position = (isNaN(npos) || !isFinite(npos)) ? 0 : npos; +}; + +/** + Returns true if the DataStream seek pointer is at the end of buffer and + there's no more data to read. + + @return {boolean} True if the seek pointer is at the end of the buffer. + */ +DataStream.prototype.isEof = function() { + return (this.position >= this._byteLength); +}; + + +/** + Maps a Uint8Array into the DataStream buffer. + + Nice for quickly reading in data. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Uint8Array to the DataStream backing buffer. + */ +DataStream.prototype.mapUint8Array = function(length) { + this._realloc(length * 1); + var arr = new Uint8Array(this._buffer, this.byteOffset+this.position, length); + this.position += length * 1; + return arr; +}; + + +/** + Reads an Int32Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Int32Array. + */ +DataStream.prototype.readInt32Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 4) : length; + var arr = new Int32Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads an Int16Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Int16Array. + */ +DataStream.prototype.readInt16Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 2) : length; + var arr = new Int16Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads an Int8Array of desired length from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Int8Array. + */ +DataStream.prototype.readInt8Array = function(length) { + length = length == null ? (this.byteLength-this.position) : length; + var arr = new Int8Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads a Uint32Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Uint32Array. + */ +DataStream.prototype.readUint32Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 4) : length; + var arr = new Uint32Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads a Uint16Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Uint16Array. + */ +DataStream.prototype.readUint16Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 2) : length; + var arr = new Uint16Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads a Uint8Array of desired length from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Uint8Array. + */ +DataStream.prototype.readUint8Array = function(length) { + length = length == null ? (this.byteLength-this.position) : length; + var arr = new Uint8Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads a Float64Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Float64Array. + */ +DataStream.prototype.readFloat64Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 8) : length; + var arr = new Float64Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + +/** + Reads a Float32Array of desired length and endianness from the DataStream. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} The read Float32Array. + */ +DataStream.prototype.readFloat32Array = function(length, e) { + length = length == null ? (this.byteLength-this.position / 4) : length; + var arr = new Float32Array(length); + DataStream.memcpy(arr.buffer, 0, + this.buffer, this.byteOffset+this.position, + length*arr.BYTES_PER_ELEMENT); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += arr.byteLength; + return arr; +}; + + +/** + Reads a 32-bit int from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readInt32 = function(e) { + var v = this._dataView.getInt32(this.position, e == null ? this.endianness : e); + this.position += 4; + return v; +}; + +/** + Reads a 16-bit int from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readInt16 = function(e) { + var v = this._dataView.getInt16(this.position, e == null ? this.endianness : e); + this.position += 2; + return v; +}; + +/** + Reads an 8-bit int from the DataStream. + + @return {number} The read number. + */ +DataStream.prototype.readInt8 = function() { + var v = this._dataView.getInt8(this.position); + this.position += 1; + return v; +}; + +/** + Reads a 32-bit unsigned int from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readUint32 = function(e) { + var v = this._dataView.getUint32(this.position, e == null ? this.endianness : e); + this.position += 4; + return v; +}; + +/** + Reads a 16-bit unsigned int from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readUint16 = function(e) { + var v = this._dataView.getUint16(this.position, e == null ? this.endianness : e); + this.position += 2; + return v; +}; + +/** + Reads an 8-bit unsigned int from the DataStream. + + @return {number} The read number. + */ +DataStream.prototype.readUint8 = function() { + var v = this._dataView.getUint8(this.position); + this.position += 1; + return v; +}; + +/** + Reads a 32-bit float from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readFloat32 = function(e) { + var v = this._dataView.getFloat32(this.position, e == null ? this.endianness : e); + this.position += 4; + return v; +}; + +/** + Reads a 64-bit float from the DataStream with the desired endianness. + + @param {?boolean} e Endianness of the number. + @return {number} The read number. + */ +DataStream.prototype.readFloat64 = function(e) { + var v = this._dataView.getFloat64(this.position, e == null ? this.endianness : e); + this.position += 8; + return v; +}; + +/** + Native endianness. Either DataStream.BIG_ENDIAN or DataStream.LITTLE_ENDIAN + depending on the platform endianness. + + @type {boolean} + */ +DataStream.endianness = new Int8Array(new Int16Array([1]).buffer)[0] > 0; + +/** + Copies byteLength bytes from the src buffer at srcOffset to the + dst buffer at dstOffset. + + @param {Object} dst Destination ArrayBuffer to write to. + @param {number} dstOffset Offset to the destination ArrayBuffer. + @param {Object} src Source ArrayBuffer to read from. + @param {number} srcOffset Offset to the source ArrayBuffer. + @param {number} byteLength Number of bytes to copy. + */ +DataStream.memcpy = function(dst, dstOffset, src, srcOffset, byteLength) { + var dstU8 = new Uint8Array(dst, dstOffset, byteLength); + var srcU8 = new Uint8Array(src, srcOffset, byteLength); + dstU8.set(srcU8); +}; + +/** + Converts array to native endianness in-place. + + @param {Object} array Typed array to convert. + @param {boolean} arrayIsLittleEndian True if the data in the array is + little-endian. Set false for big-endian. + @return {Object} The converted typed array. + */ +DataStream.arrayToNative = function(array, arrayIsLittleEndian) { + if (arrayIsLittleEndian == this.endianness) { + return array; + } else { + return this.flipArrayEndianness(array); + } +}; + +/** + Converts native endianness array to desired endianness in-place. + + @param {Object} array Typed array to convert. + @param {boolean} littleEndian True if the converted array should be + little-endian. Set false for big-endian. + @return {Object} The converted typed array. + */ +DataStream.nativeToEndian = function(array, littleEndian) { + if (this.endianness == littleEndian) { + return array; + } else { + return this.flipArrayEndianness(array); + } +}; + +/** + Flips typed array endianness in-place. + + @param {Object} array Typed array to flip. + @return {Object} The converted typed array. + */ +DataStream.flipArrayEndianness = function(array) { + var u8 = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + for (var i=0; ik; j--, k++) { + var tmp = u8[k]; + u8[k] = u8[j]; + u8[j] = tmp; + } + } + return array; +}; + +/** + Seek position where DataStream#readStruct ran into a problem. + Useful for debugging struct parsing. + + @type {number} + */ +DataStream.prototype.failurePosition = 0; + +String.fromCharCodeUint8 = function(uint8arr) { + var arr = []; + for (var i = 0; i < uint8arr.length; i++) { + arr[i] = uint8arr[i]; + } + return String.fromCharCode.apply(null, arr); +} +/** + Read a string of desired length and encoding from the DataStream. + + @param {number} length The length of the string to read in bytes. + @param {?string} encoding The encoding of the string data in the DataStream. + Defaults to ASCII. + @return {string} The read string. + */ +DataStream.prototype.readString = function(length, encoding) { + if (encoding == null || encoding == "ASCII") { + return String.fromCharCodeUint8.apply(null, [this.mapUint8Array(length == null ? this.byteLength-this.position : length)]); + } else { + return (new TextDecoder(encoding)).decode(this.mapUint8Array(length)); + } +}; + +/** + Read null-terminated string of desired length from the DataStream. Truncates + the returned string so that the null byte is not a part of it. + + @param {?number} length The length of the string to read. + @return {string} The read string. + */ +DataStream.prototype.readCString = function(length) { + var blen = this.byteLength-this.position; + var u8 = new Uint8Array(this._buffer, this._byteOffset + this.position); + var len = blen; + if (length != null) { + len = Math.min(length, blen); + } + for (var i = 0; i < len && u8[i] !== 0; i++); // find first zero byte + var s = String.fromCharCodeUint8.apply(null, [this.mapUint8Array(i)]); + if (length != null) { + this.position += len-i; + } else if (i != blen) { + this.position += 1; // trailing zero if not at end of buffer + } + return s; +}; + +/* + TODO: fix endianness for 24/64-bit fields + TODO: check range/support for 64-bits numbers in JavaScript +*/ +var MAX_SIZE = Math.pow(2, 32); + +DataStream.prototype.readInt64 = function () { + return (this.readInt32()*MAX_SIZE)+this.readUint32(); +} +DataStream.prototype.readUint64 = function () { + return (this.readUint32()*MAX_SIZE)+this.readUint32(); +} + +DataStream.prototype.readInt64 = function () { + return (this.readUint32()*MAX_SIZE)+this.readUint32(); +} + +DataStream.prototype.readUint24 = function () { + return (this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8(); +} + +if (typeof exports !== 'undefined') { + exports.DataStream = DataStream; +} +// file:src/DataStream-write.js +/** + Saves the DataStream contents to the given filename. + Uses Chrome's anchor download property to initiate download. + + @param {string} filename Filename to save as. + @return {null} + */ +DataStream.prototype.save = function(filename) { + var blob = new Blob([this.buffer]); + if (window.URL && URL.createObjectURL) { + var url = window.URL.createObjectURL(blob); + var a = document.createElement('a'); + // Required in Firefox: + document.body.appendChild(a); + a.setAttribute('href', url); + a.setAttribute('download', filename); + // Required in Firefox: + a.setAttribute('target', '_self'); + a.click(); + window.URL.revokeObjectURL(url); + } else { + throw("DataStream.save: Can't create object URL."); + } +}; + +/** + Whether to extend DataStream buffer when trying to write beyond its size. + If set, the buffer is reallocated to twice its current size until the + requested write fits the buffer. + @type {boolean} + */ +DataStream.prototype._dynamicSize = true; +Object.defineProperty(DataStream.prototype, 'dynamicSize', + { get: function() { + return this._dynamicSize; + }, + set: function(v) { + if (!v) { + this._trimAlloc(); + } + this._dynamicSize = v; + } }); + +/** + Internal function to trim the DataStream buffer when required. + Used for stripping out the first bytes when not needed anymore. + + @return {null} + */ +DataStream.prototype.shift = function(offset) { + var buf = new ArrayBuffer(this._byteLength-offset); + var dst = new Uint8Array(buf); + var src = new Uint8Array(this._buffer, offset, dst.length); + dst.set(src); + this.buffer = buf; + this.position -= offset; +}; + +/** + Writes an Int32Array of specified endianness to the DataStream. + + @param {Object} arr The array to write. + @param {?boolean} e Endianness of the data to write. + */ +DataStream.prototype.writeInt32Array = function(arr, e) { + this._realloc(arr.length * 4); + if (arr instanceof Int32Array && + this.byteOffset+this.position % arr.BYTES_PER_ELEMENT === 0) { + DataStream.memcpy(this._buffer, this.byteOffset+this.position, + arr.buffer, 0, + arr.byteLength); + this.mapInt32Array(arr.length, e); + } else { + for (var i=0; i>16); + this.writeUint8((v & 0x0000FF00)>>8); + this.writeUint8((v & 0x000000FF)); +} + +DataStream.prototype.adjustUint32 = function(position, value) { + var pos = this.position; + this.seek(position); + this.writeUint32(value); + this.seek(pos); +} +// file:src/DataStream-map.js +/** + Maps an Int32Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Int32Array to the DataStream backing buffer. + */ +DataStream.prototype.mapInt32Array = function(length, e) { + this._realloc(length * 4); + var arr = new Int32Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 4; + return arr; +}; + +/** + Maps an Int16Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Int16Array to the DataStream backing buffer. + */ +DataStream.prototype.mapInt16Array = function(length, e) { + this._realloc(length * 2); + var arr = new Int16Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 2; + return arr; +}; + +/** + Maps an Int8Array into the DataStream buffer. + + Nice for quickly reading in data. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Int8Array to the DataStream backing buffer. + */ +DataStream.prototype.mapInt8Array = function(length) { + this._realloc(length * 1); + var arr = new Int8Array(this._buffer, this.byteOffset+this.position, length); + this.position += length * 1; + return arr; +}; + +/** + Maps a Uint32Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Uint32Array to the DataStream backing buffer. + */ +DataStream.prototype.mapUint32Array = function(length, e) { + this._realloc(length * 4); + var arr = new Uint32Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 4; + return arr; +}; + +/** + Maps a Uint16Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Uint16Array to the DataStream backing buffer. + */ +DataStream.prototype.mapUint16Array = function(length, e) { + this._realloc(length * 2); + var arr = new Uint16Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 2; + return arr; +}; + +/** + Maps a Float64Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Float64Array to the DataStream backing buffer. + */ +DataStream.prototype.mapFloat64Array = function(length, e) { + this._realloc(length * 8); + var arr = new Float64Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 8; + return arr; +}; + +/** + Maps a Float32Array into the DataStream buffer, swizzling it to native + endianness in-place. The current offset from the start of the buffer needs to + be a multiple of element size, just like with typed array views. + + Nice for quickly reading in data. Warning: potentially modifies the buffer + contents. + + @param {number} length Number of elements to map. + @param {?boolean} e Endianness of the data to read. + @return {Object} Float32Array to the DataStream backing buffer. + */ +DataStream.prototype.mapFloat32Array = function(length, e) { + this._realloc(length * 4); + var arr = new Float32Array(this._buffer, this.byteOffset+this.position, length); + DataStream.arrayToNative(arr, e == null ? this.endianness : e); + this.position += length * 4; + return arr; +}; +// file:src/buffer.js +/** + * MultiBufferStream is a class that acts as a SimpleStream for parsing + * It holds several, possibly non-contiguous ArrayBuffer objects, each with a fileStart property + * containing the offset for the buffer data in an original/virtual file + * + * It inherits also from DataStream for all read/write/alloc operations + */ + +/** + * Constructor + */ +var MultiBufferStream = function(buffer) { + /* List of ArrayBuffers, with a fileStart property, sorted in fileStart order and non overlapping */ + this.buffers = []; + this.bufferIndex = -1; + if (buffer) { + this.insertBuffer(buffer); + this.bufferIndex = 0; + } +} +MultiBufferStream.prototype = new DataStream(new ArrayBuffer(), 0, DataStream.BIG_ENDIAN); + +/************************************************************************************ + Methods for the managnement of the buffers (insertion, removal, concatenation, ...) + ***********************************************************************************/ + +MultiBufferStream.prototype.initialized = function() { + var firstBuffer; + if (this.bufferIndex > -1) { + return true; + } else if (this.buffers.length > 0) { + firstBuffer = this.buffers[0]; + if (firstBuffer.fileStart === 0) { + this.buffer = firstBuffer; + this.bufferIndex = 0; + Log.debug("MultiBufferStream", "Stream ready for parsing"); + return true; + } else { + Log.warn("MultiBufferStream", "The first buffer should have a fileStart of 0"); + this.logBufferLevel(); + return false; + } + } else { + Log.warn("MultiBufferStream", "No buffer to start parsing from"); + this.logBufferLevel(); + return false; + } +} + +/** + * helper functions to concatenate two ArrayBuffer objects + * @param {ArrayBuffer} buffer1 + * @param {ArrayBuffer} buffer2 + * @return {ArrayBuffer} the concatenation of buffer1 and buffer2 in that order + */ +ArrayBuffer.concat = function(buffer1, buffer2) { + Log.debug("ArrayBuffer", "Trying to create a new buffer of size: "+(buffer1.byteLength + buffer2.byteLength)); + var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); + tmp.set(new Uint8Array(buffer1), 0); + tmp.set(new Uint8Array(buffer2), buffer1.byteLength); + return tmp.buffer; +}; + +/** + * Reduces the size of a given buffer, but taking the part between offset and offset+newlength + * @param {ArrayBuffer} buffer + * @param {Number} offset the start of new buffer + * @param {Number} newLength the length of the new buffer + * @return {ArrayBuffer} the new buffer + */ +MultiBufferStream.prototype.reduceBuffer = function(buffer, offset, newLength) { + var smallB; + smallB = new Uint8Array(newLength); + smallB.set(new Uint8Array(buffer, offset, newLength)); + smallB.buffer.fileStart = buffer.fileStart+offset; + smallB.buffer.usedBytes = 0; + return smallB.buffer; +} + +/** + * Inserts the new buffer in the sorted list of buffers, + * making sure, it is not overlapping with existing ones (possibly reducing its size). + * if the new buffer overrides/replaces the 0-th buffer (for instance because it is bigger), + * updates the DataStream buffer for parsing +*/ +MultiBufferStream.prototype.insertBuffer = function(ab) { + var to_add = true; + /* TODO: improve insertion if many buffers */ + for (var i = 0; i < this.buffers.length; i++) { + var b = this.buffers[i]; + if (ab.fileStart <= b.fileStart) { + /* the insertion position is found */ + if (ab.fileStart === b.fileStart) { + /* The new buffer overlaps with an existing buffer */ + if (ab.byteLength > b.byteLength) { + /* the new buffer is bigger than the existing one + remove the existing buffer and try again to insert + the new buffer to check overlap with the next ones */ + this.buffers.splice(i, 1); + i--; + continue; + } else { + /* the new buffer is smaller than the existing one, just drop it */ + Log.warn("MultiBufferStream", "Buffer (fileStart: "+ab.fileStart+" - Length: "+ab.byteLength+") already appended, ignoring"); + } + } else { + /* The beginning of the new buffer is not overlapping with an existing buffer + let's check the end of it */ + if (ab.fileStart + ab.byteLength <= b.fileStart) { + /* no overlap, we can add it as is */ + } else { + /* There is some overlap, cut the new buffer short, and add it*/ + ab = this.reduceBuffer(ab, 0, b.fileStart - ab.fileStart); + } + Log.debug("MultiBufferStream", "Appending new buffer (fileStart: "+ab.fileStart+" - Length: "+ab.byteLength+")"); + this.buffers.splice(i, 0, ab); + /* if this new buffer is inserted in the first place in the list of the buffer, + and the DataStream is initialized, make it the buffer used for parsing */ + if (i === 0) { + this.buffer = ab; + } + } + to_add = false; + break; + } else if (ab.fileStart < b.fileStart + b.byteLength) { + /* the new buffer overlaps its beginning with the end of the current buffer */ + var offset = b.fileStart + b.byteLength - ab.fileStart; + var newLength = ab.byteLength - offset; + if (newLength > 0) { + /* the new buffer is bigger than the current overlap, drop the overlapping part and try again inserting the remaining buffer */ + ab = this.reduceBuffer(ab, offset, newLength); + } else { + /* the content of the new buffer is entirely contained in the existing buffer, drop it entirely */ + to_add = false; + break; + } + } + } + /* if the buffer has not been added, we can add it at the end */ + if (to_add) { + Log.debug("MultiBufferStream", "Appending new buffer (fileStart: "+ab.fileStart+" - Length: "+ab.byteLength+")"); + this.buffers.push(ab); + /* if this new buffer is inserted in the first place in the list of the buffer, + and the DataStream is initialized, make it the buffer used for parsing */ + if (i === 0) { + this.buffer = ab; + } + } +} + +/** + * Displays the status of the buffers (number and used bytes) + * @param {Object} info callback method for display + */ +MultiBufferStream.prototype.logBufferLevel = function(info) { + var i; + var buffer; + var used, total; + var ranges = []; + var range; + var bufferedString = ""; + used = 0; + total = 0; + for (i = 0; i < this.buffers.length; i++) { + buffer = this.buffers[i]; + if (i === 0) { + range = {}; + ranges.push(range); + range.start = buffer.fileStart; + range.end = buffer.fileStart+buffer.byteLength; + bufferedString += "["+range.start+"-"; + } else if (range.end === buffer.fileStart) { + range.end = buffer.fileStart+buffer.byteLength; + } else { + range = {}; + range.start = buffer.fileStart; + bufferedString += (ranges[ranges.length-1].end-1)+"], ["+range.start+"-"; + range.end = buffer.fileStart+buffer.byteLength; + ranges.push(range); + } + used += buffer.usedBytes; + total += buffer.byteLength; + } + if (ranges.length > 0) { + bufferedString += (range.end-1)+"]"; + } + var log = (info ? Log.info : Log.debug) + if (this.buffers.length === 0) { + log("MultiBufferStream", "No more buffer in memory"); + } else { + log("MultiBufferStream", ""+this.buffers.length+" stored buffer(s) ("+used+"/"+total+" bytes), continuous ranges: "+bufferedString); + } +} + +MultiBufferStream.prototype.cleanBuffers = function () { + var i; + var buffer; + for (i = 0; i < this.buffers.length; i++) { + buffer = this.buffers[i]; + if (buffer.usedBytes === buffer.byteLength) { + Log.debug("MultiBufferStream", "Removing buffer #"+i); + this.buffers.splice(i, 1); + i--; + } + } +} + +MultiBufferStream.prototype.mergeNextBuffer = function() { + var next_buffer; + if (this.bufferIndex+1 < this.buffers.length) { + next_buffer = this.buffers[this.bufferIndex+1]; + if (next_buffer.fileStart === this.buffer.fileStart + this.buffer.byteLength) { + var oldLength = this.buffer.byteLength; + var oldUsedBytes = this.buffer.usedBytes; + var oldFileStart = this.buffer.fileStart; + this.buffers[this.bufferIndex] = ArrayBuffer.concat(this.buffer, next_buffer); + this.buffer = this.buffers[this.bufferIndex]; + this.buffers.splice(this.bufferIndex+1, 1); + this.buffer.usedBytes = oldUsedBytes; /* TODO: should it be += ? */ + this.buffer.fileStart = oldFileStart; + Log.debug("ISOFile", "Concatenating buffer for box parsing (length: "+oldLength+"->"+this.buffer.byteLength+")"); + return true; + } else { + return false; + } + } else { + return false; + } +} + + +/************************************************************************* + Seek-related functions + *************************************************************************/ + +/** + * Finds the buffer that holds the given file position + * @param {Boolean} fromStart indicates if the search should start from the current buffer (false) + * or from the first buffer (true) + * @param {Number} filePosition position in the file to seek to + * @param {Boolean} markAsUsed indicates if the bytes in between the current position and the seek position + * should be marked as used for garbage collection + * @return {Number} the index of the buffer holding the seeked file position, -1 if not found. + */ +MultiBufferStream.prototype.findPosition = function(fromStart, filePosition, markAsUsed) { + var i; + var abuffer = null; + var index = -1; + + /* find the buffer with the largest position smaller than the given position */ + if (fromStart === true) { + /* the reposition can be in the past, we need to check from the beginning of the list of buffers */ + i = 0; + } else { + i = this.bufferIndex; + } + + while (i < this.buffers.length) { + abuffer = this.buffers[i]; + if (abuffer.fileStart <= filePosition) { + index = i; + if (markAsUsed) { + if (abuffer.fileStart + abuffer.byteLength <= filePosition) { + abuffer.usedBytes = abuffer.byteLength; + } else { + abuffer.usedBytes = filePosition - abuffer.fileStart; + } + this.logBufferLevel(); + } + } else { + break; + } + i++; + } + + if (index !== -1) { + abuffer = this.buffers[index]; + if (abuffer.fileStart + abuffer.byteLength >= filePosition) { + Log.debug("MultiBufferStream", "Found position in existing buffer #"+index); + return index; + } else { + return -1; + } + } else { + return -1; + } +} + +/** + * Finds the largest file position contained in a buffer or in the next buffers if they are contiguous (no gap) + * starting from the given buffer index or from the current buffer if the index is not given + * + * @param {Number} inputindex Index of the buffer to start from + * @return {Number} The largest file position found in the buffers + */ +MultiBufferStream.prototype.findEndContiguousBuf = function(inputindex) { + var i; + var currentBuf; + var nextBuf; + var index = (inputindex !== undefined ? inputindex : this.bufferIndex); + currentBuf = this.buffers[index]; + /* find the end of the contiguous range of data */ + if (this.buffers.length > index+1) { + for (i = index+1; i < this.buffers.length; i++) { + nextBuf = this.buffers[i]; + if (nextBuf.fileStart === currentBuf.fileStart + currentBuf.byteLength) { + currentBuf = nextBuf; + } else { + break; + } + } + } + /* return the position of last byte in the file that we have */ + return currentBuf.fileStart + currentBuf.byteLength; +} + +/** + * Returns the largest file position contained in the buffers, larger than the given position + * @param {Number} pos the file position to start from + * @return {Number} the largest position in the current buffer or in the buffer and the next contiguous + * buffer that holds the given position + */ +MultiBufferStream.prototype.getEndFilePositionAfter = function(pos) { + var index = this.findPosition(true, pos, false); + if (index !== -1) { + return this.findEndContiguousBuf(index); + } else { + return pos; + } +} + +/************************************************************************* + Garbage collection related functions + *************************************************************************/ + +/** + * Marks a given number of bytes as used in the current buffer for garbage collection + * @param {Number} nbBytes + */ +MultiBufferStream.prototype.addUsedBytes = function(nbBytes) { + this.buffer.usedBytes += nbBytes; + this.logBufferLevel(); +} + +/** + * Marks the entire current buffer as used, ready for garbage collection + */ +MultiBufferStream.prototype.setAllUsedBytes = function() { + this.buffer.usedBytes = this.buffer.byteLength; + this.logBufferLevel(); +} + +/************************************************************************* + Common API between MultiBufferStream and SimpleStream + *************************************************************************/ + +/** + * Tries to seek to a given file position + * if possible, repositions the parsing from there and returns true + * if not possible, does not change anything and returns false + * @param {Number} filePosition position in the file to seek to + * @param {Boolean} fromStart indicates if the search should start from the current buffer (false) + * or from the first buffer (true) + * @param {Boolean} markAsUsed indicates if the bytes in between the current position and the seek position + * should be marked as used for garbage collection + * @return {Boolean} true if the seek succeeded, false otherwise + */ +MultiBufferStream.prototype.seek = function(filePosition, fromStart, markAsUsed) { + var index; + index = this.findPosition(fromStart, filePosition, markAsUsed); + if (index !== -1) { + this.buffer = this.buffers[index]; + this.bufferIndex = index; + this.position = filePosition - this.buffer.fileStart; + Log.debug("MultiBufferStream", "Repositioning parser at buffer position: "+this.position); + return true; + } else { + Log.debug("MultiBufferStream", "Position "+filePosition+" not found in buffered data"); + return false; + } +} + +/** + * Returns the current position in the file + * @return {Number} the position in the file + */ +MultiBufferStream.prototype.getPosition = function() { + if (this.bufferIndex === -1 || this.buffers[this.bufferIndex] === null) { + throw "Error accessing position in the MultiBufferStream"; + } + return this.buffers[this.bufferIndex].fileStart+this.position; +} + +/** + * Returns the length of the current buffer + * @return {Number} the length of the current buffer + */ +MultiBufferStream.prototype.getLength = function() { + return this.byteLength; +} + +MultiBufferStream.prototype.getEndPosition = function() { + if (this.bufferIndex === -1 || this.buffers[this.bufferIndex] === null) { + throw "Error accessing position in the MultiBufferStream"; + } + return this.buffers[this.bufferIndex].fileStart+this.byteLength; +} + +if (typeof exports !== 'undefined') { + exports.MultiBufferStream = MultiBufferStream; +}// file:src/descriptor.js +/* + * Copyright (c) 2012-2013. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +var MPEG4DescriptorParser = function () { + var ES_DescrTag = 0x03; + var DecoderConfigDescrTag = 0x04; + var DecSpecificInfoTag = 0x05; + var SLConfigDescrTag = 0x06; + + var descTagToName = []; + descTagToName[ES_DescrTag] = "ES_Descriptor"; + descTagToName[DecoderConfigDescrTag] = "DecoderConfigDescriptor"; + descTagToName[DecSpecificInfoTag] = "DecoderSpecificInfo"; + descTagToName[SLConfigDescrTag] = "SLConfigDescriptor"; + + this.getDescriptorName = function(tag) { + return descTagToName[tag]; + } + + var that = this; + var classes = {}; + + this.parseOneDescriptor = function (stream) { + var hdrSize = 0; + var size = 0; + var tag; + var desc; + var byteRead; + tag = stream.readUint8(); + hdrSize++; + byteRead = stream.readUint8(); + hdrSize++; + while (byteRead & 0x80) { + size = (size << 7) + (byteRead & 0x7F); + byteRead = stream.readUint8(); + hdrSize++; + } + size = (size << 7) + (byteRead & 0x7F); + Log.debug("MPEG4DescriptorParser", "Found "+(descTagToName[tag] || "Descriptor "+tag)+", size "+size+" at position "+stream.getPosition()); + if (descTagToName[tag]) { + desc = new classes[descTagToName[tag]](size); + } else { + desc = new classes.Descriptor(size); + } + desc.parse(stream); + return desc; + } + + classes.Descriptor = function(_tag, _size) { + this.tag = _tag; + this.size = _size; + this.descs = []; + } + + classes.Descriptor.prototype.parse = function (stream) { + this.data = stream.readUint8Array(this.size); + } + + classes.Descriptor.prototype.findDescriptor = function (tag) { + for (var i = 0; i < this.descs.length; i++) { + if (this.descs[i].tag == tag) { + return this.descs[i]; + } + } + return null; + } + + classes.Descriptor.prototype.parseRemainingDescriptors = function (stream) { + var start = stream.position; + while (stream.position < start+this.size) { + var desc = that.parseOneDescriptor(stream); + this.descs.push(desc); + } + } + + classes.ES_Descriptor = function (size) { + classes.Descriptor.call(this, ES_DescrTag, size); + } + + classes.ES_Descriptor.prototype = new classes.Descriptor(); + + classes.ES_Descriptor.prototype.parse = function(stream) { + this.ES_ID = stream.readUint16(); + this.flags = stream.readUint8(); + this.size -= 3; + if (this.flags & 0x80) { + this.dependsOn_ES_ID = stream.readUint16(); + this.size -= 2; + } else { + this.dependsOn_ES_ID = 0; + } + if (this.flags & 0x40) { + var l = stream.readUint8(); + this.URL = stream.readString(l); + this.size -= l+1; + } else { + this.URL = ""; + } + if (this.flags & 0x20) { + this.OCR_ES_ID = stream.readUint16(); + this.size -= 2; + } else { + this.OCR_ES_ID = 0; + } + this.parseRemainingDescriptors(stream); + } + + classes.ES_Descriptor.prototype.getOTI = function(stream) { + var dcd = this.findDescriptor(DecoderConfigDescrTag); + if (dcd) { + return dcd.oti; + } else { + return 0; + } + } + + classes.ES_Descriptor.prototype.getAudioConfig = function(stream) { + var dcd = this.findDescriptor(DecoderConfigDescrTag); + if (!dcd) return null; + var dsi = dcd.findDescriptor(DecSpecificInfoTag); + if (dsi && dsi.data) { + var audioObjectType = (dsi.data[0]& 0xF8) >> 3; + if (audioObjectType === 31 && dsi.data.length >= 2) { + audioObjectType = 32 + ((dsi.data[0] & 0x7) << 3) + ((dsi.data[1] & 0xE0) >> 5); + } + return audioObjectType; + } else { + return null; + } + } + + classes.DecoderConfigDescriptor = function (size) { + classes.Descriptor.call(this, DecoderConfigDescrTag, size); + } + classes.DecoderConfigDescriptor.prototype = new classes.Descriptor(); + + classes.DecoderConfigDescriptor.prototype.parse = function(stream) { + this.oti = stream.readUint8(); + this.streamType = stream.readUint8(); + this.upStream = ((this.streamType >> 1) & 1) !== 0; + this.streamType = this.streamType >>> 2; + this.bufferSize = stream.readUint24(); + this.maxBitrate = stream.readUint32(); + this.avgBitrate = stream.readUint32(); + this.size -= 13; + this.parseRemainingDescriptors(stream); + } + + classes.DecoderSpecificInfo = function (size) { + classes.Descriptor.call(this, DecSpecificInfoTag, size); + } + classes.DecoderSpecificInfo.prototype = new classes.Descriptor(); + + classes.SLConfigDescriptor = function (size) { + classes.Descriptor.call(this, SLConfigDescrTag, size); + } + classes.SLConfigDescriptor.prototype = new classes.Descriptor(); + + return this; +} + +if (typeof exports !== 'undefined') { + exports.MPEG4DescriptorParser = MPEG4DescriptorParser; +} +// file:src/box.js +/* + * Copyright (c) 2012-2013. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +var BoxParser = { + ERR_INVALID_DATA : -1, + ERR_NOT_ENOUGH_DATA : 0, + OK : 1, + + // Boxes to be created with default parsing + BASIC_BOXES: [ "mdat", "idat", "free", "skip", "meco", "strk" ], + FULL_BOXES: [ "hmhd", "nmhd", "iods", "xml ", "bxml", "ipro", "mere" ], + CONTAINER_BOXES: [ + [ "moov", [ "trak", "pssh" ] ], + [ "trak" ], + [ "edts" ], + [ "mdia" ], + [ "minf" ], + [ "dinf" ], + [ "stbl", [ "sgpd", "sbgp" ] ], + [ "mvex", [ "trex" ] ], + [ "moof", [ "traf" ] ], + [ "traf", [ "trun", "sgpd", "sbgp" ] ], + [ "vttc" ], + [ "tref" ], + [ "iref" ], + [ "mfra", [ "tfra" ] ], + [ "meco" ], + [ "hnti" ], + [ "hinf" ], + [ "strk" ], + [ "strd" ], + [ "sinf" ], + [ "rinf" ], + [ "schi" ], + [ "trgr" ], + [ "udta", ["kind"] ], + [ "iprp", ["ipma"] ], + [ "ipco" ], + [ "grpl" ], + [ "j2kH" ], + [ "etyp", [ "tyco"] ] + ], + // Boxes effectively created + boxCodes : [], + fullBoxCodes : [], + containerBoxCodes : [], + sampleEntryCodes : {}, + sampleGroupEntryCodes: [], + trackGroupTypes: [], + UUIDBoxes: {}, + UUIDs: [], + initialize: function() { + BoxParser.FullBox.prototype = new BoxParser.Box(); + BoxParser.ContainerBox.prototype = new BoxParser.Box(); + BoxParser.SampleEntry.prototype = new BoxParser.Box(); + BoxParser.TrackGroupTypeBox.prototype = new BoxParser.FullBox(); + + /* creating constructors for simple boxes */ + BoxParser.BASIC_BOXES.forEach(function(type) { + BoxParser.createBoxCtor(type) + }); + BoxParser.FULL_BOXES.forEach(function(type) { + BoxParser.createFullBoxCtor(type); + }); + BoxParser.CONTAINER_BOXES.forEach(function(types) { + BoxParser.createContainerBoxCtor(types[0], null, types[1]); + }); + }, + Box: function(_type, _size, _uuid) { + this.type = _type; + this.size = _size; + this.uuid = _uuid; + }, + FullBox: function(type, size, uuid) { + BoxParser.Box.call(this, type, size, uuid); + this.flags = 0; + this.version = 0; + }, + ContainerBox: function(type, size, uuid) { + BoxParser.Box.call(this, type, size, uuid); + this.boxes = []; + }, + SampleEntry: function(type, size, hdr_size, start) { + BoxParser.ContainerBox.call(this, type, size); + this.hdr_size = hdr_size; + this.start = start; + }, + SampleGroupEntry: function(type) { + this.grouping_type = type; + }, + TrackGroupTypeBox: function(type, size) { + BoxParser.FullBox.call(this, type, size); + }, + createBoxCtor: function(type, parseMethod){ + BoxParser.boxCodes.push(type); + BoxParser[type+"Box"] = function(size) { + BoxParser.Box.call(this, type, size); + } + BoxParser[type+"Box"].prototype = new BoxParser.Box(); + if (parseMethod) BoxParser[type+"Box"].prototype.parse = parseMethod; + }, + createFullBoxCtor: function(type, parseMethod) { + //BoxParser.fullBoxCodes.push(type); + BoxParser[type+"Box"] = function(size) { + BoxParser.FullBox.call(this, type, size); + } + BoxParser[type+"Box"].prototype = new BoxParser.FullBox(); + BoxParser[type+"Box"].prototype.parse = function(stream) { + this.parseFullHeader(stream); + if (parseMethod) { + parseMethod.call(this, stream); + } + }; + }, + addSubBoxArrays: function(subBoxNames) { + if (subBoxNames) { + this.subBoxNames = subBoxNames; + var nbSubBoxes = subBoxNames.length; + for (var k = 0; k parentSize) { + Log.error("BoxParser", "Box of type '"+type+"' has a size "+size+" greater than its container size "+parentSize); + return { code: BoxParser.ERR_NOT_ENOUGH_DATA, type: type, size: size, hdr_size: hdr_size, start: start }; + } + if (size !== 0 && start + size > stream.getEndPosition()) { + stream.seek(start); + Log.info("BoxParser", "Not enough data in stream to parse the entire '"+type+"' box"); + return { code: BoxParser.ERR_NOT_ENOUGH_DATA, type: type, size: size, hdr_size: hdr_size, start: start }; + } + if (headerOnly) { + return { code: BoxParser.OK, type: type, size: size, hdr_size: hdr_size, start: start }; + } else { + if (BoxParser[type+"Box"]) { + box = new BoxParser[type+"Box"](size); + } else { + if (type !== "uuid") { + Log.warn("BoxParser", "Unknown box type: '"+type+"'"); + box = new BoxParser.Box(type, size); + box.has_unparsed_data = true; + } else { + if (BoxParser.UUIDBoxes[uuid]) { + box = new BoxParser.UUIDBoxes[uuid](size); + } else { + Log.warn("BoxParser", "Unknown uuid type: '"+uuid+"'"); + box = new BoxParser.Box(type, size); + box.uuid = uuid; + box.has_unparsed_data = true; + } + } + } + } + box.hdr_size = hdr_size; + /* recording the position of the box in the input stream */ + box.start = start; + if (box.write === BoxParser.Box.prototype.write && box.type !== "mdat") { + Log.info("BoxParser", "'"+box_type+"' box writing not yet implemented, keeping unparsed data in memory for later write"); + box.parseDataAndRewind(stream); + } + box.parse(stream); + diff = stream.getPosition() - (box.start+box.size); + if (diff < 0) { + Log.warn("BoxParser", "Parsing of box '"+box_type+"' did not read the entire indicated box data size (missing "+(-diff)+" bytes), seeking forward"); + stream.seek(box.start+box.size); + } else if (diff > 0) { + Log.error("BoxParser", "Parsing of box '"+box_type+"' read "+diff+" more bytes than the indicated box data size, seeking backwards"); + if (box.size !== 0) stream.seek(box.start+box.size); + } + return { code: BoxParser.OK, box: box, size: box.size }; +} + +BoxParser.Box.prototype.parse = function(stream) { + if (this.type != "mdat") { + this.data = stream.readUint8Array(this.size-this.hdr_size); + } else { + if (this.size === 0) { + stream.seek(stream.getEndPosition()); + } else { + stream.seek(this.start+this.size); + } + } +} + +/* Used to parse a box without consuming its data, to allow detailled parsing + Useful for boxes for which a write method is not yet implemented */ +BoxParser.Box.prototype.parseDataAndRewind = function(stream) { + this.data = stream.readUint8Array(this.size-this.hdr_size); + // rewinding + stream.position -= this.size-this.hdr_size; +} + +BoxParser.FullBox.prototype.parseDataAndRewind = function(stream) { + this.parseFullHeader(stream); + this.data = stream.readUint8Array(this.size-this.hdr_size); + // restore the header size as if the full header had not been parsed + this.hdr_size -= 4; + // rewinding + stream.position -= this.size-this.hdr_size; +} + +BoxParser.FullBox.prototype.parseFullHeader = function (stream) { + this.version = stream.readUint8(); + this.flags = stream.readUint24(); + this.hdr_size += 4; +} + +BoxParser.FullBox.prototype.parse = function (stream) { + this.parseFullHeader(stream); + this.data = stream.readUint8Array(this.size-this.hdr_size); +} + +BoxParser.ContainerBox.prototype.parse = function(stream) { + var ret; + var box; + while (stream.getPosition() < this.start+this.size) { + ret = BoxParser.parseOneBox(stream, false, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + box = ret.box; + /* store the box in the 'boxes' array to preserve box order (for offset) but also store box in a property for more direct access */ + this.boxes.push(box); + if (this.subBoxNames && this.subBoxNames.indexOf(box.type) != -1) { + this[this.subBoxNames[this.subBoxNames.indexOf(box.type)]+"s"].push(box); + } else { + var box_type = box.type !== "uuid" ? box.type : box.uuid; + if (this[box_type]) { + Log.warn("Box of type "+box_type+" already stored in field of this type"); + } else { + this[box_type] = box; + } + } + } else { + return; + } + } +} + +BoxParser.Box.prototype.parseLanguage = function(stream) { + this.language = stream.readUint16(); + var chars = []; + chars[0] = (this.language>>10)&0x1F; + chars[1] = (this.language>>5)&0x1F; + chars[2] = (this.language)&0x1F; + this.languageString = String.fromCharCode(chars[0]+0x60, chars[1]+0x60, chars[2]+0x60); +} + +// file:src/parsing/sampleentries/sampleentry.js +BoxParser.SAMPLE_ENTRY_TYPE_VISUAL = "Visual"; +BoxParser.SAMPLE_ENTRY_TYPE_AUDIO = "Audio"; +BoxParser.SAMPLE_ENTRY_TYPE_HINT = "Hint"; +BoxParser.SAMPLE_ENTRY_TYPE_METADATA = "Metadata"; +BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE = "Subtitle"; +BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM = "System"; +BoxParser.SAMPLE_ENTRY_TYPE_TEXT = "Text"; + +BoxParser.SampleEntry.prototype.parseHeader = function(stream) { + stream.readUint8Array(6); + this.data_reference_index = stream.readUint16(); + this.hdr_size += 8; +} + +BoxParser.SampleEntry.prototype.parse = function(stream) { + this.parseHeader(stream); + this.data = stream.readUint8Array(this.size - this.hdr_size); +} + +BoxParser.SampleEntry.prototype.parseDataAndRewind = function(stream) { + this.parseHeader(stream); + this.data = stream.readUint8Array(this.size - this.hdr_size); + // restore the header size as if the sample entry header had not been parsed + this.hdr_size -= 8; + // rewinding + stream.position -= this.size-this.hdr_size; +} + +BoxParser.SampleEntry.prototype.parseFooter = function(stream) { + BoxParser.ContainerBox.prototype.parse.call(this, stream); +} + +// Base SampleEntry types with default parsing +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_HINT); +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA); +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE); +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM); +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT); + +//Base SampleEntry types for Audio and Video with specific parsing +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, function(stream) { + var compressorname_length; + this.parseHeader(stream); + stream.readUint16(); + stream.readUint16(); + stream.readUint32Array(3); + this.width = stream.readUint16(); + this.height = stream.readUint16(); + this.horizresolution = stream.readUint32(); + this.vertresolution = stream.readUint32(); + stream.readUint32(); + this.frame_count = stream.readUint16(); + compressorname_length = Math.min(31, stream.readUint8()); + this.compressorname = stream.readString(compressorname_length); + if (compressorname_length < 31) { + stream.readString(31 - compressorname_length); + } + this.depth = stream.readUint16(); + stream.readUint16(); + this.parseFooter(stream); +}); + +BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, function(stream) { + this.parseHeader(stream); + stream.readUint32Array(2); + this.channel_count = stream.readUint16(); + this.samplesize = stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + this.samplerate = (stream.readUint32()/(1<<16)); + this.parseFooter(stream); +}); + +// Sample entries inheriting from Audio and Video +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc2"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc3"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc4"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "av01"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "dav1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hvc1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hev1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hvt1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "lhe1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "dvh1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "dvhe"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vvc1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vvi1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vvs1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vvcN"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vp08"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "vp09"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avs3"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "j2ki"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "mjp2"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "mjpg"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "uncv"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mp4a"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ac-3"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ac-4"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ec-3"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "Opus"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mha1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mha2"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mhm1"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mhm2"); +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "fLaC"); + +// Encrypted sample entries +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "encv"); +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "enca"); +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "encu"); +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SYSTEM, "encs"); +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_TEXT, "enct"); +BoxParser.createEncryptedSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "encm"); +// file:src/parsing/a1lx.js +BoxParser.createBoxCtor("a1lx", function(stream) { + var large_size = stream.readUint8() & 1; + var FieldLength = ((large_size & 1) + 1) * 16; + this.layer_size = []; + for (var i = 0; i < 3; i++) { + if (FieldLength == 16) { + this.layer_size[i] = stream.readUint16(); + } else { + this.layer_size[i] = stream.readUint32(); + } + } +});// file:src/parsing/a1op.js +BoxParser.createBoxCtor("a1op", function(stream) { + this.op_index = stream.readUint8(); +});// file:src/parsing/auxC.js +BoxParser.createFullBoxCtor("auxC", function(stream) { + this.aux_type = stream.readCString(); + var aux_subtype_length = this.size - this.hdr_size - (this.aux_type.length + 1); + this.aux_subtype = stream.readUint8Array(aux_subtype_length); +});// file:src/parsing/av1C.js +BoxParser.createBoxCtor("av1C", function(stream) { + var i; + var toparse; + var tmp = stream.readUint8(); + if ((tmp >> 7) & 0x1 !== 1) { + Log.error("av1C marker problem"); + return; + } + this.version = tmp & 0x7F; + if (this.version !== 1) { + Log.error("av1C version "+this.version+" not supported"); + return; + } + tmp = stream.readUint8(); + this.seq_profile = (tmp >> 5) & 0x7; + this.seq_level_idx_0 = tmp & 0x1F; + tmp = stream.readUint8(); + this.seq_tier_0 = (tmp >> 7) & 0x1; + this.high_bitdepth = (tmp >> 6) & 0x1; + this.twelve_bit = (tmp >> 5) & 0x1; + this.monochrome = (tmp >> 4) & 0x1; + this.chroma_subsampling_x = (tmp >> 3) & 0x1; + this.chroma_subsampling_y = (tmp >> 2) & 0x1; + this.chroma_sample_position = (tmp & 0x3); + tmp = stream.readUint8(); + this.reserved_1 = (tmp >> 5) & 0x7; + if (this.reserved_1 !== 0) { + Log.error("av1C reserved_1 parsing problem"); + return; + } + this.initial_presentation_delay_present = (tmp >> 4) & 0x1; + if (this.initial_presentation_delay_present === 1) { + this.initial_presentation_delay_minus_one = (tmp & 0xF); + } else { + this.reserved_2 = (tmp & 0xF); + if (this.reserved_2 !== 0) { + Log.error("av1C reserved_2 parsing problem"); + return; + } + } + + var configOBUs_length = this.size - this.hdr_size - 4; + this.configOBUs = stream.readUint8Array(configOBUs_length); +}); + +// file:src/parsing/avcC.js +function printPS(ps) { + var str = ""; + str += ""; + str += ""; + + for (var i=0; i < ps.length; i++) { + var nalu = ps[i]; + str += ""; + str += ""; + str += ""; + } + str += "
lengthnalu_data
"+nalu.length+""; + str += nalu.nalu.reduce(function(str, byte) { + return str + byte.toString(16).padStart(2, "0"); + }, "0x"); + str += "
"; + return str; +} + +BoxParser.createBoxCtor("avcC", function(stream) { + var i; + var toparse; + this.configurationVersion = stream.readUint8(); + this.AVCProfileIndication = stream.readUint8(); + this.profile_compatibility = stream.readUint8(); + this.AVCLevelIndication = stream.readUint8(); + this.lengthSizeMinusOne = (stream.readUint8() & 0x3); + this.nb_SPS_nalus = (stream.readUint8() & 0x1F); + toparse = this.size - this.hdr_size - 6; + this.SPS = []; + this.SPS.toString = function () { + return printPS(this); + } + for (i = 0; i < this.nb_SPS_nalus; i++) { + this.SPS[i] = {}; + this.SPS[i].length = stream.readUint16(); + this.SPS[i].nalu = stream.readUint8Array(this.SPS[i].length); + toparse -= 2+this.SPS[i].length; + } + this.nb_PPS_nalus = stream.readUint8(); + toparse--; + this.PPS = []; + this.PPS.toString = function () { + return printPS(this); + } + for (i = 0; i < this.nb_PPS_nalus; i++) { + this.PPS[i] = {}; + this.PPS[i].length = stream.readUint16(); + this.PPS[i].nalu = stream.readUint8Array(this.PPS[i].length); + toparse -= 2+this.PPS[i].length; + } + if (toparse>0) { + this.ext = stream.readUint8Array(toparse); + } +}); + +// file:src/parsing/btrt.js +BoxParser.createBoxCtor("btrt", function(stream) { + this.bufferSizeDB = stream.readUint32(); + this.maxBitrate = stream.readUint32(); + this.avgBitrate = stream.readUint32(); +}); + +// file:src/parsing/ccst.js +BoxParser.createFullBoxCtor("ccst", function(stream) { + var flags = stream.readUint8(); + this.all_ref_pics_intra = ((flags & 0x80) == 0x80); + this.intra_pred_used = ((flags & 0x40) == 0x40); + this.max_ref_per_pic = ((flags & 0x3f) >> 2); + stream.readUint24(); +}); + +// file:src/parsing/cdef.js +BoxParser.createBoxCtor("cdef", function(stream) { + var i; + this.channel_count = stream.readUint16(); + this.channel_indexes = []; + this.channel_types = []; + this.channel_associations = []; + for (i = 0; i < this.channel_count; i++) { + this.channel_indexes.push(stream.readUint16()); + this.channel_types.push(stream.readUint16()); + this.channel_associations.push(stream.readUint16()); + } +}); + +// file:src/parsing/clap.js +BoxParser.createBoxCtor("clap", function(stream) { + this.cleanApertureWidthN = stream.readUint32(); + this.cleanApertureWidthD = stream.readUint32(); + this.cleanApertureHeightN = stream.readUint32(); + this.cleanApertureHeightD = stream.readUint32(); + this.horizOffN = stream.readUint32(); + this.horizOffD = stream.readUint32(); + this.vertOffN = stream.readUint32(); + this.vertOffD = stream.readUint32(); +});// file:src/parsing/clli.js +BoxParser.createBoxCtor("clli", function(stream) { + this.max_content_light_level = stream.readUint16(); + this.max_pic_average_light_level = stream.readUint16(); +}); + +// file:src/parsing/cmex.js +BoxParser.createFullBoxCtor("cmex", function(stream) { + if (this.flags & 0x1) { + this.pos_x = stream.readInt32(); + } + if (this.flags & 0x2) { + this.pos_y = stream.readInt32(); + } + if (this.flags & 0x4) { + this.pos_z = stream.readInt32(); + } + if (this.flags & 0x8) { + if (this.version == 0) { + if (this.flags & 0x10) { + this.quat_x = stream.readInt32(); + this.quat_y = stream.readInt32(); + this.quat_z = stream.readInt32(); + } else { + this.quat_x = stream.readInt16(); + this.quat_y = stream.readInt16(); + this.quat_z = stream.readInt16(); + } + } else if (this.version == 1) { + //ViewpointGlobalCoordinateSysRotationStruct rot; + } + } + if (this.flags & 0x20) { + this.id = stream.readUint32(); + } +}); +// file:src/parsing/cmin.js +BoxParser.createFullBoxCtor("cmin", function(stream) { + this.focal_length_x = stream.readInt32(); + this.principal_point_x = stream.readInt32(); + this.principal_point_y = stream.readInt32(); + if (this.flags & 0x1) { + this.focal_length_y = stream.readInt32(); + this.skew_factor = stream.readInt32(); + } +});// file:src/parsing/cmpd.js +BoxParser.createBoxCtor("cmpd", function(stream) { + this.component_count = stream.readUint32(); + this.component_types = []; + this.component_type_urls = []; + for (i = 0; i < this.component_count; i++) { + var component_type = stream.readUint16(); + this.component_types.push(component_type); + if (component_type >= 0x8000) { + this.component_type_urls.push(stream.readCString()); + } + } +});// file:src/parsing/co64.js +BoxParser.createFullBoxCtor("co64", function(stream) { + var entry_count; + var i; + entry_count = stream.readUint32(); + this.chunk_offsets = []; + if (this.version === 0) { + for(i=0; i> 7; + } else if (this.colour_type === 'rICC') { + this.ICC_profile = stream.readUint8Array(this.size - 4); + } else if (this.colour_type === 'prof') { + this.ICC_profile = stream.readUint8Array(this.size - 4); + } +});// file:src/parsing/cprt.js +BoxParser.createFullBoxCtor("cprt", function (stream) { + this.parseLanguage(stream); + this.notice = stream.readCString(); +}); + +// file:src/parsing/cslg.js +BoxParser.createFullBoxCtor("cslg", function(stream) { + var entry_count; + if (this.version === 0) { + this.compositionToDTSShift = stream.readInt32(); /* signed */ + this.leastDecodeToDisplayDelta = stream.readInt32(); /* signed */ + this.greatestDecodeToDisplayDelta = stream.readInt32(); /* signed */ + this.compositionStartTime = stream.readInt32(); /* signed */ + this.compositionEndTime = stream.readInt32(); /* signed */ + } +}); + +// file:src/parsing/ctts.js +BoxParser.createFullBoxCtor("ctts", function(stream) { + var entry_count; + var i; + entry_count = stream.readUint32(); + this.sample_counts = []; + this.sample_offsets = []; + if (this.version === 0) { + for(i=0; i> 6; + this.bsid = ((tmp_byte1 >> 1) & 0x1F); + this.bsmod = ((tmp_byte1 & 0x1) << 2) | ((tmp_byte2 >> 6) & 0x3); + this.acmod = ((tmp_byte2 >> 3) & 0x7); + this.lfeon = ((tmp_byte2 >> 2) & 0x1); + this.bit_rate_code = (tmp_byte2 & 0x3) | ((tmp_byte3 >> 5) & 0x7); +}); + +// file:src/parsing/dec3.js +BoxParser.createBoxCtor("dec3", function(stream) { + var tmp_16 = stream.readUint16(); + this.data_rate = tmp_16 >> 3; + this.num_ind_sub = tmp_16 & 0x7; + this.ind_subs = []; + for (var i = 0; i < this.num_ind_sub+1; i++) { + var ind_sub = {}; + this.ind_subs.push(ind_sub); + var tmp_byte1 = stream.readUint8(); + var tmp_byte2 = stream.readUint8(); + var tmp_byte3 = stream.readUint8(); + ind_sub.fscod = tmp_byte1 >> 6; + ind_sub.bsid = ((tmp_byte1 >> 1) & 0x1F); + ind_sub.bsmod = ((tmp_byte1 & 0x1) << 4) | ((tmp_byte2 >> 4) & 0xF); + ind_sub.acmod = ((tmp_byte2 >> 1) & 0x7); + ind_sub.lfeon = (tmp_byte2 & 0x1); + ind_sub.num_dep_sub = ((tmp_byte3 >> 1) & 0xF); + if (ind_sub.num_dep_sub > 0) { + ind_sub.chan_loc = ((tmp_byte3 & 0x1) << 8) | stream.readUint8(); + } + } +}); + +// file:src/parsing/dfLa.js +BoxParser.createFullBoxCtor("dfLa", function(stream) { + var BLOCKTYPE_MASK = 0x7F; + var LASTMETADATABLOCKFLAG_MASK = 0x80; + + var boxesFound = []; + var knownBlockTypes = [ + "STREAMINFO", + "PADDING", + "APPLICATION", + "SEEKTABLE", + "VORBIS_COMMENT", + "CUESHEET", + "PICTURE", + "RESERVED" + ]; + + // for (i=0; ; i++) { // to end of box + do { + var flagAndType = stream.readUint8(); + + var type = Math.min( + (flagAndType & BLOCKTYPE_MASK), + (knownBlockTypes.length - 1) + ); + + // if this is a STREAMINFO block, read the true samplerate since this + // can be different to the AudioSampleEntry samplerate. + if (!(type)) { + // read past all the other stuff + stream.readUint8Array(13); + + // extract samplerate + this.samplerate = (stream.readUint32() >> 12); + + // read to end of STREAMINFO + stream.readUint8Array(20); + } else { + // not interested in other block types so just discard length bytes + stream.readUint8Array(stream.readUint24()); + } + + boxesFound.push(knownBlockTypes[type]); + + if (!!(flagAndType & LASTMETADATABLOCKFLAG_MASK)) { + break; + } + } while (true); + + this.numMetadataBlocks = + boxesFound.length + " (" + boxesFound.join(", ") + ")"; +}); +// file:src/parsing/dimm.js +BoxParser.createBoxCtor("dimm", function(stream) { + this.bytessent = stream.readUint64(); +}); + +// file:src/parsing/dmax.js +BoxParser.createBoxCtor("dmax", function(stream) { + this.time = stream.readUint32(); +}); + +// file:src/parsing/dmed.js +BoxParser.createBoxCtor("dmed", function(stream) { + this.bytessent = stream.readUint64(); +}); + +// file:src/parsing/dOps.js +BoxParser.createBoxCtor("dOps", function(stream) { + this.Version = stream.readUint8(); + this.OutputChannelCount = stream.readUint8(); + this.PreSkip = stream.readUint16(); + this.InputSampleRate = stream.readUint32(); + this.OutputGain = stream.readInt16(); + this.ChannelMappingFamily = stream.readUint8(); + if (this.ChannelMappingFamily !== 0) { + this.StreamCount = stream.readUint8(); + this.CoupledCount = stream.readUint8(); + this.ChannelMapping = []; + for (var i = 0; i < this.OutputChannelCount; i++) { + this.ChannelMapping[i] = stream.readUint8(); + } + } +}); + +// file:src/parsing/dref.js +BoxParser.createFullBoxCtor("dref", function(stream) { + var ret; + var box; + this.entries = []; + var entry_count = stream.readUint32(); + for (var i = 0; i < entry_count; i++) { + ret = BoxParser.parseOneBox(stream, false, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + box = ret.box; + this.entries.push(box); + } else { + return; + } + } +}); + +// file:src/parsing/drep.js +BoxParser.createBoxCtor("drep", function(stream) { + this.bytessent = stream.readUint64(); +}); + +// file:src/parsing/elng.js +BoxParser.createFullBoxCtor("elng", function(stream) { + this.extended_language = stream.readString(this.size-this.hdr_size); +}); + +// file:src/parsing/elst.js +BoxParser.createFullBoxCtor("elst", function(stream) { + this.entries = []; + var entry_count = stream.readUint32(); + for (var i = 0; i < entry_count; i++) { + var entry = {}; + this.entries.push(entry); + if (this.version === 1) { + entry.segment_duration = stream.readUint64(); + entry.media_time = stream.readInt64(); + } else { + entry.segment_duration = stream.readUint32(); + entry.media_time = stream.readInt32(); + } + entry.media_rate_integer = stream.readInt16(); + entry.media_rate_fraction = stream.readInt16(); + } +}); + +// file:src/parsing/emsg.js +BoxParser.createFullBoxCtor("emsg", function(stream) { + if (this.version == 1) { + this.timescale = stream.readUint32(); + this.presentation_time = stream.readUint64(); + this.event_duration = stream.readUint32(); + this.id = stream.readUint32(); + this.scheme_id_uri = stream.readCString(); + this.value = stream.readCString(); + } else { + this.scheme_id_uri = stream.readCString(); + this.value = stream.readCString(); + this.timescale = stream.readUint32(); + this.presentation_time_delta = stream.readUint32(); + this.event_duration = stream.readUint32(); + this.id = stream.readUint32(); + } + var message_size = this.size - this.hdr_size - (4*4 + (this.scheme_id_uri.length+1) + (this.value.length+1)); + if (this.version == 1) { + message_size -= 4; + } + this.message_data = stream.readUint8Array(message_size); +}); + +// file:src/parsing/EntityToGroup.js +// ISO/IEC 14496-12:2022 Section 8.18.3 Entity to group box +BoxParser.createEntityToGroupCtor = function(type, parseMethod) { + BoxParser[type+"Box"] = function(size) { + BoxParser.FullBox.call(this, type, size); + } + BoxParser[type+"Box"].prototype = new BoxParser.FullBox(); + BoxParser[type+"Box"].prototype.parse = function(stream) { + this.parseFullHeader(stream); + if (parseMethod) { + parseMethod.call(this, stream); + } else { + this.group_id = stream.readUint32(); + this.num_entities_in_group = stream.readUint32(); + this.entity_ids = []; + for (i = 0; i < this.num_entities_in_group; i++) { + var entity_id = stream.readUint32(); + this.entity_ids.push(entity_id); + } + } + }; +}; + +// Auto exposure bracketing (ISO/IEC 23008-12:2022 Section 6.8.6.2.1) +BoxParser.createEntityToGroupCtor("aebr"); + +// Flash exposure bracketing (ISO/IEC 23008-12:2022 Section 6.8.6.5.1) +BoxParser.createEntityToGroupCtor("afbr"); + +// Album collection (ISO/IEC 23008-12:2022 Section 6.8.7.1) +BoxParser.createEntityToGroupCtor("albc"); + +// Alternative entity (ISO/IEC 14496-12:2022 Section 8.18.3.1) +BoxParser.createEntityToGroupCtor("altr"); + +// Burst image entity group (ISO/IEC 23008-12:2022 Section 6.8.2.2) +BoxParser.createEntityToGroupCtor("brst"); + +// Depth of field bracketing (ISO/IEC 23008-12:2022 Section 6.8.6.6.1) +BoxParser.createEntityToGroupCtor("dobr"); + +// Equivalent entity (ISO/IEC 23008-12:2022 Section 6.8.1.1) +BoxParser.createEntityToGroupCtor("eqiv"); + +// Favourites collection (ISO/IEC 23008-12:2022 Section 6.8.7.2) +BoxParser.createEntityToGroupCtor("favc"); + +// Focus bracketing (ISO/IEC 23008-12:2022 Section 6.8.6.4.1) +BoxParser.createEntityToGroupCtor("fobr"); + +// Audio to image entity group (ISO/IEC 23008-12:2022 Section 6.8.4) +BoxParser.createEntityToGroupCtor("iaug"); + +// Panorama (ISO/IEC 23008-12:2022 Section 6.8.8.1) +BoxParser.createEntityToGroupCtor("pano"); + +// Slideshow (ISO/IEC 23008-12:2022 Section 6.8.9.1) +BoxParser.createEntityToGroupCtor("slid"); + +// Stereo pair (ISO/IEC 23008-12:2022 Section 6.8.5) +BoxParser.createEntityToGroupCtor("ster"); + +// Time-synchronised capture entity group (ISO/IEC 23008-12:2022 Section 6.8.3) +BoxParser.createEntityToGroupCtor("tsyn"); + +// White balance bracketing (ISO/IEC 23008-12:2022 Section 6.8.6.3.1) +BoxParser.createEntityToGroupCtor("wbbr"); + +// Alternative entity (ISO/IEC 23008-12:2022 AMD1 Section 6.8.10) +BoxParser.createEntityToGroupCtor("prgr"); + +// Image Pyramid entity group (ISO/IEC 23008-12:20xx Section 6.8.11) +BoxParser.createEntityToGroupCtor("pymd", function(stream) { + this.group_id = stream.readUint32(); + this.num_entities_in_group = stream.readUint32(); + this.entity_ids = []; + for (var i = 0; i < this.num_entities_in_group; i++) { + var entity_id = stream.readUint32(); + this.entity_ids.push(entity_id); + } + + this.tile_size_x = stream.readUint16(); + this.tile_size_y = stream.readUint16(); + this.layer_binning = []; + this.tiles_in_layer_column_minus1 = []; + this.tiles_in_layer_row_minus1 = []; + for (i = 0; i < this.num_entities_in_group; i++) { + this.layer_binning[i] = stream.readUint16(); + this.tiles_in_layer_row_minus1[i] = stream.readUint16(); + this.tiles_in_layer_column_minus1[i] = stream.readUint16(); + } +}); + +// file:src/parsing/esds.js +BoxParser.createFullBoxCtor("esds", function(stream) { + var esd_data = stream.readUint8Array(this.size-this.hdr_size); + if (typeof MPEG4DescriptorParser !== "undefined") { + var esd_parser = new MPEG4DescriptorParser(); + this.esd = esd_parser.parseOneDescriptor(new DataStream(esd_data.buffer, 0, DataStream.BIG_ENDIAN)); + } +}); + +// file:src/parsing/fiel.js +BoxParser.createBoxCtor("fiel", function(stream) { + this.fieldCount = stream.readUint8(); + this.fieldOrdering = stream.readUint8(); +}); + +// file:src/parsing/frma.js +BoxParser.createBoxCtor("frma", function(stream) { + this.data_format = stream.readString(4); +}); + +// file:src/parsing/ftyp.js +BoxParser.createBoxCtor("ftyp", function(stream) { + var toparse = this.size - this.hdr_size; + this.major_brand = stream.readString(4); + this.minor_version = stream.readUint32(); + toparse -= 8; + this.compatible_brands = []; + var i = 0; + while (toparse>=4) { + this.compatible_brands[i] = stream.readString(4); + toparse -= 4; + i++; + } +}); + +// file:src/parsing/hdlr.js +BoxParser.createFullBoxCtor("hdlr", function(stream) { + if (this.version === 0) { + stream.readUint32(); + this.handler = stream.readString(4); + stream.readUint32Array(3); + this.name = stream.readString(this.size-this.hdr_size-20); + if (this.name[this.name.length-1]==='\0') { + this.name = this.name.slice(0,-1); + } + } +}); + +// file:src/parsing/hvcC.js +BoxParser.createBoxCtor("hvcC", function(stream) { + var i, j; + var nb_nalus; + var length; + var tmp_byte; + this.configurationVersion = stream.readUint8(); + tmp_byte = stream.readUint8(); + this.general_profile_space = tmp_byte >> 6; + this.general_tier_flag = (tmp_byte & 0x20) >> 5; + this.general_profile_idc = (tmp_byte & 0x1F); + this.general_profile_compatibility = stream.readUint32(); + this.general_constraint_indicator = stream.readUint8Array(6); + this.general_level_idc = stream.readUint8(); + this.min_spatial_segmentation_idc = stream.readUint16() & 0xFFF; + this.parallelismType = (stream.readUint8() & 0x3); + this.chroma_format_idc = (stream.readUint8() & 0x3); + this.bit_depth_luma_minus8 = (stream.readUint8() & 0x7); + this.bit_depth_chroma_minus8 = (stream.readUint8() & 0x7); + this.avgFrameRate = stream.readUint16(); + tmp_byte = stream.readUint8(); + this.constantFrameRate = (tmp_byte >> 6); + this.numTemporalLayers = (tmp_byte & 0XD) >> 3; + this.temporalIdNested = (tmp_byte & 0X4) >> 2; + this.lengthSizeMinusOne = (tmp_byte & 0X3); + + this.nalu_arrays = []; + this.nalu_arrays.toString = function () { + var str = ""; + str += ""; + str += ""; + + for (var i=0; i"+nalu_array.completeness+""; + str += ""; + for (var j=0; j> 7; + nalu_array.nalu_type = tmp_byte & 0x3F; + var numNalus = stream.readUint16(); + for (j = 0; j < numNalus; j++) { + var nalu = {} + nalu_array.push(nalu); + length = stream.readUint16(); + nalu.data = stream.readUint8Array(length); + } + } +}); + +// file:src/parsing/iinf.js +BoxParser.createFullBoxCtor("iinf", function(stream) { + var ret; + if (this.version === 0) { + this.entry_count = stream.readUint16(); + } else { + this.entry_count = stream.readUint32(); + } + this.item_infos = []; + for (var i = 0; i < this.entry_count; i++) { + ret = BoxParser.parseOneBox(stream, false, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + if (ret.box.type !== "infe") { + Log.error("BoxParser", "Expected 'infe' box, got "+ret.box.type); + } + this.item_infos[i] = ret.box; + } else { + return; + } + } +}); + +// file:src/parsing/iloc.js +BoxParser.createFullBoxCtor("iloc", function(stream) { + var byte; + byte = stream.readUint8(); + this.offset_size = (byte >> 4) & 0xF; + this.length_size = byte & 0xF; + byte = stream.readUint8(); + this.base_offset_size = (byte >> 4) & 0xF; + if (this.version === 1 || this.version === 2) { + this.index_size = byte & 0xF; + } else { + this.index_size = 0; + // reserved = byte & 0xF; + } + this.items = []; + var item_count = 0; + if (this.version < 2) { + item_count = stream.readUint16(); + } else if (this.version === 2) { + item_count = stream.readUint32(); + } else { + throw "version of iloc box not supported"; + } + for (var i = 0; i < item_count; i++) { + var item = {}; + this.items.push(item); + if (this.version < 2) { + item.item_ID = stream.readUint16(); + } else if (this.version === 2) { + item.item_ID = stream.readUint32(); + } else { + throw "version of iloc box not supported"; + } + if (this.version === 1 || this.version === 2) { + item.construction_method = (stream.readUint16() & 0xF); + } else { + item.construction_method = 0; + } + item.data_reference_index = stream.readUint16(); + switch(this.base_offset_size) { + case 0: + item.base_offset = 0; + break; + case 4: + item.base_offset = stream.readUint32(); + break; + case 8: + item.base_offset = stream.readUint64(); + break; + default: + throw "Error reading base offset size"; + } + var extent_count = stream.readUint16(); + item.extents = []; + for (var j=0; j < extent_count; j++) { + var extent = {}; + item.extents.push(extent); + if (this.version === 1 || this.version === 2) { + switch(this.index_size) { + case 0: + extent.extent_index = 0; + break; + case 4: + extent.extent_index = stream.readUint32(); + break; + case 8: + extent.extent_index = stream.readUint64(); + break; + default: + throw "Error reading extent index"; + } + } + switch(this.offset_size) { + case 0: + extent.extent_offset = 0; + break; + case 4: + extent.extent_offset = stream.readUint32(); + break; + case 8: + extent.extent_offset = stream.readUint64(); + break; + default: + throw "Error reading extent index"; + } + switch(this.length_size) { + case 0: + extent.extent_length = 0; + break; + case 4: + extent.extent_length = stream.readUint32(); + break; + case 8: + extent.extent_length = stream.readUint64(); + break; + default: + throw "Error reading extent index"; + } + } + } +}); + +// file:src/parsing/imir.js +BoxParser.createBoxCtor("imir", function(stream) { + var tmp = stream.readUint8(); + this.reserved = tmp >> 7; + this.axis = tmp & 1; +});// file:src/parsing/infe.js +BoxParser.createFullBoxCtor("infe", function(stream) { + if (this.version === 0 || this.version === 1) { + this.item_ID = stream.readUint16(); + this.item_protection_index = stream.readUint16(); + this.item_name = stream.readCString(); + this.content_type = stream.readCString(); + this.content_encoding = stream.readCString(); + } + if (this.version === 1) { + this.extension_type = stream.readString(4); + Log.warn("BoxParser", "Cannot parse extension type"); + stream.seek(this.start+this.size); + return; + } + if (this.version >= 2) { + if (this.version === 2) { + this.item_ID = stream.readUint16(); + } else if (this.version === 3) { + this.item_ID = stream.readUint32(); + } + this.item_protection_index = stream.readUint16(); + this.item_type = stream.readString(4); + this.item_name = stream.readCString(); + if (this.item_type === "mime") { + this.content_type = stream.readCString(); + this.content_encoding = stream.readCString(); + } else if (this.item_type === "uri ") { + this.item_uri_type = stream.readCString(); + } + } +}); +// file:src/parsing/ipma.js +BoxParser.createFullBoxCtor("ipma", function(stream) { + var i, j; + entry_count = stream.readUint32(); + this.associations = []; + for(i=0; i> 7) === 1; + if (this.flags & 0x1) { + p.property_index = (tmp & 0x7F) << 8 | stream.readUint8(); + } else { + p.property_index = (tmp & 0x7F); + } + } + } +}); + +// file:src/parsing/iref.js +BoxParser.createFullBoxCtor("iref", function(stream) { + var ret; + var entryCount; + var box; + this.references = []; + + while (stream.getPosition() < this.start+this.size) { + ret = BoxParser.parseOneBox(stream, true, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + if (this.version === 0) { + box = new BoxParser.SingleItemTypeReferenceBox(ret.type, ret.size, ret.hdr_size, ret.start); + } else { + box = new BoxParser.SingleItemTypeReferenceBoxLarge(ret.type, ret.size, ret.hdr_size, ret.start); + } + if (box.write === BoxParser.Box.prototype.write && box.type !== "mdat") { + Log.warn("BoxParser", box.type+" box writing not yet implemented, keeping unparsed data in memory for later write"); + box.parseDataAndRewind(stream); + } + box.parse(stream); + this.references.push(box); + } else { + return; + } + } +}); +// file:src/parsing/irot.js +BoxParser.createBoxCtor("irot", function(stream) { + this.angle = stream.readUint8() & 0x3; +}); + +// file:src/parsing/ispe.js +BoxParser.createFullBoxCtor("ispe", function(stream) { + this.image_width = stream.readUint32(); + this.image_height = stream.readUint32(); +});// file:src/parsing/kind.js +BoxParser.createFullBoxCtor("kind", function(stream) { + this.schemeURI = stream.readCString(); + this.value = stream.readCString(); +}); +// file:src/parsing/leva.js +BoxParser.createFullBoxCtor("leva", function(stream) { + var count = stream.readUint8(); + this.levels = []; + for (var i = 0; i < count; i++) { + var level = {}; + this.levels[i] = level; + level.track_ID = stream.readUint32(); + var tmp_byte = stream.readUint8(); + level.padding_flag = tmp_byte >> 7; + level.assignment_type = tmp_byte & 0x7F; + switch (level.assignment_type) { + case 0: + level.grouping_type = stream.readString(4); + break; + case 1: + level.grouping_type = stream.readString(4); + level.grouping_type_parameter = stream.readUint32(); + break; + case 2: + break; + case 3: + break; + case 4: + level.sub_track_id = stream.readUint32(); + break; + default: + Log.warn("BoxParser", "Unknown leva assignement type"); + } + } +}); + +// file:src/parsing/lhvC.js +BoxParser.createBoxCtor("lhvC", function(stream) { + var i, j; + var tmp_byte; + this.configurationVersion = stream.readUint8(); + this.min_spatial_segmentation_idc = stream.readUint16() & 0xFFF; + this.parallelismType = (stream.readUint8() & 0x3); + tmp_byte = stream.readUint8(); + this.numTemporalLayers = (tmp_byte & 0XD) >> 3; + this.temporalIdNested = (tmp_byte & 0X4) >> 2; + this.lengthSizeMinusOne = (tmp_byte & 0X3); + + this.nalu_arrays = []; + this.nalu_arrays.toString = function () { + var str = "
completenessnalu_typenalu_data
"+nalu_array.nalu_type+"
"; + str += ""; + str += ""; + + for (var i=0; i"+nalu_array.completeness+""; + str += ""; + for (var j=0; j> 7; + nalu_array.nalu_type = tmp_byte & 0x3F; + var numNalus = stream.readUint16(); + for (j = 0; j < numNalus; j++) { + var nalu = {} + nalu_array.push(nalu); + var length = stream.readUint16(); + nalu.data = stream.readUint8Array(length); + } + } +}); + +// file:src/parsing/lsel.js +BoxParser.createBoxCtor("lsel", function(stream) { + this.layer_id = stream.readUint16(); +});// file:src/parsing/maxr.js +BoxParser.createBoxCtor("maxr", function(stream) { + this.period = stream.readUint32(); + this.bytes = stream.readUint32(); +}); + +// file:src/parsing/mdcv.js +function ColorPoint(x, y) { + this.x = x; + this.y = y; +} + +ColorPoint.prototype.toString = function() { + return "("+this.x+","+this.y+")"; +} + +BoxParser.createBoxCtor("mdcv", function(stream) { + this.display_primaries = []; + this.display_primaries[0] = new ColorPoint(stream.readUint16(),stream.readUint16()); + this.display_primaries[1] = new ColorPoint(stream.readUint16(),stream.readUint16()); + this.display_primaries[2] = new ColorPoint(stream.readUint16(),stream.readUint16()); + this.white_point = new ColorPoint(stream.readUint16(),stream.readUint16()); + this.max_display_mastering_luminance = stream.readUint32(); + this.min_display_mastering_luminance = stream.readUint32(); +}); + +// file:src/parsing/mdhd.js +BoxParser.createFullBoxCtor("mdhd", function(stream) { + if (this.version == 1) { + this.creation_time = stream.readUint64(); + this.modification_time = stream.readUint64(); + this.timescale = stream.readUint32(); + this.duration = stream.readUint64(); + } else { + this.creation_time = stream.readUint32(); + this.modification_time = stream.readUint32(); + this.timescale = stream.readUint32(); + this.duration = stream.readUint32(); + } + this.parseLanguage(stream); + stream.readUint16(); +}); + +// file:src/parsing/mehd.js +BoxParser.createFullBoxCtor("mehd", function(stream) { + if (this.flags & 0x1) { + Log.warn("BoxParser", "mehd box incorrectly uses flags set to 1, converting version to 1"); + this.version = 1; + } + if (this.version == 1) { + this.fragment_duration = stream.readUint64(); + } else { + this.fragment_duration = stream.readUint32(); + } +}); + +// file:src/parsing/meta.js +BoxParser.createFullBoxCtor("meta", function(stream) { + this.boxes = []; + BoxParser.ContainerBox.prototype.parse.call(this, stream); +}); +// file:src/parsing/mfhd.js +BoxParser.createFullBoxCtor("mfhd", function(stream) { + this.sequence_number = stream.readUint32(); +}); + +// file:src/parsing/mfro.js +BoxParser.createFullBoxCtor("mfro", function(stream) { + this._size = stream.readUint32(); +}); + +// file:src/parsing/mskC.js +BoxParser.createFullBoxCtor("mskC", function(stream) { + this.bits_per_pixel = stream.readUint8(); +}); + +// file:src/parsing/mvhd.js +BoxParser.createFullBoxCtor("mvhd", function(stream) { + if (this.version == 1) { + this.creation_time = stream.readUint64(); + this.modification_time = stream.readUint64(); + this.timescale = stream.readUint32(); + this.duration = stream.readUint64(); + } else { + this.creation_time = stream.readUint32(); + this.modification_time = stream.readUint32(); + this.timescale = stream.readUint32(); + this.duration = stream.readUint32(); + } + this.rate = stream.readUint32(); + this.volume = stream.readUint16()>>8; + stream.readUint16(); + stream.readUint32Array(2); + this.matrix = stream.readUint32Array(9); + stream.readUint32Array(6); + this.next_track_id = stream.readUint32(); +}); +// file:src/parsing/npck.js +BoxParser.createBoxCtor("npck", function(stream) { + this.packetssent = stream.readUint32(); +}); + +// file:src/parsing/nump.js +BoxParser.createBoxCtor("nump", function(stream) { + this.packetssent = stream.readUint64(); +}); + +// file:src/parsing/padb.js +BoxParser.createFullBoxCtor("padb", function(stream) { + var sample_count = stream.readUint32(); + this.padbits = []; + for (var i = 0; i < Math.floor((sample_count+1)/2); i++) { + this.padbits = stream.readUint8(); + } +}); + +// file:src/parsing/pasp.js +BoxParser.createBoxCtor("pasp", function(stream) { + this.hSpacing = stream.readUint32(); + this.vSpacing = stream.readUint32(); +});// file:src/parsing/payl.js +BoxParser.createBoxCtor("payl", function(stream) { + this.text = stream.readString(this.size - this.hdr_size); +}); + +// file:src/parsing/payt.js +BoxParser.createBoxCtor("payt", function(stream) { + this.payloadID = stream.readUint32(); + var count = stream.readUint8(); + this.rtpmap_string = stream.readString(count); +}); + +// file:src/parsing/pdin.js +BoxParser.createFullBoxCtor("pdin", function(stream) { + var count = (this.size - this.hdr_size)/8; + this.rate = []; + this.initial_delay = []; + for (var i = 0; i < count; i++) { + this.rate[i] = stream.readUint32(); + this.initial_delay[i] = stream.readUint32(); + } +}); + +// file:src/parsing/pitm.js +BoxParser.createFullBoxCtor("pitm", function(stream) { + if (this.version === 0) { + this.item_id = stream.readUint16(); + } else { + this.item_id = stream.readUint32(); + } +}); + +// file:src/parsing/pixi.js +BoxParser.createFullBoxCtor("pixi", function(stream) { + var i; + this.num_channels = stream.readUint8(); + this.bits_per_channels = []; + for (i = 0; i < this.num_channels; i++) { + this.bits_per_channels[i] = stream.readUint8(); + } +}); + +// file:src/parsing/pmax.js +BoxParser.createBoxCtor("pmax", function(stream) { + this.bytes = stream.readUint32(); +}); + +// file:src/parsing/prdi.js +BoxParser.createFullBoxCtor("prdi", function(stream) { + this.step_count = stream.readUint16(); + this.item_count = []; + if (this.flags & 0x2) { + for (var i = 0; i < this.step_count; i++) { + this.item_count[i] = stream.readUint16(); + } + } +});// file:src/parsing/prft.js +BoxParser.createFullBoxCtor("prft", function(stream) { + this.ref_track_id = stream.readUint32(); + this.ntp_timestamp = stream.readUint64(); + if (this.version === 0) { + this.media_time = stream.readUint32(); + } else { + this.media_time = stream.readUint64(); + } +}); + +// file:src/parsing/pssh.js +BoxParser.createFullBoxCtor("pssh", function(stream) { + this.system_id = BoxParser.parseHex16(stream); + if (this.version > 0) { + var count = stream.readUint32(); + this.kid = []; + for (var i = 0; i < count; i++) { + this.kid[i] = BoxParser.parseHex16(stream); + } + } + var datasize = stream.readUint32(); + if (datasize > 0) { + this.data = stream.readUint8Array(datasize); + } +}); + +// file:src/parsing/qt/clef.js +BoxParser.createFullBoxCtor("clef", function(stream) { + this.width = stream.readUint32(); + this.height = stream.readUint32(); +});// file:src/parsing/qt/enof.js +BoxParser.createFullBoxCtor("enof", function(stream) { + this.width = stream.readUint32(); + this.height = stream.readUint32(); +});// file:src/parsing/qt/prof.js +BoxParser.createFullBoxCtor("prof", function(stream) { + this.width = stream.readUint32(); + this.height = stream.readUint32(); +});// file:src/parsing/qt/tapt.js +BoxParser.createContainerBoxCtor("tapt", null, [ "clef", "prof", "enof"]);// file:src/parsing/rtp.js +BoxParser.createBoxCtor("rtp ", function(stream) { + this.descriptionformat = stream.readString(4); + this.sdptext = stream.readString(this.size - this.hdr_size - 4); +}); + +// file:src/parsing/saio.js +BoxParser.createFullBoxCtor("saio", function(stream) { + if (this.flags & 0x1) { + this.aux_info_type = stream.readString(4); + this.aux_info_type_parameter = stream.readUint32(); + } + var count = stream.readUint32(); + this.offset = []; + for (var i = 0; i < count; i++) { + if (this.version === 0) { + this.offset[i] = stream.readUint32(); + } else { + this.offset[i] = stream.readUint64(); + } + } +}); +// file:src/parsing/saiz.js +BoxParser.createFullBoxCtor("saiz", function(stream) { + if (this.flags & 0x1) { + this.aux_info_type = stream.readString(4); + this.aux_info_type_parameter = stream.readUint32(); + } + this.default_sample_info_size = stream.readUint8(); + this.sample_count = stream.readUint32(); + this.sample_info_size = []; + if (this.default_sample_info_size === 0) { + for (var i = 0; i < this.sample_count; i++) { + this.sample_info_size[i] = stream.readUint8(); + } + } +}); + +// file:src/parsing/sampleentries/mett.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "mett", function(stream) { + this.parseHeader(stream); + this.content_encoding = stream.readCString(); + this.mime_format = stream.readCString(); + this.parseFooter(stream); +}); + +// file:src/parsing/sampleentries/metx.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "metx", function(stream) { + this.parseHeader(stream); + this.content_encoding = stream.readCString(); + this.namespace = stream.readCString(); + this.schema_location = stream.readCString(); + this.parseFooter(stream); +}); + +// file:src/parsing/sampleentries/sbtt.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "sbtt", function(stream) { + this.parseHeader(stream); + this.content_encoding = stream.readCString(); + this.mime_format = stream.readCString(); + this.parseFooter(stream); +}); + +// file:src/parsing/sampleentries/stpp.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "stpp", function(stream) { + this.parseHeader(stream); + this.namespace = stream.readCString(); + this.schema_location = stream.readCString(); + this.auxiliary_mime_types = stream.readCString(); + this.parseFooter(stream); +}); + +// file:src/parsing/sampleentries/stxt.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "stxt", function(stream) { + this.parseHeader(stream); + this.content_encoding = stream.readCString(); + this.mime_format = stream.readCString(); + this.parseFooter(stream); +}); + +// file:src/parsing/sampleentries/tx3g.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_SUBTITLE, "tx3g", function(stream) { + this.parseHeader(stream); + this.displayFlags = stream.readUint32(); + this.horizontal_justification = stream.readInt8(); + this.vertical_justification = stream.readInt8(); + this.bg_color_rgba = stream.readUint8Array(4); + this.box_record = stream.readInt16Array(4); + this.style_record = stream.readUint8Array(12); + this.parseFooter(stream); +}); +// file:src/parsing/sampleentries/wvtt.js +BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_METADATA, "wvtt", function(stream) { + this.parseHeader(stream); + this.parseFooter(stream); +}); + +// file:src/parsing/samplegroups/alst.js +BoxParser.createSampleGroupCtor("alst", function(stream) { + var i; + var roll_count = stream.readUint16(); + this.first_output_sample = stream.readUint16(); + this.sample_offset = []; + for (i = 0; i < roll_count; i++) { + this.sample_offset[i] = stream.readUint32(); + } + var remaining = this.description_length - 4 - 4*roll_count; + this.num_output_samples = []; + this.num_total_samples = []; + for (i = 0; i < remaining/4; i++) { + this.num_output_samples[i] = stream.readUint16(); + this.num_total_samples[i] = stream.readUint16(); + } +}); + +// file:src/parsing/samplegroups/avll.js +BoxParser.createSampleGroupCtor("avll", function(stream) { + this.layerNumber = stream.readUint8(); + this.accurateStatisticsFlag = stream.readUint8(); + this.avgBitRate = stream.readUint16(); + this.avgFrameRate = stream.readUint16(); +}); + +// file:src/parsing/samplegroups/avss.js +BoxParser.createSampleGroupCtor("avss", function(stream) { + this.subSequenceIdentifier = stream.readUint16(); + this.layerNumber = stream.readUint8(); + var tmp_byte = stream.readUint8(); + this.durationFlag = tmp_byte >> 7; + this.avgRateFlag = (tmp_byte >> 6) & 0x1; + if (this.durationFlag) { + this.duration = stream.readUint32(); + } + if (this.avgRateFlag) { + this.accurateStatisticsFlag = stream.readUint8(); + this.avgBitRate = stream.readUint16(); + this.avgFrameRate = stream.readUint16(); + } + this.dependency = []; + var numReferences = stream.readUint8(); + for (var i = 0; i < numReferences; i++) { + var dependencyInfo = {}; + this.dependency.push(dependencyInfo); + dependencyInfo.subSeqDirectionFlag = stream.readUint8(); + dependencyInfo.layerNumber = stream.readUint8(); + dependencyInfo.subSequenceIdentifier = stream.readUint16(); + } +}); + +// file:src/parsing/samplegroups/dtrt.js +BoxParser.createSampleGroupCtor("dtrt", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/mvif.js +BoxParser.createSampleGroupCtor("mvif", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/prol.js +BoxParser.createSampleGroupCtor("prol", function(stream) { + this.roll_distance = stream.readInt16(); +}); + +// file:src/parsing/samplegroups/rap.js +BoxParser.createSampleGroupCtor("rap ", function(stream) { + var tmp_byte = stream.readUint8(); + this.num_leading_samples_known = tmp_byte >> 7; + this.num_leading_samples = tmp_byte & 0x7F; +}); + +// file:src/parsing/samplegroups/rash.js +BoxParser.createSampleGroupCtor("rash", function(stream) { + this.operation_point_count = stream.readUint16(); + if (this.description_length !== 2+(this.operation_point_count === 1?2:this.operation_point_count*6)+9) { + Log.warn("BoxParser", "Mismatch in "+this.grouping_type+" sample group length"); + this.data = stream.readUint8Array(this.description_length-2); + } else { + if (this.operation_point_count === 1) { + this.target_rate_share = stream.readUint16(); + } else { + this.target_rate_share = []; + this.available_bitrate = []; + for (var i = 0; i < this.operation_point_count; i++) { + this.available_bitrate[i] = stream.readUint32(); + this.target_rate_share[i] = stream.readUint16(); + } + } + this.maximum_bitrate = stream.readUint32(); + this.minimum_bitrate = stream.readUint32(); + this.discard_priority = stream.readUint8(); + } +}); + +// file:src/parsing/samplegroups/roll.js +BoxParser.createSampleGroupCtor("roll", function(stream) { + this.roll_distance = stream.readInt16(); +}); + +// file:src/parsing/samplegroups/samplegroup.js +BoxParser.SampleGroupEntry.prototype.parse = function(stream) { + Log.warn("BoxParser", "Unknown Sample Group type: "+this.grouping_type); + this.data = stream.readUint8Array(this.description_length); +} + +// file:src/parsing/samplegroups/scif.js +BoxParser.createSampleGroupCtor("scif", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/scnm.js +BoxParser.createSampleGroupCtor("scnm", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/seig.js +BoxParser.createSampleGroupCtor("seig", function(stream) { + this.reserved = stream.readUint8(); + var tmp = stream.readUint8(); + this.crypt_byte_block = tmp >> 4; + this.skip_byte_block = tmp & 0xF; + this.isProtected = stream.readUint8(); + this.Per_Sample_IV_Size = stream.readUint8(); + this.KID = BoxParser.parseHex16(stream); + this.constant_IV_size = 0; + this.constant_IV = 0; + if (this.isProtected === 1 && this.Per_Sample_IV_Size === 0) { + this.constant_IV_size = stream.readUint8(); + this.constant_IV = stream.readUint8Array(this.constant_IV_size); + } +}); + +// file:src/parsing/samplegroups/stsa.js +BoxParser.createSampleGroupCtor("stsa", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/sync.js +BoxParser.createSampleGroupCtor("sync", function(stream) { + var tmp_byte = stream.readUint8(); + this.NAL_unit_type = tmp_byte & 0x3F; +}); + +// file:src/parsing/samplegroups/tele.js +BoxParser.createSampleGroupCtor("tele", function(stream) { + var tmp_byte = stream.readUint8(); + this.level_independently_decodable = tmp_byte >> 7; +}); + +// file:src/parsing/samplegroups/tsas.js +BoxParser.createSampleGroupCtor("tsas", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/tscl.js +BoxParser.createSampleGroupCtor("tscl", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/samplegroups/vipr.js +BoxParser.createSampleGroupCtor("vipr", function(stream) { + Log.warn("BoxParser", "Sample Group type: "+this.grouping_type+" not fully parsed"); +}); + +// file:src/parsing/sbgp.js +BoxParser.createFullBoxCtor("sbgp", function(stream) { + this.grouping_type = stream.readString(4); + if (this.version === 1) { + this.grouping_type_parameter = stream.readUint32(); + } else { + this.grouping_type_parameter = 0; + } + this.entries = []; + var entry_count = stream.readUint32(); + for (var i = 0; i < entry_count; i++) { + var entry = {}; + this.entries.push(entry); + entry.sample_count = stream.readInt32(); + entry.group_description_index = stream.readInt32(); + } +}); + +// file:src/parsing/sbpm.js +function Pixel(row, col) { + this.bad_pixel_row = row; + this.bad_pixel_column = col; +} + +Pixel.prototype.toString = function pixelToString() { + return "[row: " + this.bad_pixel_row + ", column: " + this.bad_pixel_column + "]"; +} + +BoxParser.createFullBoxCtor("sbpm", function(stream) { + var i; + this.component_count = stream.readUint16(); + this.component_index = []; + for (i = 0; i < this.component_count; i++) { + this.component_index.push(stream.readUint16()); + } + var flags = stream.readUint8(); + this.correction_applied = (0x80 == (flags & 0x80)); + this.num_bad_rows = stream.readUint32(); + this.num_bad_cols = stream.readUint32(); + this.num_bad_pixels = stream.readUint32(); + this.bad_rows = []; + this.bad_columns = []; + this.bad_pixels = []; + for (i = 0; i < this.num_bad_rows; i++) { + this.bad_rows.push(stream.readUint32()); + } + for (i = 0; i < this.num_bad_cols; i++) { + this.bad_columns.push(stream.readUint32()); + } + for (i = 0; i < this.num_bad_pixels; i++) { + var row = stream.readUint32(); + var col = stream.readUint32(); + this.bad_pixels.push(new Pixel(row, col)); + } +}); + +// file:src/parsing/schm.js +BoxParser.createFullBoxCtor("schm", function(stream) { + this.scheme_type = stream.readString(4); + this.scheme_version = stream.readUint32(); + if (this.flags & 0x000001) { + this.scheme_uri = stream.readString(this.size - this.hdr_size - 8); + } +}); + +// file:src/parsing/sdp.js +BoxParser.createBoxCtor("sdp ", function(stream) { + this.sdptext = stream.readString(this.size - this.hdr_size); +}); + +// file:src/parsing/sdtp.js +BoxParser.createFullBoxCtor("sdtp", function(stream) { + var tmp_byte; + var count = (this.size - this.hdr_size); + this.is_leading = []; + this.sample_depends_on = []; + this.sample_is_depended_on = []; + this.sample_has_redundancy = []; + for (var i = 0; i < count; i++) { + tmp_byte = stream.readUint8(); + this.is_leading[i] = tmp_byte >> 6; + this.sample_depends_on[i] = (tmp_byte >> 4) & 0x3; + this.sample_is_depended_on[i] = (tmp_byte >> 2) & 0x3; + this.sample_has_redundancy[i] = tmp_byte & 0x3; + } +}); + +// file:src/parsing/senc.js +// Cannot be fully parsed because Per_Sample_IV_Size needs to be known +BoxParser.createFullBoxCtor("senc" /*, function(stream) { + this.parseFullHeader(stream); + var sample_count = stream.readUint32(); + this.samples = []; + for (var i = 0; i < sample_count; i++) { + var sample = {}; + // tenc.default_Per_Sample_IV_Size or seig.Per_Sample_IV_Size + sample.InitializationVector = this.readUint8Array(Per_Sample_IV_Size*8); + if (this.flags & 0x2) { + sample.subsamples = []; + subsample_count = stream.readUint16(); + for (var j = 0; j < subsample_count; j++) { + var subsample = {}; + subsample.BytesOfClearData = stream.readUint16(); + subsample.BytesOfProtectedData = stream.readUint32(); + sample.subsamples.push(subsample); + } + } + // TODO + this.samples.push(sample); + } +}*/); +// file:src/parsing/sgpd.js +BoxParser.createFullBoxCtor("sgpd", function(stream) { + this.grouping_type = stream.readString(4); + Log.debug("BoxParser", "Found Sample Groups of type "+this.grouping_type); + if (this.version === 1) { + this.default_length = stream.readUint32(); + } else { + this.default_length = 0; + } + if (this.version >= 2) { + this.default_group_description_index = stream.readUint32(); + } + this.entries = []; + var entry_count = stream.readUint32(); + for (var i = 0; i < entry_count; i++) { + var entry; + if (BoxParser[this.grouping_type+"SampleGroupEntry"]) { + entry = new BoxParser[this.grouping_type+"SampleGroupEntry"](this.grouping_type); + } else { + entry = new BoxParser.SampleGroupEntry(this.grouping_type); + } + this.entries.push(entry); + if (this.version === 1) { + if (this.default_length === 0) { + entry.description_length = stream.readUint32(); + } else { + entry.description_length = this.default_length; + } + } else { + entry.description_length = this.default_length; + } + if (entry.write === BoxParser.SampleGroupEntry.prototype.write) { + Log.info("BoxParser", "SampleGroup for type "+this.grouping_type+" writing not yet implemented, keeping unparsed data in memory for later write"); + // storing data + entry.data = stream.readUint8Array(entry.description_length); + // rewinding + stream.position -= entry.description_length; + } + entry.parse(stream); + } +}); + +// file:src/parsing/sidx.js +BoxParser.createFullBoxCtor("sidx", function(stream) { + this.reference_ID = stream.readUint32(); + this.timescale = stream.readUint32(); + if (this.version === 0) { + this.earliest_presentation_time = stream.readUint32(); + this.first_offset = stream.readUint32(); + } else { + this.earliest_presentation_time = stream.readUint64(); + this.first_offset = stream.readUint64(); + } + stream.readUint16(); + this.references = []; + var count = stream.readUint16(); + for (var i = 0; i < count; i++) { + var ref = {}; + this.references.push(ref); + var tmp_32 = stream.readUint32(); + ref.reference_type = (tmp_32 >> 31) & 0x1; + ref.referenced_size = tmp_32 & 0x7FFFFFFF; + ref.subsegment_duration = stream.readUint32(); + tmp_32 = stream.readUint32(); + ref.starts_with_SAP = (tmp_32 >> 31) & 0x1; + ref.SAP_type = (tmp_32 >> 28) & 0x7; + ref.SAP_delta_time = tmp_32 & 0xFFFFFFF; + } +}); + +// file:src/parsing/singleitemtypereference.js +BoxParser.SingleItemTypeReferenceBox = function(type, size, hdr_size, start) { + BoxParser.Box.call(this, type, size); + this.hdr_size = hdr_size; + this.start = start; +} +BoxParser.SingleItemTypeReferenceBox.prototype = new BoxParser.Box(); +BoxParser.SingleItemTypeReferenceBox.prototype.parse = function(stream) { + this.from_item_ID = stream.readUint16(); + var count = stream.readUint16(); + this.references = []; + for(var i = 0; i < count; i++) { + this.references[i] = {}; + this.references[i].to_item_ID = stream.readUint16(); + } +} + +// file:src/parsing/singleitemtypereferencelarge.js +BoxParser.SingleItemTypeReferenceBoxLarge = function(type, size, hdr_size, start) { + BoxParser.Box.call(this, type, size); + this.hdr_size = hdr_size; + this.start = start; +} +BoxParser.SingleItemTypeReferenceBoxLarge.prototype = new BoxParser.Box(); +BoxParser.SingleItemTypeReferenceBoxLarge.prototype.parse = function(stream) { + this.from_item_ID = stream.readUint32(); + var count = stream.readUint16(); + this.references = []; + for(var i = 0; i < count; i++) { + this.references[i] = {}; + this.references[i].to_item_ID = stream.readUint32(); + } +} + +// file:src/parsing/SmDm.js +BoxParser.createFullBoxCtor("SmDm", function(stream) { + this.primaryRChromaticity_x = stream.readUint16(); + this.primaryRChromaticity_y = stream.readUint16(); + this.primaryGChromaticity_x = stream.readUint16(); + this.primaryGChromaticity_y = stream.readUint16(); + this.primaryBChromaticity_x = stream.readUint16(); + this.primaryBChromaticity_y = stream.readUint16(); + this.whitePointChromaticity_x = stream.readUint16(); + this.whitePointChromaticity_y = stream.readUint16(); + this.luminanceMax = stream.readUint32(); + this.luminanceMin = stream.readUint32(); +}); + +// file:src/parsing/smhd.js +BoxParser.createFullBoxCtor("smhd", function(stream) { + this.balance = stream.readUint16(); + stream.readUint16(); +}); + +// file:src/parsing/ssix.js +BoxParser.createFullBoxCtor("ssix", function(stream) { + this.subsegments = []; + var subsegment_count = stream.readUint32(); + for (var i = 0; i < subsegment_count; i++) { + var subsegment = {}; + this.subsegments.push(subsegment); + subsegment.ranges = []; + var range_count = stream.readUint32(); + for (var j = 0; j < range_count; j++) { + var range = {}; + subsegment.ranges.push(range); + range.level = stream.readUint8(); + range.range_size = stream.readUint24(); + } + } +}); + +// file:src/parsing/stco.js +BoxParser.createFullBoxCtor("stco", function(stream) { + var entry_count; + entry_count = stream.readUint32(); + this.chunk_offsets = []; + if (this.version === 0) { + for (var i = 0; i < entry_count; i++) { + this.chunk_offsets.push(stream.readUint32()); + } + } +}); + +// file:src/parsing/stdp.js +BoxParser.createFullBoxCtor("stdp", function(stream) { + var count = (this.size - this.hdr_size)/2; + this.priority = []; + for (var i = 0; i < count; i++) { + this.priority[i] = stream.readUint16(); + } +}); + +// file:src/parsing/sthd.js +BoxParser.createFullBoxCtor("sthd"); + +// file:src/parsing/stri.js +BoxParser.createFullBoxCtor("stri", function(stream) { + this.switch_group = stream.readUint16(); + this.alternate_group = stream.readUint16(); + this.sub_track_id = stream.readUint32(); + var count = (this.size - this.hdr_size - 8)/4; + this.attribute_list = []; + for (var i = 0; i < count; i++) { + this.attribute_list[i] = stream.readUint32(); + } +}); + +// file:src/parsing/stsc.js +BoxParser.createFullBoxCtor("stsc", function(stream) { + var entry_count; + var i; + entry_count = stream.readUint32(); + this.first_chunk = []; + this.samples_per_chunk = []; + this.sample_description_index = []; + if (this.version === 0) { + for(i=0; i> 4) & 0xF; + this.sample_sizes[i+1] = tmp & 0xF; + } + } else if (this.field_size === 8) { + for (i = 0; i < sample_count; i++) { + this.sample_sizes[i] = stream.readUint8(); + } + } else if (this.field_size === 16) { + for (i = 0; i < sample_count; i++) { + this.sample_sizes[i] = stream.readUint16(); + } + } else { + Log.error("BoxParser", "Error in length field in stz2 box"); + } + } +}); + +// file:src/parsing/subs.js +BoxParser.createFullBoxCtor("subs", function(stream) { + var i,j; + var entry_count; + var subsample_count; + entry_count = stream.readUint32(); + this.entries = []; + for (i = 0; i < entry_count; i++) { + var sampleInfo = {}; + this.entries[i] = sampleInfo; + sampleInfo.sample_delta = stream.readUint32(); + sampleInfo.subsamples = []; + subsample_count = stream.readUint16(); + if (subsample_count>0) { + for (j = 0; j < subsample_count; j++) { + var subsample = {}; + sampleInfo.subsamples.push(subsample); + if (this.version == 1) { + subsample.size = stream.readUint32(); + } else { + subsample.size = stream.readUint16(); + } + subsample.priority = stream.readUint8(); + subsample.discardable = stream.readUint8(); + subsample.codec_specific_parameters = stream.readUint32(); + } + } + } +}); + +// file:src/parsing/tenc.js +BoxParser.createFullBoxCtor("tenc", function(stream) { + stream.readUint8(); // reserved + if (this.version === 0) { + stream.readUint8(); + } else { + var tmp = stream.readUint8(); + this.default_crypt_byte_block = (tmp >> 4) & 0xF; + this.default_skip_byte_block = tmp & 0xF; + } + this.default_isProtected = stream.readUint8(); + this.default_Per_Sample_IV_Size = stream.readUint8(); + this.default_KID = BoxParser.parseHex16(stream); + if (this.default_isProtected === 1 && this.default_Per_Sample_IV_Size === 0) { + this.default_constant_IV_size = stream.readUint8(); + this.default_constant_IV = stream.readUint8Array(this.default_constant_IV_size); + } +});// file:src/parsing/tfdt.js +BoxParser.createFullBoxCtor("tfdt", function(stream) { + if (this.version == 1) { + this.baseMediaDecodeTime = stream.readUint64(); + } else { + this.baseMediaDecodeTime = stream.readUint32(); + } +}); + +// file:src/parsing/tfhd.js +BoxParser.createFullBoxCtor("tfhd", function(stream) { + var readBytes = 0; + this.track_id = stream.readUint32(); + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET)) { + this.base_data_offset = stream.readUint64(); + readBytes += 8; + } else { + this.base_data_offset = 0; + } + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC)) { + this.default_sample_description_index = stream.readUint32(); + readBytes += 4; + } else { + this.default_sample_description_index = 0; + } + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR)) { + this.default_sample_duration = stream.readUint32(); + readBytes += 4; + } else { + this.default_sample_duration = 0; + } + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE)) { + this.default_sample_size = stream.readUint32(); + readBytes += 4; + } else { + this.default_sample_size = 0; + } + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS)) { + this.default_sample_flags = stream.readUint32(); + readBytes += 4; + } else { + this.default_sample_flags = 0; + } +}); + +// file:src/parsing/tfra.js +BoxParser.createFullBoxCtor("tfra", function(stream) { + this.track_ID = stream.readUint32(); + stream.readUint24(); + var tmp_byte = stream.readUint8(); + this.length_size_of_traf_num = (tmp_byte >> 4) & 0x3; + this.length_size_of_trun_num = (tmp_byte >> 2) & 0x3; + this.length_size_of_sample_num = (tmp_byte) & 0x3; + this.entries = []; + var number_of_entries = stream.readUint32(); + for (var i = 0; i < number_of_entries; i++) { + if (this.version === 1) { + this.time = stream.readUint64(); + this.moof_offset = stream.readUint64(); + } else { + this.time = stream.readUint32(); + this.moof_offset = stream.readUint32(); + } + this.traf_number = stream["readUint"+(8*(this.length_size_of_traf_num+1))](); + this.trun_number = stream["readUint"+(8*(this.length_size_of_trun_num+1))](); + this.sample_number = stream["readUint"+(8*(this.length_size_of_sample_num+1))](); + } +}); + +// file:src/parsing/tkhd.js +BoxParser.createFullBoxCtor("tkhd", function(stream) { + if (this.version == 1) { + this.creation_time = stream.readUint64(); + this.modification_time = stream.readUint64(); + this.track_id = stream.readUint32(); + stream.readUint32(); + this.duration = stream.readUint64(); + } else { + this.creation_time = stream.readUint32(); + this.modification_time = stream.readUint32(); + this.track_id = stream.readUint32(); + stream.readUint32(); + this.duration = stream.readUint32(); + } + stream.readUint32Array(2); + this.layer = stream.readInt16(); + this.alternate_group = stream.readInt16(); + this.volume = stream.readInt16()>>8; + stream.readUint16(); + this.matrix = stream.readInt32Array(9); + this.width = stream.readUint32(); + this.height = stream.readUint32(); +}); + +// file:src/parsing/tmax.js +BoxParser.createBoxCtor("tmax", function(stream) { + this.time = stream.readUint32(); +}); + +// file:src/parsing/tmin.js +BoxParser.createBoxCtor("tmin", function(stream) { + this.time = stream.readUint32(); +}); + +// file:src/parsing/totl.js +BoxParser.createBoxCtor("totl",function(stream) { + this.bytessent = stream.readUint32(); +}); + +// file:src/parsing/tpay.js +BoxParser.createBoxCtor("tpay", function(stream) { + this.bytessent = stream.readUint32(); +}); + +// file:src/parsing/tpyl.js +BoxParser.createBoxCtor("tpyl", function(stream) { + this.bytessent = stream.readUint64(); +}); + +// file:src/parsing/TrackGroup.js +BoxParser.TrackGroupTypeBox.prototype.parse = function(stream) { + this.parseFullHeader(stream); + this.track_group_id = stream.readUint32(); +} + +// file:src/parsing/trackgroups/msrc.js +BoxParser.createTrackGroupCtor("msrc");// file:src/parsing/TrakReference.js +BoxParser.TrackReferenceTypeBox = function(type, size, hdr_size, start) { + BoxParser.Box.call(this, type, size); + this.hdr_size = hdr_size; + this.start = start; +} +BoxParser.TrackReferenceTypeBox.prototype = new BoxParser.Box(); +BoxParser.TrackReferenceTypeBox.prototype.parse = function(stream) { + this.track_ids = stream.readUint32Array((this.size-this.hdr_size)/4); +} + +// file:src/parsing/tref.js +BoxParser.trefBox.prototype.parse = function(stream) { + var ret; + var box; + while (stream.getPosition() < this.start+this.size) { + ret = BoxParser.parseOneBox(stream, true, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + box = new BoxParser.TrackReferenceTypeBox(ret.type, ret.size, ret.hdr_size, ret.start); + if (box.write === BoxParser.Box.prototype.write && box.type !== "mdat") { + Log.info("BoxParser", "TrackReference "+box.type+" box writing not yet implemented, keeping unparsed data in memory for later write"); + box.parseDataAndRewind(stream); + } + box.parse(stream); + this.boxes.push(box); + } else { + return; + } + } +} + +// file:src/parsing/trep.js +BoxParser.createFullBoxCtor("trep", function(stream) { + this.track_ID = stream.readUint32(); + this.boxes = []; + while (stream.getPosition() < this.start+this.size) { + ret = BoxParser.parseOneBox(stream, false, this.size - (stream.getPosition() - this.start)); + if (ret.code === BoxParser.OK) { + box = ret.box; + this.boxes.push(box); + } else { + return; + } + } +}); + +// file:src/parsing/trex.js +BoxParser.createFullBoxCtor("trex", function(stream) { + this.track_id = stream.readUint32(); + this.default_sample_description_index = stream.readUint32(); + this.default_sample_duration = stream.readUint32(); + this.default_sample_size = stream.readUint32(); + this.default_sample_flags = stream.readUint32(); +}); + +// file:src/parsing/trpy.js +BoxParser.createBoxCtor("trpy", function(stream) { + this.bytessent = stream.readUint64(); +}); + +// file:src/parsing/trun.js +BoxParser.createFullBoxCtor("trun", function(stream) { + var readBytes = 0; + this.sample_count = stream.readUint32(); + readBytes+= 4; + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET) ) { + this.data_offset = stream.readInt32(); //signed + readBytes += 4; + } else { + this.data_offset = 0; + } + if (this.size - this.hdr_size > readBytes && (this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG) ) { + this.first_sample_flags = stream.readUint32(); + readBytes += 4; + } else { + this.first_sample_flags = 0; + } + this.sample_duration = []; + this.sample_size = []; + this.sample_flags = []; + this.sample_composition_time_offset = []; + if (this.size - this.hdr_size > readBytes) { + for (var i = 0; i < this.sample_count; i++) { + if (this.flags & BoxParser.TRUN_FLAGS_DURATION) { + this.sample_duration[i] = stream.readUint32(); + } + if (this.flags & BoxParser.TRUN_FLAGS_SIZE) { + this.sample_size[i] = stream.readUint32(); + } + if (this.flags & BoxParser.TRUN_FLAGS_FLAGS) { + this.sample_flags[i] = stream.readUint32(); + } + if (this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET) { + if (this.version === 0) { + this.sample_composition_time_offset[i] = stream.readUint32(); + } else { + this.sample_composition_time_offset[i] = stream.readInt32(); //signed + } + } + } + } +}); + +// file:src/parsing/tsel.js +BoxParser.createFullBoxCtor("tsel", function(stream) { + this.switch_group = stream.readUint32(); + var count = (this.size - this.hdr_size - 4)/4; + this.attribute_list = []; + for (var i = 0; i < count; i++) { + this.attribute_list[i] = stream.readUint32(); + } +}); + +// file:src/parsing/txtC.js +BoxParser.createFullBoxCtor("txtC", function(stream) { + this.config = stream.readCString(); +}); + +// file:src/parsing/tyco.js +BoxParser.createBoxCtor("tyco", function(stream) { + var count = (this.size - this.hdr_size) / 4; + this.compatible_brands = []; + for (var i = 0; i < count; i++) { + this.compatible_brands[i] = stream.readString(4); + } +}); + +// file:src/parsing/udes.js +BoxParser.createFullBoxCtor("udes", function(stream) { + this.lang = stream.readCString(); + this.name = stream.readCString(); + this.description = stream.readCString(); + this.tags = stream.readCString(); +}); + +// file:src/parsing/uncC.js +BoxParser.createFullBoxCtor("uncC", function(stream) { + var i; + this.profile = stream.readString(4); + if (this.version == 1) { + // Nothing - just the profile + } else if (this.version == 0) { + this.component_count = stream.readUint32(); + this.component_index = []; + this.component_bit_depth_minus_one = []; + this.component_format = []; + this.component_align_size = []; + for (i = 0; i < this.component_count; i++) { + this.component_index.push(stream.readUint16()); + this.component_bit_depth_minus_one.push(stream.readUint8()); + this.component_format.push(stream.readUint8()); + this.component_align_size.push(stream.readUint8()); + } + this.sampling_type = stream.readUint8(); + this.interleave_type = stream.readUint8(); + this.block_size = stream.readUint8(); + var flags = stream.readUint8(); + this.component_little_endian = (flags >> 7) & 0x1; + this.block_pad_lsb = (flags >> 6) & 0x1; + this.block_little_endian = (flags >> 5) & 0x1; + this.block_reversed = (flags >> 4) & 0x1; + this.pad_unknown = (flags >> 3) & 0x1; + this.pixel_size = stream.readUint32(); + this.row_align_size = stream.readUint32(); + this.tile_align_size = stream.readUint32(); + this.num_tile_cols_minus_one = stream.readUint32(); + this.num_tile_rows_minus_one = stream.readUint32(); + } +}); + +// file:src/parsing/url.js +BoxParser.createFullBoxCtor("url ", function(stream) { + if (this.flags !== 0x000001) { + this.location = stream.readCString(); + } +}); + +// file:src/parsing/urn.js +BoxParser.createFullBoxCtor("urn ", function(stream) { + this.name = stream.readCString(); + if (this.size - this.hdr_size - this.name.length - 1 > 0) { + this.location = stream.readCString(); + } +}); + +// file:src/parsing/uuid/piff/piffLsm.js +BoxParser.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66", true, false, function(stream) { + this.LiveServerManifest = stream.readString(this.size - this.hdr_size) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +});// file:src/parsing/uuid/piff/piffPssh.js +BoxParser.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3", true, false, function(stream) { + this.system_id = BoxParser.parseHex16(stream); + var datasize = stream.readUint32(); + if (datasize > 0) { + this.data = stream.readUint8Array(datasize); + } +}); + +// file:src/parsing/uuid/piff/piffSenc.js +BoxParser.createUUIDBox("a2394f525a9b4f14a2446c427c648df4", true, false /*, function(stream) { + if (this.flags & 0x1) { + this.AlgorithmID = stream.readUint24(); + this.IV_size = stream.readUint8(); + this.KID = BoxParser.parseHex16(stream); + } + var sample_count = stream.readUint32(); + this.samples = []; + for (var i = 0; i < sample_count; i++) { + var sample = {}; + sample.InitializationVector = this.readUint8Array(this.IV_size*8); + if (this.flags & 0x2) { + sample.subsamples = []; + sample.NumberOfEntries = stream.readUint16(); + for (var j = 0; j < sample.NumberOfEntries; j++) { + var subsample = {}; + subsample.BytesOfClearData = stream.readUint16(); + subsample.BytesOfProtectedData = stream.readUint32(); + sample.subsamples.push(subsample); + } + } + this.samples.push(sample); + } +}*/); +// file:src/parsing/uuid/piff/piffTenc.js +BoxParser.createUUIDBox("8974dbce7be74c5184f97148f9882554", true, false, function(stream) { + this.default_AlgorithmID = stream.readUint24(); + this.default_IV_size = stream.readUint8(); + this.default_KID = BoxParser.parseHex16(stream); +});// file:src/parsing/uuid/piff/piffTfrf.js +BoxParser.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f", true, false, function(stream) { + this.fragment_count = stream.readUint8(); + this.entries = []; + + for (var i = 0; i < this.fragment_count; i++) { + var entry = {}; + var absolute_time = 0; + var absolute_duration = 0; + + if (this.version === 1) { + absolute_time = stream.readUint64(); + absolute_duration = stream.readUint64(); + } else { + absolute_time = stream.readUint32(); + absolute_duration = stream.readUint32(); + } + + entry.absolute_time = absolute_time; + entry.absolute_duration = absolute_duration; + + this.entries.push(entry); + } +});// file:src/parsing/uuid/piff/piffTfxd.js +BoxParser.createUUIDBox("6d1d9b0542d544e680e2141daff757b2", true, false, function(stream) { + if (this.version === 1) { + this.absolute_time = stream.readUint64(); + this.duration = stream.readUint64(); + } else { + this.absolute_time = stream.readUint32(); + this.duration = stream.readUint32(); + } +});// file:src/parsing/vmhd.js +BoxParser.createFullBoxCtor("vmhd", function(stream) { + this.graphicsmode = stream.readUint16(); + this.opcolor = stream.readUint16Array(3); +}); + +// file:src/parsing/vpcC.js +BoxParser.createFullBoxCtor("vpcC", function (stream) { + var tmp; + if (this.version === 1) { + this.profile = stream.readUint8(); + this.level = stream.readUint8(); + tmp = stream.readUint8(); + this.bitDepth = tmp >> 4; + this.chromaSubsampling = (tmp >> 1) & 0x7; + this.videoFullRangeFlag = tmp & 0x1; + this.colourPrimaries = stream.readUint8(); + this.transferCharacteristics = stream.readUint8(); + this.matrixCoefficients = stream.readUint8(); + this.codecIntializationDataSize = stream.readUint16(); + this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize); + } else { + this.profile = stream.readUint8(); + this.level = stream.readUint8(); + tmp = stream.readUint8(); + this.bitDepth = (tmp >> 4) & 0xF; + this.colorSpace = tmp & 0xF; + tmp = stream.readUint8(); + this.chromaSubsampling = (tmp >> 4) & 0xF; + this.transferFunction = (tmp >> 1) & 0x7; + this.videoFullRangeFlag = tmp & 0x1; + this.codecIntializationDataSize = stream.readUint16(); + this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize); + } +});// file:src/parsing/vttC.js +BoxParser.createBoxCtor("vttC", function(stream) { + this.text = stream.readString(this.size - this.hdr_size); +}); + +// file:src/parsing/vvcC.js +BoxParser.createFullBoxCtor("vvcC", function (stream) { + var i, j; + + // helper object to simplify extracting individual bits + var bitReader = { + held_bits: undefined, + num_held_bits: 0, + + stream_read_1_bytes: function (strm) { + this.held_bits = strm.readUint8(); + this.num_held_bits = 1 * 8; + }, + stream_read_2_bytes: function (strm) { + this.held_bits = strm.readUint16(); + this.num_held_bits = 2 * 8; + }, + + extract_bits: function (num_bits) { + var ret = (this.held_bits >> (this.num_held_bits - num_bits)) & ((1 << num_bits) - 1); + this.num_held_bits -= num_bits; + return ret; + } + }; + + // VvcDecoderConfigurationRecord + bitReader.stream_read_1_bytes(stream); + bitReader.extract_bits(5); // reserved + this.lengthSizeMinusOne = bitReader.extract_bits(2); + this.ptl_present_flag = bitReader.extract_bits(1); + + if (this.ptl_present_flag) { + bitReader.stream_read_2_bytes(stream); + this.ols_idx = bitReader.extract_bits(9); + this.num_sublayers = bitReader.extract_bits(3); + this.constant_frame_rate = bitReader.extract_bits(2); + this.chroma_format_idc = bitReader.extract_bits(2); + + bitReader.stream_read_1_bytes(stream); + this.bit_depth_minus8 = bitReader.extract_bits(3); + bitReader.extract_bits(5); // reserved + + // VvcPTLRecord + { + bitReader.stream_read_2_bytes(stream); + bitReader.extract_bits(2); // reserved + this.num_bytes_constraint_info = bitReader.extract_bits(6); + this.general_profile_idc = bitReader.extract_bits(7); + this.general_tier_flag = bitReader.extract_bits(1); + + this.general_level_idc = stream.readUint8(); + + bitReader.stream_read_1_bytes(stream); + this.ptl_frame_only_constraint_flag = bitReader.extract_bits(1); + this.ptl_multilayer_enabled_flag = bitReader.extract_bits(1); + + this.general_constraint_info = new Uint8Array(this.num_bytes_constraint_info); + if (this.num_bytes_constraint_info) { + for (i = 0; i < this.num_bytes_constraint_info - 1; i++) { + var cnstr1 = bitReader.extract_bits(6); + bitReader.stream_read_1_bytes(stream); + var cnstr2 = bitReader.extract_bits(2); + + this.general_constraint_info[i] = ((cnstr1 << 2) | cnstr2); + } + this.general_constraint_info[this.num_bytes_constraint_info - 1] = bitReader.extract_bits(6); + } else { + //forbidden in spec! + bitReader.extract_bits(6); + } + + if (this.num_sublayers > 1) { + bitReader.stream_read_1_bytes(stream); + this.ptl_sublayer_present_mask = 0; + for (j = this.num_sublayers - 2; j >= 0; --j) { + var val = bitReader.extract_bits(1); + this.ptl_sublayer_present_mask |= val << j; + } + for (j = this.num_sublayers; j <= 8 && this.num_sublayers > 1; ++j) { + bitReader.extract_bits(1); // ptl_reserved_zero_bit + } + + this.sublayer_level_idc = []; + for (j = this.num_sublayers - 2; j >= 0; --j) { + if (this.ptl_sublayer_present_mask & (1 << j)) { + this.sublayer_level_idc[j] = stream.readUint8(); + } + } + } + + this.ptl_num_sub_profiles = stream.readUint8(); + this.general_sub_profile_idc = []; + if (this.ptl_num_sub_profiles) { + for (i = 0; i < this.ptl_num_sub_profiles; i++) { + this.general_sub_profile_idc.push(stream.readUint32()); + } + } + } // end VvcPTLRecord + + this.max_picture_width = stream.readUint16(); + this.max_picture_height = stream.readUint16(); + this.avg_frame_rate = stream.readUint16(); + } + + var VVC_NALU_OPI = 12; + var VVC_NALU_DEC_PARAM = 13; + + this.nalu_arrays = []; + var num_of_arrays = stream.readUint8(); + for (i = 0; i < num_of_arrays; i++) { + var nalu_array = []; + this.nalu_arrays.push(nalu_array); + + bitReader.stream_read_1_bytes(stream); + nalu_array.completeness = bitReader.extract_bits(1); + bitReader.extract_bits(2); // reserved + nalu_array.nalu_type = bitReader.extract_bits(5); + + var numNalus = 1; + if (nalu_array.nalu_type != VVC_NALU_DEC_PARAM && nalu_array.nalu_type != VVC_NALU_OPI) { + numNalus = stream.readUint16(); + } + + for (j = 0; j < numNalus; j++) { + var len = stream.readUint16(); + nalu_array.push({ + data: stream.readUint8Array(len), + length: len + }); + } + } +}); +// file:src/parsing/vvnC.js +BoxParser.createFullBoxCtor("vvnC", function (stream) { + // VvcNALUConfigBox + var tmp = strm.readUint8(); + this.lengthSizeMinusOne = (tmp & 0x3); +}); +// file:src/box-codecs.js +BoxParser.SampleEntry.prototype.isVideo = function() { + return false; +} + +BoxParser.SampleEntry.prototype.isAudio = function() { + return false; +} + +BoxParser.SampleEntry.prototype.isSubtitle = function() { + return false; +} + +BoxParser.SampleEntry.prototype.isMetadata = function() { + return false; +} + +BoxParser.SampleEntry.prototype.isHint = function() { + return false; +} + +BoxParser.SampleEntry.prototype.getCodec = function() { + return this.type.replace('.',''); +} + +BoxParser.SampleEntry.prototype.getWidth = function() { + return ""; +} + +BoxParser.SampleEntry.prototype.getHeight = function() { + return ""; +} + +BoxParser.SampleEntry.prototype.getChannelCount = function() { + return ""; +} + +BoxParser.SampleEntry.prototype.getSampleRate = function() { + return ""; +} + +BoxParser.SampleEntry.prototype.getSampleSize = function() { + return ""; +} + +BoxParser.VisualSampleEntry.prototype.isVideo = function() { + return true; +} + +BoxParser.VisualSampleEntry.prototype.getWidth = function() { + return this.width; +} + +BoxParser.VisualSampleEntry.prototype.getHeight = function() { + return this.height; +} + +BoxParser.AudioSampleEntry.prototype.isAudio = function() { + return true; +} + +BoxParser.AudioSampleEntry.prototype.getChannelCount = function() { + return this.channel_count; +} + +BoxParser.AudioSampleEntry.prototype.getSampleRate = function() { + return this.samplerate; +} + +BoxParser.AudioSampleEntry.prototype.getSampleSize = function() { + return this.samplesize; +} + +BoxParser.SubtitleSampleEntry.prototype.isSubtitle = function() { + return true; +} + +BoxParser.MetadataSampleEntry.prototype.isMetadata = function() { + return true; +} + + +BoxParser.decimalToHex = function(d, padding) { + var hex = Number(d).toString(16); + padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding; + while (hex.length < padding) { + hex = "0" + hex; + } + return hex; +} + +BoxParser.avc1SampleEntry.prototype.getCodec = +BoxParser.avc2SampleEntry.prototype.getCodec = +BoxParser.avc3SampleEntry.prototype.getCodec = +BoxParser.avc4SampleEntry.prototype.getCodec = function() { + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + if (this.avcC) { + return baseCodec+"."+BoxParser.decimalToHex(this.avcC.AVCProfileIndication)+ + ""+BoxParser.decimalToHex(this.avcC.profile_compatibility)+ + ""+BoxParser.decimalToHex(this.avcC.AVCLevelIndication); + } else { + return baseCodec; + } +} + +BoxParser.hev1SampleEntry.prototype.getCodec = +BoxParser.hvc1SampleEntry.prototype.getCodec = function() { + var i; + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + if (this.hvcC) { + baseCodec += '.'; + switch (this.hvcC.general_profile_space) { + case 0: + baseCodec += ''; + break; + case 1: + baseCodec += 'A'; + break; + case 2: + baseCodec += 'B'; + break; + case 3: + baseCodec += 'C'; + break; + } + baseCodec += this.hvcC.general_profile_idc; + baseCodec += '.'; + var val = this.hvcC.general_profile_compatibility; + var reversed = 0; + for (i=0; i<32; i++) { + reversed |= val & 1; + if (i==31) break; + reversed <<= 1; + val >>=1; + } + baseCodec += BoxParser.decimalToHex(reversed, 0); + baseCodec += '.'; + if (this.hvcC.general_tier_flag === 0) { + baseCodec += 'L'; + } else { + baseCodec += 'H'; + } + baseCodec += this.hvcC.general_level_idc; + var hasByte = false; + var constraint_string = ""; + for (i = 5; i >= 0; i--) { + if (this.hvcC.general_constraint_indicator[i] || hasByte) { + constraint_string = "."+BoxParser.decimalToHex(this.hvcC.general_constraint_indicator[i], 0)+constraint_string; + hasByte = true; + } + } + baseCodec += constraint_string; + } + return baseCodec; +} + +BoxParser.vvc1SampleEntry.prototype.getCodec = +BoxParser.vvi1SampleEntry.prototype.getCodec = function () { + var i; + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + if (this.vvcC) { + baseCodec += '.' + this.vvcC.general_profile_idc; + if (this.vvcC.general_tier_flag) { + baseCodec += '.H'; + } else { + baseCodec += '.L'; + } + baseCodec += this.vvcC.general_level_idc; + + var constraint_string = ""; + if (this.vvcC.general_constraint_info) { + var bytes = []; + var byte = 0; + byte |= this.vvcC.ptl_frame_only_constraint << 7; + byte |= this.vvcC.ptl_multilayer_enabled << 6; + var last_nonzero; + for (i = 0; i < this.vvcC.general_constraint_info.length; ++i) { + byte |= (this.vvcC.general_constraint_info[i] >> 2) & 0x3f; + bytes.push(byte); + if (byte) { + last_nonzero = i; + } + + byte = (this.vvcC.general_constraint_info[i] >> 2) & 0x03; + } + + if (last_nonzero === undefined) { + constraint_string = ".CA"; + } + else { + constraint_string = ".C" + var base32_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; + var held_bits = 0; + var num_held_bits = 0; + for (i = 0; i <= last_nonzero; ++i) { + held_bits = (held_bits << 8) | bytes[i]; + num_held_bits += 8; + + while (num_held_bits >= 5) { + var val = (held_bits >> (num_held_bits - 5)) & 0x1f; + constraint_string += base32_chars[val]; + + num_held_bits -= 5; + held_bits &= (1 << num_held_bits) - 1; + } + } + if (num_held_bits) { + held_bits <<= (5 - num_held_bits); // right-pad with zeros to 5 bits (is this correct?) + constraint_string += base32_chars[held_bits & 0x1f]; + } + } + } + baseCodec += constraint_string; + } + return baseCodec; +} + +BoxParser.mp4aSampleEntry.prototype.getCodec = function() { + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + if (this.esds && this.esds.esd) { + var oti = this.esds.esd.getOTI(); + var dsi = this.esds.esd.getAudioConfig(); + return baseCodec+"."+BoxParser.decimalToHex(oti)+(dsi ? "."+dsi: ""); + } else { + return baseCodec; + } +} + +BoxParser.stxtSampleEntry.prototype.getCodec = function() { + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + if(this.mime_format) { + return baseCodec + "." + this.mime_format; + } else { + return baseCodec + } +} + +BoxParser.vp08SampleEntry.prototype.getCodec = +BoxParser.vp09SampleEntry.prototype.getCodec = function() { + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + var level = this.vpcC.level; + if (level == 0) { + level = "00"; + } + var bitDepth = this.vpcC.bitDepth; + if (bitDepth == 8) { + bitDepth = "08"; + } + return baseCodec + ".0" + this.vpcC.profile + "." + level + "." + bitDepth; +} + +BoxParser.av01SampleEntry.prototype.getCodec = function() { + var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this); + var level = this.av1C.seq_level_idx_0; + if (level < 10) { + level = "0" + level; + } + var bitdepth; + if (this.av1C.seq_profile === 2 && this.av1C.high_bitdepth === 1) { + bitdepth = (this.av1C.twelve_bit === 1) ? "12" : "10"; + } else if ( this.av1C.seq_profile <= 2 ) { + bitdepth = (this.av1C.high_bitdepth === 1) ? "10" : "08"; + } + // TODO need to parse the SH to find color config + return baseCodec+"."+this.av1C.seq_profile+"."+level+(this.av1C.seq_tier_0?"H":"M")+"."+bitdepth;//+"."+this.av1C.monochrome+"."+this.av1C.chroma_subsampling_x+""+this.av1C.chroma_subsampling_y+""+this.av1C.chroma_sample_position; +} +// file:src/box-write.js +/* + * Copyright (c) Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +BoxParser.Box.prototype.writeHeader = function(stream, msg) { + this.size += 8; + if (this.size > MAX_SIZE) { + this.size += 8; + } + if (this.type === "uuid") { + this.size += 16; + } + Log.debug("BoxWriter", "Writing box "+this.type+" of size: "+this.size+" at position "+stream.getPosition()+(msg || "")); + if (this.size > MAX_SIZE) { + stream.writeUint32(1); + } else { + this.sizePosition = stream.getPosition(); + stream.writeUint32(this.size); + } + stream.writeString(this.type, null, 4); + if (this.type === "uuid") { + stream.writeUint8Array(this.uuid); + } + if (this.size > MAX_SIZE) { + stream.writeUint64(this.size); + } +} + +BoxParser.FullBox.prototype.writeHeader = function(stream) { + this.size += 4; + BoxParser.Box.prototype.writeHeader.call(this, stream, " v="+this.version+" f="+this.flags); + stream.writeUint8(this.version); + stream.writeUint24(this.flags); +} + +BoxParser.Box.prototype.write = function(stream) { + if (this.type === "mdat") { + /* TODO: fix this */ + if (this.data) { + this.size = this.data.length; + this.writeHeader(stream); + stream.writeUint8Array(this.data); + } + } else { + this.size = (this.data ? this.data.length : 0); + this.writeHeader(stream); + if (this.data) { + stream.writeUint8Array(this.data); + } + } +} + +BoxParser.ContainerBox.prototype.write = function(stream) { + this.size = 0; + this.writeHeader(stream); + for (var i=0; i= 2) { + stream.writeUint32(this.default_sample_description_index); + } + stream.writeUint32(this.entries.length); + for (i = 0; i < this.entries.length; i++) { + entry = this.entries[i]; + if (this.version === 1) { + if (this.default_length === 0) { + stream.writeUint32(entry.description_length); + } + } + entry.write(stream); + } +} + + +// file:src/writing/sidx.js +BoxParser.sidxBox.prototype.write = function(stream) { + this.version = 0; + this.flags = 0; + this.size = 4*4+2+2+12*this.references.length; + this.writeHeader(stream); + stream.writeUint32(this.reference_ID); + stream.writeUint32(this.timescale); + stream.writeUint32(this.earliest_presentation_time); + stream.writeUint32(this.first_offset); + stream.writeUint16(0); + stream.writeUint16(this.references.length); + for (var i = 0; i < this.references.length; i++) { + var ref = this.references[i]; + stream.writeUint32(ref.reference_type << 31 | ref.referenced_size); + stream.writeUint32(ref.subsegment_duration); + stream.writeUint32(ref.starts_with_SAP << 31 | ref.SAP_type << 28 | ref.SAP_delta_time); + } +} + +// file:src/writing/smhd.js +BoxParser.smhdBox.prototype.write = function(stream) { + var i; + this.version = 0; + this.flags = 1; + this.size = 4; + this.writeHeader(stream); + stream.writeUint16(this.balance); + stream.writeUint16(0); +} +// file:src/writing/stco.js +BoxParser.stcoBox.prototype.write = function(stream) { + this.version = 0; + this.flags = 0; + this.size = 4+4*this.chunk_offsets.length; + this.writeHeader(stream); + stream.writeUint32(this.chunk_offsets.length); + stream.writeUint32Array(this.chunk_offsets); +} + +// file:src/writing/stsc.js +BoxParser.stscBox.prototype.write = function(stream) { + var i; + this.version = 0; + this.flags = 0; + this.size = 4+12*this.first_chunk.length; + this.writeHeader(stream); + stream.writeUint32(this.first_chunk.length); + for(i=0; i 0) { + i = 0; + while (i+1 < this.sample_sizes.length) { + if (this.sample_sizes[i+1] !== this.sample_sizes[0]) { + constant = false; + break; + } else { + i++; + } + } + } else { + constant = false; + } + this.size = 8; + if (!constant) { + this.size += 4*this.sample_sizes.length; + } + this.writeHeader(stream); + if (!constant) { + stream.writeUint32(0); + } else { + stream.writeUint32(this.sample_sizes[0]); + } + stream.writeUint32(this.sample_sizes.length); + if (!constant) { + stream.writeUint32Array(this.sample_sizes); + } +} + +// file:src/writing/stts.js +BoxParser.sttsBox.prototype.write = function(stream) { + var i; + this.version = 0; + this.flags = 0; + this.size = 4+8*this.sample_counts.length; + this.writeHeader(stream); + stream.writeUint32(this.sample_counts.length); + for(i=0; i UINT32_MAX ? 1 : 0; + this.flags = 0; + this.size = 4; + if (this.version === 1) { + this.size += 4; + } + this.writeHeader(stream); + if (this.version === 1) { + stream.writeUint64(this.baseMediaDecodeTime); + } else { + stream.writeUint32(this.baseMediaDecodeTime); + } +} + +// file:src/writing/tfhd.js +BoxParser.tfhdBox.prototype.write = function(stream) { + this.version = 0; + this.size = 4; + if (this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET) { + this.size += 8; + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC) { + this.size += 4; + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR) { + this.size += 4; + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE) { + this.size += 4; + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS) { + this.size += 4; + } + this.writeHeader(stream); + stream.writeUint32(this.track_id); + if (this.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET) { + stream.writeUint64(this.base_data_offset); + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC) { + stream.writeUint32(this.default_sample_description_index); + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR) { + stream.writeUint32(this.default_sample_duration); + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE) { + stream.writeUint32(this.default_sample_size); + } + if (this.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS) { + stream.writeUint32(this.default_sample_flags); + } +} + +// file:src/writing/tkhd.js +BoxParser.tkhdBox.prototype.write = function(stream) { + this.version = 0; + //this.flags = 0; + this.size = 4*18+2*4; + this.writeHeader(stream); + stream.writeUint32(this.creation_time); + stream.writeUint32(this.modification_time); + stream.writeUint32(this.track_id); + stream.writeUint32(0); + stream.writeUint32(this.duration); + stream.writeUint32(0); + stream.writeUint32(0); + stream.writeInt16(this.layer); + stream.writeInt16(this.alternate_group); + stream.writeInt16(this.volume<<8); + stream.writeUint16(0); + stream.writeInt32Array(this.matrix); + stream.writeUint32(this.width); + stream.writeUint32(this.height); +} + +// file:src/writing/trex.js +BoxParser.trexBox.prototype.write = function(stream) { + this.version = 0; + this.flags = 0; + this.size = 4*5; + this.writeHeader(stream); + stream.writeUint32(this.track_id); + stream.writeUint32(this.default_sample_description_index); + stream.writeUint32(this.default_sample_duration); + stream.writeUint32(this.default_sample_size); + stream.writeUint32(this.default_sample_flags); +} + +// file:src/writing/trun.js +BoxParser.trunBox.prototype.write = function(stream) { + this.version = 0; + this.size = 4; + if (this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET) { + this.size += 4; + } + if (this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG) { + this.size += 4; + } + if (this.flags & BoxParser.TRUN_FLAGS_DURATION) { + this.size += 4*this.sample_duration.length; + } + if (this.flags & BoxParser.TRUN_FLAGS_SIZE) { + this.size += 4*this.sample_size.length; + } + if (this.flags & BoxParser.TRUN_FLAGS_FLAGS) { + this.size += 4*this.sample_flags.length; + } + if (this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET) { + this.size += 4*this.sample_composition_time_offset.length; + } + this.writeHeader(stream); + stream.writeUint32(this.sample_count); + if (this.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET) { + this.data_offset_position = stream.getPosition(); + stream.writeInt32(this.data_offset); //signed + } + if (this.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG) { + stream.writeUint32(this.first_sample_flags); + } + for (var i = 0; i < this.sample_count; i++) { + if (this.flags & BoxParser.TRUN_FLAGS_DURATION) { + stream.writeUint32(this.sample_duration[i]); + } + if (this.flags & BoxParser.TRUN_FLAGS_SIZE) { + stream.writeUint32(this.sample_size[i]); + } + if (this.flags & BoxParser.TRUN_FLAGS_FLAGS) { + stream.writeUint32(this.sample_flags[i]); + } + if (this.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET) { + if (this.version === 0) { + stream.writeUint32(this.sample_composition_time_offset[i]); + } else { + stream.writeInt32(this.sample_composition_time_offset[i]); //signed + } + } + } +} + +// file:src/writing/url.js +BoxParser["url Box"].prototype.write = function(stream) { + this.version = 0; + if (this.location) { + this.flags = 0; + this.size = this.location.length+1; + } else { + this.flags = 0x000001; + this.size = 0; + } + this.writeHeader(stream); + if (this.location) { + stream.writeCString(this.location); + } +} + +// file:src/writing/urn.js +BoxParser["urn Box"].prototype.write = function(stream) { + this.version = 0; + this.flags = 0; + this.size = this.name.length+1+(this.location ? this.location.length+1 : 0); + this.writeHeader(stream); + stream.writeCString(this.name); + if (this.location) { + stream.writeCString(this.location); + } +} + +// file:src/writing/vmhd.js +BoxParser.vmhdBox.prototype.write = function(stream) { + var i; + this.version = 0; + this.flags = 1; + this.size = 8; + this.writeHeader(stream); + stream.writeUint16(this.graphicsmode); + stream.writeUint16Array(this.opcolor); +} + +// file:src/box-unpack.js +/* + * Copyright (c) Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +BoxParser.cttsBox.prototype.unpack = function(samples) { + var i, j, k; + k = 0; + for (i = 0; i < this.sample_counts.length; i++) { + for (j = 0; j < this.sample_counts[i]; j++) { + samples[k].pts = samples[k].dts + this.sample_offsets[i]; + k++; + } + } +} + +BoxParser.sttsBox.prototype.unpack = function(samples) { + var i, j, k; + k = 0; + for (i = 0; i < this.sample_counts.length; i++) { + for (j = 0; j < this.sample_counts[i]; j++) { + if (k === 0) { + samples[k].dts = 0; + } else { + samples[k].dts = samples[k-1].dts + this.sample_deltas[i]; + } + k++; + } + } +} + +BoxParser.stcoBox.prototype.unpack = function(samples) { + var i; + for (i = 0; i < this.chunk_offsets.length; i++) { + samples[i].offset = this.chunk_offsets[i]; + } +} + +BoxParser.stscBox.prototype.unpack = function(samples) { + var i, j, k, l, m; + l = 0; + m = 0; + for (i = 0; i < this.first_chunk.length; i++) { + for (j = 0; j < (i+1 < this.first_chunk.length ? this.first_chunk[i+1] : Infinity); j++) { + m++; + for (k = 0; k < this.samples_per_chunk[i]; k++) { + if (samples[l]) { + samples[l].description_index = this.sample_description_index[i]; + samples[l].chunk_index = m; + } else { + return; + } + l++; + } + } + } +} + +BoxParser.stszBox.prototype.unpack = function(samples) { + var i; + for (i = 0; i < this.sample_sizes.length; i++) { + samples[i].size = this.sample_sizes[i]; + } +} +// file:src/box-diff.js + +BoxParser.DIFF_BOXES_PROP_NAMES = [ "boxes", "entries", "references", "subsamples", + "items", "item_infos", "extents", "associations", + "subsegments", "ranges", "seekLists", "seekPoints", + "esd", "levels"]; + +BoxParser.DIFF_PRIMITIVE_ARRAY_PROP_NAMES = [ "compatible_brands", "matrix", "opcolor", "sample_counts", "sample_deltas", +"first_chunk", "samples_per_chunk", "sample_sizes", "chunk_offsets", "sample_offsets", "sample_description_index", "sample_duration" ]; + +BoxParser.boxEqualFields = function(box_a, box_b) { + if (box_a && !box_b) return false; + var prop; + for (prop in box_a) { + if (BoxParser.DIFF_BOXES_PROP_NAMES.indexOf(prop) > -1) { + continue; + // } else if (excluded_fields && excluded_fields.indexOf(prop) > -1) { + // continue; + } else if (box_a[prop] instanceof BoxParser.Box || box_b[prop] instanceof BoxParser.Box) { + continue; + } else if (typeof box_a[prop] === "undefined" || typeof box_b[prop] === "undefined") { + continue; + } else if (typeof box_a[prop] === "function" || typeof box_b[prop] === "function") { + continue; + } else if ( + (box_a.subBoxNames && box_a.subBoxNames.indexOf(prop.slice(0,4)) > -1) || + (box_b.subBoxNames && box_b.subBoxNames.indexOf(prop.slice(0,4)) > -1)) { + continue; + } else { + if (prop === "data" || prop === "start" || prop === "size" || prop === "creation_time" || prop === "modification_time") { + continue; + } else if (BoxParser.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(prop) > -1) { + continue; + } else { + if (box_a[prop] !== box_b[prop]) { + return false; + } + } + } + } + return true; +} + +BoxParser.boxEqual = function(box_a, box_b) { + if (!BoxParser.boxEqualFields(box_a, box_b)) { + return false; + } + for (var j = 0; j < BoxParser.DIFF_BOXES_PROP_NAMES.length; j++) { + var name = BoxParser.DIFF_BOXES_PROP_NAMES[j]; + if (box_a[name] && box_b[name]) { + if (!BoxParser.boxEqual(box_a[name], box_b[name])) { + return false; + } + } + } + return true; +} +// file:src/text-mp4.js +/* + * Copyright (c) 2012-2013. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +var VTTin4Parser = function() { +} + +VTTin4Parser.prototype.parseSample = function(data) { + var cues, cue; + var stream = new MP4BoxStream(data.buffer); + cues = []; + while (!stream.isEos()) { + cue = BoxParser.parseOneBox(stream, false); + if (cue.code === BoxParser.OK && cue.box.type === "vttc") { + cues.push(cue.box); + } + } + return cues; +} + +VTTin4Parser.prototype.getText = function (startTime, endTime, data) { + function pad(n, width, z) { + z = z || '0'; + n = n + ''; + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; + } + function secToTimestamp(insec) { + var h = Math.floor(insec/3600); + var m = Math.floor((insec - h*3600)/60); + var s = Math.floor(insec - h*3600 - m*60); + var ms = Math.floor((insec - h*3600 - m*60 - s)*1000); + return ""+pad(h, 2)+":"+pad(m,2)+":"+pad(s, 2)+"."+pad(ms, 3); + } + var cues = this.parseSample(data); + var string = ""; + for (var i = 0; i < cues.length; i++) { + var cueIn4 = cues[i]; + string += secToTimestamp(startTime)+" --> "+secToTimestamp(endTime)+"\r\n"; + string += cueIn4.payl.text; + } + return string; +} + +var XMLSubtitlein4Parser = function() { +} + +XMLSubtitlein4Parser.prototype.parseSample = function(sample) { + var res = {}; + var i; + res.resources = []; + var stream = new MP4BoxStream(sample.data.buffer); + if (!sample.subsamples || sample.subsamples.length === 0) { + res.documentString = stream.readString(sample.data.length); + } else { + res.documentString = stream.readString(sample.subsamples[0].size); + if (sample.subsamples.length > 1) { + for (i = 1; i < sample.subsamples.length; i++) { + res.resources[i] = stream.readUint8Array(sample.subsamples[i].size); + } + } + } + if (typeof (DOMParser) !== "undefined") { + res.document = (new DOMParser()).parseFromString(res.documentString, "application/xml"); + } + return res; +} + +var Textin4Parser = function() { +} + +Textin4Parser.prototype.parseSample = function(sample) { + var textString; + var stream = new MP4BoxStream(sample.data.buffer); + textString = stream.readString(sample.data.length); + return textString; +} + +Textin4Parser.prototype.parseConfig = function(data) { + var textString; + var stream = new MP4BoxStream(data.buffer); + stream.readUint32(); // version & flags + textString = stream.readCString(); + return textString; +} + +if (typeof exports !== 'undefined') { + exports.VTTin4Parser = VTTin4Parser; + exports.XMLSubtitlein4Parser = XMLSubtitlein4Parser; + exports.Textin4Parser = Textin4Parser; +} +// file:src/isofile.js +/* + * Copyright (c) 2012-2013. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +var ISOFile = function (stream) { + /* MutiBufferStream object used to parse boxes */ + this.stream = stream || new MultiBufferStream(); + /* Array of all boxes (in order) found in the file */ + this.boxes = []; + /* Array of all mdats */ + this.mdats = []; + /* Array of all moofs */ + this.moofs = []; + /* Boolean indicating if the file is compatible with progressive parsing (moov first) */ + this.isProgressive = false; + /* Boolean used to fire moov start event only once */ + this.moovStartFound = false; + /* Callback called when the moov parsing starts */ + this.onMoovStart = null; + /* Boolean keeping track of the call to onMoovStart, to avoid double calls */ + this.moovStartSent = false; + /* Callback called when the moov is entirely parsed */ + this.onReady = null; + /* Boolean keeping track of the call to onReady, to avoid double calls */ + this.readySent = false; + /* Callback to call when segments are ready */ + this.onSegment = null; + /* Callback to call when samples are ready */ + this.onSamples = null; + /* Callback to call when there is an error in the parsing or processing of samples */ + this.onError = null; + /* Boolean indicating if the moov box run-length encoded tables of sample information have been processed */ + this.sampleListBuilt = false; + /* Array of Track objects for which fragmentation of samples is requested */ + this.fragmentedTracks = []; + /* Array of Track objects for which extraction of samples is requested */ + this.extractedTracks = []; + /* Boolean indicating that fragmention is ready */ + this.isFragmentationInitialized = false; + /* Boolean indicating that fragmented has started */ + this.sampleProcessingStarted = false; + /* Number of the next 'moof' to generate when fragmenting */ + this.nextMoofNumber = 0; + /* Boolean indicating if the initial list of items has been produced */ + this.itemListBuilt = false; + /* Array of items */ + this.items = []; + /* Array of entity groups */ + this.entity_groups = []; + /* Callback called when the sidx box is entirely parsed */ + this.onSidx = null; + /* Boolean keeping track of the call to onSidx, to avoid double calls */ + this.sidxSent = false; +} + +ISOFile.prototype.setSegmentOptions = function(id, user, options) { + var trak = this.getTrackById(id); + if (trak) { + var fragTrack = {}; + this.fragmentedTracks.push(fragTrack); + fragTrack.id = id; + fragTrack.user = user; + fragTrack.trak = trak; + trak.nextSample = 0; + fragTrack.segmentStream = null; + fragTrack.nb_samples = 1000; + fragTrack.rapAlignement = true; + if (options) { + if (options.nbSamples) fragTrack.nb_samples = options.nbSamples; + if (options.rapAlignement) fragTrack.rapAlignement = options.rapAlignement; + } + } +} + +ISOFile.prototype.unsetSegmentOptions = function(id) { + var index = -1; + for (var i = 0; i < this.fragmentedTracks.length; i++) { + var fragTrack = this.fragmentedTracks[i]; + if (fragTrack.id == id) { + index = i; + } + } + if (index > -1) { + this.fragmentedTracks.splice(index, 1); + } +} + +ISOFile.prototype.setExtractionOptions = function(id, user, options) { + var trak = this.getTrackById(id); + if (trak) { + var extractTrack = {}; + this.extractedTracks.push(extractTrack); + extractTrack.id = id; + extractTrack.user = user; + extractTrack.trak = trak; + trak.nextSample = 0; + extractTrack.nb_samples = 1000; + extractTrack.samples = []; + if (options) { + if (options.nbSamples) extractTrack.nb_samples = options.nbSamples; + } + } +} + +ISOFile.prototype.unsetExtractionOptions = function(id) { + var index = -1; + for (var i = 0; i < this.extractedTracks.length; i++) { + var extractTrack = this.extractedTracks[i]; + if (extractTrack.id == id) { + index = i; + } + } + if (index > -1) { + this.extractedTracks.splice(index, 1); + } +} + +ISOFile.prototype.parse = function() { + var found; + var ret; + var box; + var parseBoxHeadersOnly = false; + + if (this.restoreParsePosition) { + if (!this.restoreParsePosition()) { + return; + } + } + + while (true) { + + if (this.hasIncompleteMdat && this.hasIncompleteMdat()) { + if (this.processIncompleteMdat()) { + continue; + } else { + return; + } + } else { + if (this.saveParsePosition) { + this.saveParsePosition(); + } + ret = BoxParser.parseOneBox(this.stream, parseBoxHeadersOnly); + if (ret.code === BoxParser.ERR_NOT_ENOUGH_DATA) { + if (this.processIncompleteBox) { + if (this.processIncompleteBox(ret)) { + continue; + } else { + return; + } + } else { + return; + } + } else { + var box_type; + /* the box is entirely parsed */ + box = ret.box; + box_type = (box.type !== "uuid" ? box.type : box.uuid); + /* store the box in the 'boxes' array to preserve box order (for file rewrite if needed) */ + this.boxes.push(box); + /* but also store box in a property for more direct access */ + switch (box_type) { + case "mdat": + this.mdats.push(box); + break; + case "moof": + this.moofs.push(box); + break; + case "moov": + this.moovStartFound = true; + if (this.mdats.length === 0) { + this.isProgressive = true; + } + /* no break */ + /* falls through */ + default: + if (this[box_type] !== undefined) { + Log.warn("ISOFile", "Duplicate Box of type: "+box_type+", overriding previous occurrence"); + } + this[box_type] = box; + break; + } + if (this.updateUsedBytes) { + this.updateUsedBytes(box, ret); + } + } + } + } +} + +ISOFile.prototype.checkBuffer = function (ab) { + if (ab === null || ab === undefined) { + throw("Buffer must be defined and non empty"); + } + if (ab.fileStart === undefined) { + throw("Buffer must have a fileStart property"); + } + if (ab.byteLength === 0) { + Log.warn("ISOFile", "Ignoring empty buffer (fileStart: "+ab.fileStart+")"); + this.stream.logBufferLevel(); + return false; + } + Log.info("ISOFile", "Processing buffer (fileStart: "+ab.fileStart+")"); + + /* mark the bytes in the buffer as not being used yet */ + ab.usedBytes = 0; + this.stream.insertBuffer(ab); + this.stream.logBufferLevel(); + + if (!this.stream.initialized()) { + Log.warn("ISOFile", "Not ready to start parsing"); + return false; + } + return true; +} + +/* Processes a new ArrayBuffer (with a fileStart property) + Returns the next expected file position, or undefined if not ready to parse */ +ISOFile.prototype.appendBuffer = function(ab, last) { + var nextFileStart; + if (!this.checkBuffer(ab)) { + return; + } + + /* Parse whatever is in the existing buffers */ + this.parse(); + + /* Check if the moovStart callback needs to be called */ + if (this.moovStartFound && !this.moovStartSent) { + this.moovStartSent = true; + if (this.onMoovStart) this.onMoovStart(); + } + + if (this.moov) { + /* A moov box has been entirely parsed */ + + /* if this is the first call after the moov is found we initialize the list of samples (may be empty in fragmented files) */ + if (!this.sampleListBuilt) { + this.buildSampleLists(); + this.sampleListBuilt = true; + } + + /* We update the sample information if there are any new moof boxes */ + this.updateSampleLists(); + + /* If the application needs to be informed that the 'moov' has been found, + we create the information object and callback the application */ + if (this.onReady && !this.readySent) { + this.readySent = true; + this.onReady(this.getInfo()); + } + + /* See if any sample extraction or segment creation needs to be done with the available samples */ + this.processSamples(last); + + /* Inform about the best range to fetch next */ + if (this.nextSeekPosition) { + nextFileStart = this.nextSeekPosition; + this.nextSeekPosition = undefined; + } else { + nextFileStart = this.nextParsePosition; + } + if (this.stream.getEndFilePositionAfter) { + nextFileStart = this.stream.getEndFilePositionAfter(nextFileStart); + } + } else { + if (this.nextParsePosition) { + /* moov has not been parsed but the first buffer was received, + the next fetch should probably be the next box start */ + nextFileStart = this.nextParsePosition; + } else { + /* No valid buffer has been parsed yet, we cannot know what to parse next */ + nextFileStart = 0; + } + } + if (this.sidx) { + if (this.onSidx && !this.sidxSent) { + this.onSidx(this.sidx); + this.sidxSent = true; + } + } + if (this.meta) { + if (this.flattenItemInfo && !this.itemListBuilt) { + this.flattenItemInfo(); + this.itemListBuilt = true; + } + if (this.processItems) { + this.processItems(this.onItem); + } + } + + if (this.stream.cleanBuffers) { + Log.info("ISOFile", "Done processing buffer (fileStart: "+ab.fileStart+") - next buffer to fetch should have a fileStart position of "+nextFileStart); + this.stream.logBufferLevel(); + this.stream.cleanBuffers(); + this.stream.logBufferLevel(true); + Log.info("ISOFile", "Sample data size in memory: "+this.getAllocatedSampleDataSize()); + } + return nextFileStart; +} + +ISOFile.prototype.getInfo = function() { + var i, j; + var movie = {}; + var trak; + var track; + var ref; + var sample_desc; + var _1904 = (new Date('1904-01-01T00:00:00Z').getTime()); + + if (this.moov) { + movie.hasMoov = true; + movie.duration = this.moov.mvhd.duration; + movie.timescale = this.moov.mvhd.timescale; + movie.isFragmented = (this.moov.mvex != null); + if (movie.isFragmented && this.moov.mvex.mehd) { + movie.fragment_duration = this.moov.mvex.mehd.fragment_duration; + } + movie.isProgressive = this.isProgressive; + movie.hasIOD = (this.moov.iods != null); + movie.brands = []; + movie.brands.push(this.ftyp.major_brand); + movie.brands = movie.brands.concat(this.ftyp.compatible_brands); + movie.created = new Date(_1904+this.moov.mvhd.creation_time*1000); + movie.modified = new Date(_1904+this.moov.mvhd.modification_time*1000); + movie.tracks = []; + movie.audioTracks = []; + movie.videoTracks = []; + movie.subtitleTracks = []; + movie.metadataTracks = []; + movie.hintTracks = []; + movie.otherTracks = []; + for (i = 0; i < this.moov.traks.length; i++) { + trak = this.moov.traks[i]; + sample_desc = trak.mdia.minf.stbl.stsd.entries[0]; + track = {}; + movie.tracks.push(track); + track.id = trak.tkhd.track_id; + track.name = trak.mdia.hdlr.name; + track.references = []; + if (trak.tref) { + for (j = 0; j < trak.tref.boxes.length; j++) { + ref = {}; + track.references.push(ref); + ref.type = trak.tref.boxes[j].type; + ref.track_ids = trak.tref.boxes[j].track_ids; + } + } + if (trak.edts) { + track.edits = trak.edts.elst.entries; + } + track.created = new Date(_1904+trak.tkhd.creation_time*1000); + track.modified = new Date(_1904+trak.tkhd.modification_time*1000); + track.movie_duration = trak.tkhd.duration; + track.movie_timescale = movie.timescale; + track.layer = trak.tkhd.layer; + track.alternate_group = trak.tkhd.alternate_group; + track.volume = trak.tkhd.volume; + track.matrix = trak.tkhd.matrix; + track.track_width = trak.tkhd.width/(1<<16); + track.track_height = trak.tkhd.height/(1<<16); + track.timescale = trak.mdia.mdhd.timescale; + track.cts_shift = trak.mdia.minf.stbl.cslg; + track.duration = trak.mdia.mdhd.duration; + track.samples_duration = trak.samples_duration; + track.codec = sample_desc.getCodec(); + track.kind = (trak.udta && trak.udta.kinds.length ? trak.udta.kinds[0] : { schemeURI: "", value: ""}); + track.language = (trak.mdia.elng ? trak.mdia.elng.extended_language : trak.mdia.mdhd.languageString); + track.nb_samples = trak.samples.length; + track.size = trak.samples_size; + track.bitrate = (track.size*8*track.timescale)/track.samples_duration; + if (sample_desc.isAudio()) { + track.type = "audio"; + movie.audioTracks.push(track); + track.audio = {}; + track.audio.sample_rate = sample_desc.getSampleRate(); + track.audio.channel_count = sample_desc.getChannelCount(); + track.audio.sample_size = sample_desc.getSampleSize(); + } else if (sample_desc.isVideo()) { + track.type = "video"; + movie.videoTracks.push(track); + track.video = {}; + track.video.width = sample_desc.getWidth(); + track.video.height = sample_desc.getHeight(); + } else if (sample_desc.isSubtitle()) { + track.type = "subtitles"; + movie.subtitleTracks.push(track); + } else if (sample_desc.isHint()) { + track.type = "metadata"; + movie.hintTracks.push(track); + } else if (sample_desc.isMetadata()) { + track.type = "metadata"; + movie.metadataTracks.push(track); + } else { + track.type = "metadata"; + movie.otherTracks.push(track); + } + } + } else { + movie.hasMoov = false; + } + movie.mime = ""; + if (movie.hasMoov && movie.tracks) { + if (movie.videoTracks && movie.videoTracks.length > 0) { + movie.mime += 'video/mp4; codecs=\"'; + } else if (movie.audioTracks && movie.audioTracks.length > 0) { + movie.mime += 'audio/mp4; codecs=\"'; + } else { + movie.mime += 'application/mp4; codecs=\"'; + } + for (i = 0; i < movie.tracks.length; i++) { + if (i !== 0) movie.mime += ','; + movie.mime+= movie.tracks[i].codec; + } + movie.mime += '\"; profiles=\"'; + movie.mime += this.ftyp.compatible_brands.join(); + movie.mime += '\"'; + } + return movie; +} + +ISOFile.prototype.setNextSeekPositionFromSample = function (sample) { + if (!sample) { + return; + } + if (this.nextSeekPosition) { + this.nextSeekPosition = Math.min(sample.offset+sample.alreadyRead,this.nextSeekPosition); + } else { + this.nextSeekPosition = sample.offset+sample.alreadyRead; + } +} + +ISOFile.prototype.processSamples = function(last) { + var i; + var trak; + if (!this.sampleProcessingStarted) return; + + /* For each track marked for fragmentation, + check if the next sample is there (i.e. if the sample information is known (i.e. moof has arrived) and if it has been downloaded) + and create a fragment with it */ + if (this.isFragmentationInitialized && this.onSegment !== null) { + for (i = 0; i < this.fragmentedTracks.length; i++) { + var fragTrak = this.fragmentedTracks[i]; + trak = fragTrak.trak; + while (trak.nextSample < trak.samples.length && this.sampleProcessingStarted) { + /* The sample information is there (either because the file is not fragmented and this is not the last sample, + or because the file is fragmented and the moof for that sample has been received */ + Log.debug("ISOFile", "Creating media fragment on track #"+fragTrak.id +" for sample "+trak.nextSample); + var result = this.createFragment(fragTrak.id, trak.nextSample, fragTrak.segmentStream); + if (result) { + fragTrak.segmentStream = result; + trak.nextSample++; + } else { + /* The fragment could not be created because the media data is not there (not downloaded), wait for it */ + break; + } + /* A fragment is created by sample, but the segment is the accumulation in the buffer of these fragments. + It is flushed only as requested by the application (nb_samples) to avoid too many callbacks */ + if (trak.nextSample % fragTrak.nb_samples === 0 || (last || trak.nextSample >= trak.samples.length)) { + Log.info("ISOFile", "Sending fragmented data on track #"+fragTrak.id+" for samples ["+Math.max(0,trak.nextSample-fragTrak.nb_samples)+","+(trak.nextSample-1)+"]"); + Log.info("ISOFile", "Sample data size in memory: "+this.getAllocatedSampleDataSize()); + if (this.onSegment) { + this.onSegment(fragTrak.id, fragTrak.user, fragTrak.segmentStream.buffer, trak.nextSample, (last || trak.nextSample >= trak.samples.length)); + } + /* force the creation of a new buffer */ + fragTrak.segmentStream = null; + if (fragTrak !== this.fragmentedTracks[i]) { + /* make sure we can stop fragmentation if needed */ + break; + } + } + } + } + } + + if (this.onSamples !== null) { + /* For each track marked for data export, + check if the next sample is there (i.e. has been downloaded) and send it */ + for (i = 0; i < this.extractedTracks.length; i++) { + var extractTrak = this.extractedTracks[i]; + trak = extractTrak.trak; + while (trak.nextSample < trak.samples.length && this.sampleProcessingStarted) { + Log.debug("ISOFile", "Exporting on track #"+extractTrak.id +" sample #"+trak.nextSample); + var sample = this.getSample(trak, trak.nextSample); + if (sample) { + trak.nextSample++; + extractTrak.samples.push(sample); + } else { + this.setNextSeekPositionFromSample(trak.samples[trak.nextSample]); + break; + } + if (trak.nextSample % extractTrak.nb_samples === 0 || trak.nextSample >= trak.samples.length) { + Log.debug("ISOFile", "Sending samples on track #"+extractTrak.id+" for sample "+trak.nextSample); + if (this.onSamples) { + this.onSamples(extractTrak.id, extractTrak.user, extractTrak.samples); + } + extractTrak.samples = []; + if (extractTrak !== this.extractedTracks[i]) { + /* check if the extraction needs to be stopped */ + break; + } + } + } + } + } +} + +/* Find and return specific boxes using recursion and early return */ +ISOFile.prototype.getBox = function(type) { + var result = this.getBoxes(type, true); + return (result.length ? result[0] : null); +} + +ISOFile.prototype.getBoxes = function(type, returnEarly) { + var result = []; + ISOFile._sweep.call(this, type, result, returnEarly); + return result; +} + +ISOFile._sweep = function(type, result, returnEarly) { + if (this.type && this.type == type) result.push(this); + for (var box in this.boxes) { + if (result.length && returnEarly) return; + ISOFile._sweep.call(this.boxes[box], type, result, returnEarly); + } +} + +ISOFile.prototype.getTrackSamplesInfo = function(track_id) { + var track = this.getTrackById(track_id); + if (track) { + return track.samples; + } else { + return; + } +} + +ISOFile.prototype.getTrackSample = function(track_id, number) { + var track = this.getTrackById(track_id); + var sample = this.getSample(track, number); + return sample; +} + +/* Called by the application to release the resources associated to samples already forwarded to the application */ +ISOFile.prototype.releaseUsedSamples = function (id, sampleNum) { + var size = 0; + var trak = this.getTrackById(id); + if (!trak.lastValidSample) trak.lastValidSample = 0; + for (var i = trak.lastValidSample; i < sampleNum; i++) { + size+=this.releaseSample(trak, i); + } + Log.info("ISOFile", "Track #"+id+" released samples up to "+sampleNum+" (released size: "+size+", remaining: "+this.samplesDataSize+")"); + trak.lastValidSample = sampleNum; +} + +ISOFile.prototype.start = function() { + this.sampleProcessingStarted = true; + this.processSamples(false); +} + +ISOFile.prototype.stop = function() { + this.sampleProcessingStarted = false; +} + +/* Called by the application to flush the remaining samples (e.g. once the download is finished or when no more samples will be added) */ +ISOFile.prototype.flush = function() { + Log.info("ISOFile", "Flushing remaining samples"); + this.updateSampleLists(); + this.processSamples(true); + this.stream.cleanBuffers(); + this.stream.logBufferLevel(true); +} + +/* Finds the byte offset for a given time on a given track + also returns the time of the previous rap */ +ISOFile.prototype.seekTrack = function(time, useRap, trak) { + var j; + var sample; + var seek_offset = Infinity; + var rap_seek_sample_num = 0; + var seek_sample_num = 0; + var timescale; + + if (trak.samples.length === 0) { + Log.info("ISOFile", "No sample in track, cannot seek! Using time "+Log.getDurationString(0, 1) +" and offset: "+0); + return { offset: 0, time: 0 }; + } + + for (j = 0; j < trak.samples.length; j++) { + sample = trak.samples[j]; + if (j === 0) { + seek_sample_num = 0; + timescale = sample.timescale; + } else if (sample.cts > time * sample.timescale) { + seek_sample_num = j-1; + break; + } + if (useRap && sample.is_sync) { + rap_seek_sample_num = j; + } + } + if (useRap) { + seek_sample_num = rap_seek_sample_num; + } + time = trak.samples[seek_sample_num].cts; + trak.nextSample = seek_sample_num; + while (trak.samples[seek_sample_num].alreadyRead === trak.samples[seek_sample_num].size) { + // No remaining samples to look for, all are downloaded. + if (!trak.samples[seek_sample_num + 1]) { + break; + } + seek_sample_num++; + } + seek_offset = trak.samples[seek_sample_num].offset+trak.samples[seek_sample_num].alreadyRead; + Log.info("ISOFile", "Seeking to "+(useRap ? "RAP": "")+" sample #"+trak.nextSample+" on track "+trak.tkhd.track_id+", time "+Log.getDurationString(time, timescale) +" and offset: "+seek_offset); + return { offset: seek_offset, time: time/timescale }; +} + +ISOFile.prototype.getTrackDuration = function (trak) { + var sample; + + if (!trak.samples) { + return Infinity; + } + sample = trak.samples[trak.samples.length - 1]; + return (sample.cts + sample.duration) / sample.timescale; +} + +/* Finds the byte offset in the file corresponding to the given time or to the time of the previous RAP */ +ISOFile.prototype.seek = function(time, useRap) { + var moov = this.moov; + var trak; + var trak_seek_info; + var i; + var seek_info = { offset: Infinity, time: Infinity }; + if (!this.moov) { + throw "Cannot seek: moov not received!"; + } else { + for (i = 0; i this.getTrackDuration(trak)) { // skip tracks that already ended + continue; + } + trak_seek_info = this.seekTrack(time, useRap, trak); + if (trak_seek_info.offset < seek_info.offset) { + seek_info.offset = trak_seek_info.offset; + } + if (trak_seek_info.time < seek_info.time) { + seek_info.time = trak_seek_info.time; + } + } + Log.info("ISOFile", "Seeking at time "+Log.getDurationString(seek_info.time, 1)+" needs a buffer with a fileStart position of "+seek_info.offset); + if (seek_info.offset === Infinity) { + /* No sample info, in all tracks, cannot seek */ + seek_info = { offset: this.nextParsePosition, time: 0 }; + } else { + /* check if the seek position is already in some buffer and + in that case return the end of that buffer (or of the last contiguous buffer) */ + /* TODO: Should wait until append operations are done */ + seek_info.offset = this.stream.getEndFilePositionAfter(seek_info.offset); + } + Log.info("ISOFile", "Adjusted seek position (after checking data already in buffer): "+seek_info.offset); + return seek_info; + } +} + +ISOFile.prototype.equal = function(b) { + var box_index = 0; + while (box_index < this.boxes.length && box_index < b.boxes.length) { + var a_box = this.boxes[box_index]; + var b_box = b.boxes[box_index]; + if (!BoxParser.boxEqual(a_box, b_box)) { + return false; + } + box_index++; + } + return true; +} + +if (typeof exports !== 'undefined') { + exports.ISOFile = ISOFile; +} +// file:src/isofile-advanced-parsing.js +/* position in the current buffer of the beginning of the last box parsed */ +ISOFile.prototype.lastBoxStartPosition = 0; +/* indicator if the parsing is stuck in the middle of an mdat box */ +ISOFile.prototype.parsingMdat = null; +/* next file position that the parser needs: + - 0 until the first buffer (i.e. fileStart ===0) has been received + - otherwise, the next box start until the moov box has been parsed + - otherwise, the position of the next sample to fetch + */ +ISOFile.prototype.nextParsePosition = 0; +/* keep mdat data */ +ISOFile.prototype.discardMdatData = false; + +ISOFile.prototype.processIncompleteBox = function(ret) { + var box; + var merged; + var found; + + /* we did not have enough bytes in the current buffer to parse the entire box */ + if (ret.type === "mdat") { + /* we had enough bytes to get its type and size and it's an 'mdat' */ + + /* special handling for mdat boxes, since we don't actually need to parse it linearly + we create the box */ + box = new BoxParser[ret.type+"Box"](ret.size); + this.parsingMdat = box; + this.boxes.push(box); + this.mdats.push(box); + box.start = ret.start; + box.hdr_size = ret.hdr_size; + this.stream.addUsedBytes(box.hdr_size); + + /* indicate that the parsing should start from the end of the box */ + this.lastBoxStartPosition = box.start + box.size; + /* let's see if we have the end of the box in the other buffers */ + found = this.stream.seek(box.start + box.size, false, this.discardMdatData); + if (found) { + /* found the end of the box */ + this.parsingMdat = null; + /* let's see if we can parse more in this buffer */ + return true; + } else { + /* 'mdat' end not found in the existing buffers */ + /* determine the next position in the file to start parsing from */ + if (!this.moovStartFound) { + /* moov not find yet, + the file probably has 'mdat' at the beginning, and 'moov' at the end, + indicate that the downloader should not try to download those bytes now */ + this.nextParsePosition = box.start + box.size; + } else { + /* we have the start of the moov box, + the next bytes should try to complete the current 'mdat' */ + this.nextParsePosition = this.stream.findEndContiguousBuf(); + } + /* not much we can do, wait for more buffers to arrive */ + return false; + } + } else { + /* box is incomplete, we may not even know its type */ + if (ret.type === "moov") { + /* the incomplete box is a 'moov' box */ + this.moovStartFound = true; + if (this.mdats.length === 0) { + this.isProgressive = true; + } + } + /* either it's not an mdat box (and we need to parse it, we cannot skip it) + (TODO: we could skip 'free' boxes ...) + or we did not have enough data to parse the type and size of the box, + we try to concatenate the current buffer with the next buffer to restart parsing */ + merged = (this.stream.mergeNextBuffer ? this.stream.mergeNextBuffer() : false); + if (merged) { + /* The next buffer was contiguous, the merging succeeded, + we can now continue parsing, + the next best position to parse is at the end of this new buffer */ + this.nextParsePosition = this.stream.getEndPosition(); + return true; + } else { + /* we cannot concatenate existing buffers because they are not contiguous or because there is no additional buffer */ + /* The next best position to parse is still at the end of this old buffer */ + if (!ret.type) { + /* There were not enough bytes in the buffer to parse the box type and length, + the next fetch should retrieve those missing bytes, i.e. the next bytes after this buffer */ + this.nextParsePosition = this.stream.getEndPosition(); + } else { + /* we had enough bytes to parse size and type of the incomplete box + if we haven't found yet the moov box, skip this one and try the next one + if we have found the moov box, let's continue linear parsing */ + if (this.moovStartFound) { + this.nextParsePosition = this.stream.getEndPosition(); + } else { + this.nextParsePosition = this.stream.getPosition() + ret.size; + } + } + return false; + } + } +} + +ISOFile.prototype.hasIncompleteMdat = function () { + return (this.parsingMdat !== null); +} + +ISOFile.prototype.processIncompleteMdat = function () { + var box; + var found; + + /* we are in the parsing of an incomplete mdat box */ + box = this.parsingMdat; + + found = this.stream.seek(box.start + box.size, false, this.discardMdatData); + if (found) { + Log.debug("ISOFile", "Found 'mdat' end in buffered data"); + /* the end of the mdat has been found */ + this.parsingMdat = null; + /* we can parse more in this buffer */ + return true; + } else { + /* we don't have the end of this mdat yet, + indicate that the next byte to fetch is the end of the buffers we have so far, + return and wait for more buffer to come */ + this.nextParsePosition = this.stream.findEndContiguousBuf(); + return false; + } +} + +ISOFile.prototype.restoreParsePosition = function() { + /* Reposition at the start position of the previous box not entirely parsed */ + return this.stream.seek(this.lastBoxStartPosition, true, this.discardMdatData); +} + +ISOFile.prototype.saveParsePosition = function() { + /* remember the position of the box start in case we need to roll back (if the box is incomplete) */ + this.lastBoxStartPosition = this.stream.getPosition(); +} + +ISOFile.prototype.updateUsedBytes = function(box, ret) { + if (this.stream.addUsedBytes) { + if (box.type === "mdat") { + /* for an mdat box, only its header is considered used, other bytes will be used when sample data is requested */ + this.stream.addUsedBytes(box.hdr_size); + if (this.discardMdatData) { + this.stream.addUsedBytes(box.size-box.hdr_size); + } + } else { + /* for all other boxes, the entire box data is considered used */ + this.stream.addUsedBytes(box.size); + } + } +} +// file:src/isofile-advanced-creation.js +ISOFile.prototype.add = BoxParser.Box.prototype.add; +ISOFile.prototype.addBox = BoxParser.Box.prototype.addBox; + +ISOFile.prototype.init = function (_options) { + var options = _options || {}; + var ftyp = this.add("ftyp").set("major_brand", (options.brands && options.brands[0]) || "iso4") + .set("minor_version", 0) + .set("compatible_brands", options.brands || ["iso4"]); + var moov = this.add("moov"); + moov.add("mvhd").set("timescale", options.timescale || 600) + .set("rate", options.rate || 1<<16) + .set("creation_time", 0) + .set("modification_time", 0) + .set("duration", options.duration || 0) + .set("volume", (options.width) ? 0 : 0x0100) + .set("matrix", [ 1<<16, 0, 0, 0, 1<<16, 0, 0, 0, 0x40000000]) + .set("next_track_id", 1); + moov.add("mvex"); + return this; +} + +ISOFile.prototype.addTrack = function (_options) { + if (!this.moov) { + this.init(_options); + } + + var options = _options || {}; + options.width = options.width || 320; + options.height = options.height || 320; + options.id = options.id || this.moov.mvhd.next_track_id; + options.type = options.type || "avc1"; + + var trak = this.moov.add("trak"); + this.moov.mvhd.next_track_id = options.id+1; + trak.add("tkhd").set("flags",BoxParser.TKHD_FLAG_ENABLED | + BoxParser.TKHD_FLAG_IN_MOVIE | + BoxParser.TKHD_FLAG_IN_PREVIEW) + .set("creation_time",0) + .set("modification_time", 0) + .set("track_id", options.id) + .set("duration", options.duration || 0) + .set("layer", options.layer || 0) + .set("alternate_group", 0) + .set("volume", 1) + .set("matrix", [ 1<<16, 0, 0, 0, 1<<16, 0, 0, 0, 0x40000000 ]) + .set("width", options.width << 16) + .set("height", options.height << 16); + + var mdia = trak.add("mdia"); + mdia.add("mdhd").set("creation_time", 0) + .set("modification_time", 0) + .set("timescale", options.timescale || 1) + .set("duration", options.media_duration || 0) + .set("language", options.language || "und"); + + mdia.add("hdlr").set("handler", options.hdlr || "vide") + .set("name", options.name || "Track created with MP4Box.js"); + + mdia.add("elng").set("extended_language", options.language || "fr-FR"); + + var minf = mdia.add("minf"); + if (BoxParser[options.type+"SampleEntry"] === undefined) return; + var sample_description_entry = new BoxParser[options.type+"SampleEntry"](); + sample_description_entry.data_reference_index = 1; + var media_type = ""; + for (var mediaType in BoxParser.sampleEntryCodes) { + var codes = BoxParser.sampleEntryCodes[mediaType]; + for (var i = 0; i < codes.length; i++) { + if (codes.indexOf(options.type) > -1) { + media_type = mediaType; + break; + } + } + } + switch(media_type) { + case "Visual": + minf.add("vmhd").set("graphicsmode",0).set("opcolor", [ 0, 0, 0 ]); + sample_description_entry.set("width", options.width) + .set("height", options.height) + .set("horizresolution", 0x48<<16) + .set("vertresolution", 0x48<<16) + .set("frame_count", 1) + .set("compressorname", options.type+" Compressor") + .set("depth", 0x18); + if (options.avcDecoderConfigRecord) { + var avcC = new BoxParser.avcCBox(); + avcC.parse(new MP4BoxStream(options.avcDecoderConfigRecord)); + sample_description_entry.addBox(avcC); + } else if (options.hevcDecoderConfigRecord) { + var hvcC = new BoxParser.hvcCBox(); + hvcC.parse(new MP4BoxStream(options.hevcDecoderConfigRecord)); + sample_description_entry.addBox(hvcC); + } + break; + case "Audio": + minf.add("smhd").set("balance", options.balance || 0); + sample_description_entry.set("channel_count", options.channel_count || 2) + .set("samplesize", options.samplesize || 16) + .set("samplerate", options.samplerate || 1<<16); + break; + case "Hint": + minf.add("hmhd"); // TODO: add properties + break; + case "Subtitle": + minf.add("sthd"); + switch (options.type) { + case "stpp": + sample_description_entry.set("namespace", options.namespace || "nonamespace") + .set("schema_location", options.schema_location || "") + .set("auxiliary_mime_types", options.auxiliary_mime_types || ""); + break; + } + break; + case "Metadata": + minf.add("nmhd"); + break; + case "System": + minf.add("nmhd"); + break; + default: + minf.add("nmhd"); + break; + } + if (options.description) { + sample_description_entry.addBox(options.description); + } + if (options.description_boxes) { + options.description_boxes.forEach(function (b) { + sample_description_entry.addBox(b); + }); + } + minf.add("dinf").add("dref").addEntry((new BoxParser["url Box"]()).set("flags", 0x1)); + var stbl = minf.add("stbl"); + stbl.add("stsd").addEntry(sample_description_entry); + stbl.add("stts").set("sample_counts", []) + .set("sample_deltas", []); + stbl.add("stsc").set("first_chunk", []) + .set("samples_per_chunk", []) + .set("sample_description_index", []); + stbl.add("stco").set("chunk_offsets", []); + stbl.add("stsz").set("sample_sizes", []); + + this.moov.mvex.add("trex").set("track_id", options.id) + .set("default_sample_description_index", options.default_sample_description_index || 1) + .set("default_sample_duration", options.default_sample_duration || 0) + .set("default_sample_size", options.default_sample_size || 0) + .set("default_sample_flags", options.default_sample_flags || 0); + this.buildTrakSampleLists(trak); + return options.id; +} + +BoxParser.Box.prototype.computeSize = function(stream_) { + var stream = stream_ || new DataStream(); + stream.endianness = DataStream.BIG_ENDIAN; + this.write(stream); +} + +ISOFile.prototype.addSample = function (track_id, data, _options) { + var options = _options || {}; + var sample = {}; + var trak = this.getTrackById(track_id); + if (trak === null) return; + sample.number = trak.samples.length; + sample.track_id = trak.tkhd.track_id; + sample.timescale = trak.mdia.mdhd.timescale; + sample.description_index = (options.sample_description_index ? options.sample_description_index - 1: 0); + sample.description = trak.mdia.minf.stbl.stsd.entries[sample.description_index]; + sample.data = data; + sample.size = data.byteLength; + sample.alreadyRead = sample.size; + sample.duration = options.duration || 1; + sample.cts = options.cts || 0; + sample.dts = options.dts || 0; + sample.is_sync = options.is_sync || false; + sample.is_leading = options.is_leading || 0; + sample.depends_on = options.depends_on || 0; + sample.is_depended_on = options.is_depended_on || 0; + sample.has_redundancy = options.has_redundancy || 0; + sample.degradation_priority = options.degradation_priority || 0; + sample.offset = 0; + sample.subsamples = options.subsamples; + trak.samples.push(sample); + trak.samples_size += sample.size; + trak.samples_duration += sample.duration; + if (trak.first_dts === undefined) { + trak.first_dts = options.dts; + } + + this.processSamples(); + + var moof = this.createSingleSampleMoof(sample); + this.addBox(moof); + moof.computeSize(); + /* adjusting the data_offset now that the moof size is known*/ + moof.trafs[0].truns[0].data_offset = moof.size+8; //8 is mdat header + this.add("mdat").data = new Uint8Array(data); + return sample; +} + +ISOFile.prototype.createSingleSampleMoof = function(sample) { + var sample_flags = 0; + if (sample.is_sync) + sample_flags = (1 << 25); // sample_depends_on_none (I picture) + else + sample_flags = (1 << 16); // non-sync + + var moof = new BoxParser.moofBox(); + moof.add("mfhd").set("sequence_number", this.nextMoofNumber); + this.nextMoofNumber++; + var traf = moof.add("traf"); + var trak = this.getTrackById(sample.track_id); + traf.add("tfhd").set("track_id", sample.track_id) + .set("flags", BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF); + traf.add("tfdt").set("baseMediaDecodeTime", (sample.dts - (trak.first_dts || 0))); + traf.add("trun").set("flags", BoxParser.TRUN_FLAGS_DATA_OFFSET | BoxParser.TRUN_FLAGS_DURATION | + BoxParser.TRUN_FLAGS_SIZE | BoxParser.TRUN_FLAGS_FLAGS | + BoxParser.TRUN_FLAGS_CTS_OFFSET) + .set("data_offset",0) + .set("first_sample_flags",0) + .set("sample_count",1) + .set("sample_duration",[sample.duration]) + .set("sample_size",[sample.size]) + .set("sample_flags",[sample_flags]) + .set("sample_composition_time_offset", [sample.cts - sample.dts]); + return moof; +} + +// file:src/isofile-sample-processing.js +/* Index of the last moof box received */ +ISOFile.prototype.lastMoofIndex = 0; + +/* size of the buffers allocated for samples */ +ISOFile.prototype.samplesDataSize = 0; + +/* Resets all sample tables */ +ISOFile.prototype.resetTables = function () { + var i; + var trak, stco, stsc, stsz, stts, ctts, stss; + this.initial_duration = this.moov.mvhd.duration; + this.moov.mvhd.duration = 0; + for (i = 0; i < this.moov.traks.length; i++) { + trak = this.moov.traks[i]; + trak.tkhd.duration = 0; + trak.mdia.mdhd.duration = 0; + stco = trak.mdia.minf.stbl.stco || trak.mdia.minf.stbl.co64; + stco.chunk_offsets = []; + stsc = trak.mdia.minf.stbl.stsc; + stsc.first_chunk = []; + stsc.samples_per_chunk = []; + stsc.sample_description_index = []; + stsz = trak.mdia.minf.stbl.stsz || trak.mdia.minf.stbl.stz2; + stsz.sample_sizes = []; + stts = trak.mdia.minf.stbl.stts; + stts.sample_counts = []; + stts.sample_deltas = []; + ctts = trak.mdia.minf.stbl.ctts; + if (ctts) { + ctts.sample_counts = []; + ctts.sample_offsets = []; + } + stss = trak.mdia.minf.stbl.stss; + var k = trak.mdia.minf.stbl.boxes.indexOf(stss); + if (k != -1) trak.mdia.minf.stbl.boxes[k] = null; + } +} + +ISOFile.initSampleGroups = function(trak, traf, sbgps, trak_sgpds, traf_sgpds) { + var l; + var k; + var sample_groups_info; + var sample_group_info; + var sample_group_key; + function SampleGroupInfo(_type, _parameter, _sbgp) { + this.grouping_type = _type; + this.grouping_type_parameter = _parameter; + this.sbgp = _sbgp; + this.last_sample_in_run = -1; + this.entry_index = -1; + } + if (traf) { + traf.sample_groups_info = []; + } + if (!trak.sample_groups_info) { + trak.sample_groups_info = []; + } + for (k = 0; k < sbgps.length; k++) { + sample_group_key = sbgps[k].grouping_type +"/"+ sbgps[k].grouping_type_parameter; + sample_group_info = new SampleGroupInfo(sbgps[k].grouping_type, sbgps[k].grouping_type_parameter, sbgps[k]); + if (traf) { + traf.sample_groups_info[sample_group_key] = sample_group_info; + } + if (!trak.sample_groups_info[sample_group_key]) { + trak.sample_groups_info[sample_group_key] = sample_group_info; + } + for (l=0; l = 2) { + sample_group_key = trak_sgpds[k].grouping_type +"/0"; + sample_group_info = new SampleGroupInfo(trak_sgpds[k].grouping_type, 0); + if (!trak.sample_groups_info[sample_group_key]) { + trak.sample_groups_info[sample_group_key] = sample_group_info; + } + } + } + } else { + if (traf_sgpds) { + for (k = 0; k < traf_sgpds.length; k++) { + if (!traf_sgpds[k].used && traf_sgpds[k].version >= 2) { + sample_group_key = traf_sgpds[k].grouping_type +"/0"; + sample_group_info = new SampleGroupInfo(traf_sgpds[k].grouping_type, 0); + sample_group_info.is_fragment = true; + if (!traf.sample_groups_info[sample_group_key]) { + traf.sample_groups_info[sample_group_key] = sample_group_info; + } + } + } + } + } +} + +ISOFile.setSampleGroupProperties = function(trak, sample, sample_number, sample_groups_info) { + var k; + var index; + sample.sample_groups = []; + for (k in sample_groups_info) { + sample.sample_groups[k] = {}; + sample.sample_groups[k].grouping_type = sample_groups_info[k].grouping_type; + sample.sample_groups[k].grouping_type_parameter = sample_groups_info[k].grouping_type_parameter; + if (sample_number >= sample_groups_info[k].last_sample_in_run) { + if (sample_groups_info[k].last_sample_in_run < 0) { + sample_groups_info[k].last_sample_in_run = 0; + } + sample_groups_info[k].entry_index++; + if (sample_groups_info[k].entry_index <= sample_groups_info[k].sbgp.entries.length - 1) { + sample_groups_info[k].last_sample_in_run += sample_groups_info[k].sbgp.entries[sample_groups_info[k].entry_index].sample_count; + } + } + if (sample_groups_info[k].entry_index <= sample_groups_info[k].sbgp.entries.length - 1) { + sample.sample_groups[k].group_description_index = sample_groups_info[k].sbgp.entries[sample_groups_info[k].entry_index].group_description_index; + } else { + sample.sample_groups[k].group_description_index = -1; // special value for not defined + } + if (sample.sample_groups[k].group_description_index !== 0) { + var description; + if (sample_groups_info[k].fragment_description) { + description = sample_groups_info[k].fragment_description; + } else { + description = sample_groups_info[k].description; + } + if (sample.sample_groups[k].group_description_index > 0) { + if (sample.sample_groups[k].group_description_index > 65535) { + index = (sample.sample_groups[k].group_description_index >> 16)-1; + } else { + index = sample.sample_groups[k].group_description_index-1; + } + if (description && index >= 0) { + sample.sample_groups[k].description = description.entries[index]; + } + } else { + if (description && description.version >= 2) { + if (description.default_group_description_index > 0) { + sample.sample_groups[k].description = description.entries[description.default_group_description_index-1]; + } + } + } + } + } +} + +ISOFile.process_sdtp = function (sdtp, sample, number) { + if (!sample) { + return; + } + if (sdtp) { + sample.is_leading = sdtp.is_leading[number]; + sample.depends_on = sdtp.sample_depends_on[number]; + sample.is_depended_on = sdtp.sample_is_depended_on[number]; + sample.has_redundancy = sdtp.sample_has_redundancy[number]; + } else { + sample.is_leading = 0; + sample.depends_on = 0; + sample.is_depended_on = 0 + sample.has_redundancy = 0; + } +} + +/* Build initial sample list from sample tables */ +ISOFile.prototype.buildSampleLists = function() { + var i; + var trak; + for (i = 0; i < this.moov.traks.length; i++) { + trak = this.moov.traks[i]; + this.buildTrakSampleLists(trak); + } +} + +ISOFile.prototype.buildTrakSampleLists = function(trak) { + var j, k; + var stco, stsc, stsz, stts, ctts, stss, stsd, subs, sbgps, sgpds, stdp; + var chunk_run_index, chunk_index, last_chunk_in_run, offset_in_chunk, last_sample_in_chunk; + var last_sample_in_stts_run, stts_run_index, last_sample_in_ctts_run, ctts_run_index, last_stss_index, last_subs_index, subs_entry_index, last_subs_sample_index; + + trak.samples = []; + trak.samples_duration = 0; + trak.samples_size = 0; + stco = trak.mdia.minf.stbl.stco || trak.mdia.minf.stbl.co64; + stsc = trak.mdia.minf.stbl.stsc; + stsz = trak.mdia.minf.stbl.stsz || trak.mdia.minf.stbl.stz2; + stts = trak.mdia.minf.stbl.stts; + ctts = trak.mdia.minf.stbl.ctts; + stss = trak.mdia.minf.stbl.stss; + stsd = trak.mdia.minf.stbl.stsd; + subs = trak.mdia.minf.stbl.subs; + stdp = trak.mdia.minf.stbl.stdp; + sbgps = trak.mdia.minf.stbl.sbgps; + sgpds = trak.mdia.minf.stbl.sgpds; + + last_sample_in_stts_run = -1; + stts_run_index = -1; + last_sample_in_ctts_run = -1; + ctts_run_index = -1; + last_stss_index = 0; + subs_entry_index = 0; + last_subs_sample_index = 0; + + ISOFile.initSampleGroups(trak, null, sbgps, sgpds); + + if (typeof stsz === "undefined") { + return; + } + + /* we build the samples one by one and compute their properties */ + for (j = 0; j < stsz.sample_sizes.length; j++) { + var sample = {}; + sample.number = j; + sample.track_id = trak.tkhd.track_id; + sample.timescale = trak.mdia.mdhd.timescale; + sample.alreadyRead = 0; + trak.samples[j] = sample; + /* size can be known directly */ + sample.size = stsz.sample_sizes[j]; + trak.samples_size += sample.size; + /* computing chunk-based properties (offset, sample description index)*/ + if (j === 0) { + chunk_index = 1; /* the first sample is in the first chunk (chunk indexes are 1-based) */ + chunk_run_index = 0; /* the first chunk is the first entry in the first_chunk table */ + sample.chunk_index = chunk_index; + sample.chunk_run_index = chunk_run_index; + last_sample_in_chunk = stsc.samples_per_chunk[chunk_run_index]; + offset_in_chunk = 0; + + /* Is there another entry in the first_chunk table ? */ + if (chunk_run_index + 1 < stsc.first_chunk.length) { + /* The last chunk in the run is the chunk before the next first chunk */ + last_chunk_in_run = stsc.first_chunk[chunk_run_index+1]-1; + } else { + /* There is only one entry in the table, it is valid for all future chunks*/ + last_chunk_in_run = Infinity; + } + } else { + if (j < last_sample_in_chunk) { + /* the sample is still in the current chunk */ + sample.chunk_index = chunk_index; + sample.chunk_run_index = chunk_run_index; + } else { + /* the sample is in the next chunk */ + chunk_index++; + sample.chunk_index = chunk_index; + /* reset the accumulated offset in the chunk */ + offset_in_chunk = 0; + if (chunk_index <= last_chunk_in_run) { + /* stay in the same entry of the first_chunk table */ + /* chunk_run_index unmodified */ + } else { + chunk_run_index++; + /* Is there another entry in the first_chunk table ? */ + if (chunk_run_index + 1 < stsc.first_chunk.length) { + /* The last chunk in the run is the chunk before the next first chunk */ + last_chunk_in_run = stsc.first_chunk[chunk_run_index+1]-1; + } else { + /* There is only one entry in the table, it is valid for all future chunks*/ + last_chunk_in_run = Infinity; + } + + } + sample.chunk_run_index = chunk_run_index; + last_sample_in_chunk += stsc.samples_per_chunk[chunk_run_index]; + } + } + + sample.description_index = stsc.sample_description_index[sample.chunk_run_index]-1; + sample.description = stsd.entries[sample.description_index]; + sample.offset = stco.chunk_offsets[sample.chunk_index-1] + offset_in_chunk; /* chunk indexes are 1-based */ + offset_in_chunk += sample.size; + + /* setting dts, cts, duration and rap flags */ + if (j > last_sample_in_stts_run) { + stts_run_index++; + if (last_sample_in_stts_run < 0) { + last_sample_in_stts_run = 0; + } + last_sample_in_stts_run += stts.sample_counts[stts_run_index]; + } + if (j > 0) { + trak.samples[j-1].duration = stts.sample_deltas[stts_run_index]; + trak.samples_duration += trak.samples[j-1].duration; + sample.dts = trak.samples[j-1].dts + trak.samples[j-1].duration; + } else { + sample.dts = 0; + } + if (ctts) { + if (j >= last_sample_in_ctts_run) { + ctts_run_index++; + if (last_sample_in_ctts_run < 0) { + last_sample_in_ctts_run = 0; + } + last_sample_in_ctts_run += ctts.sample_counts[ctts_run_index]; + } + sample.cts = trak.samples[j].dts + ctts.sample_offsets[ctts_run_index]; + } else { + sample.cts = sample.dts; + } + if (stss) { + if (j == stss.sample_numbers[last_stss_index] - 1) { // sample numbers are 1-based + sample.is_sync = true; + last_stss_index++; + } else { + sample.is_sync = false; + sample.degradation_priority = 0; + } + if (subs) { + if (subs.entries[subs_entry_index].sample_delta + last_subs_sample_index == j+1) { + sample.subsamples = subs.entries[subs_entry_index].subsamples; + last_subs_sample_index += subs.entries[subs_entry_index].sample_delta; + subs_entry_index++; + } + } + } else { + sample.is_sync = true; + } + ISOFile.process_sdtp(trak.mdia.minf.stbl.sdtp, sample, sample.number); + if (stdp) { + sample.degradation_priority = stdp.priority[j]; + } else { + sample.degradation_priority = 0; + } + if (subs) { + if (subs.entries[subs_entry_index].sample_delta + last_subs_sample_index == j) { + sample.subsamples = subs.entries[subs_entry_index].subsamples; + last_subs_sample_index += subs.entries[subs_entry_index].sample_delta; + } + } + if (sbgps.length > 0 || sgpds.length > 0) { + ISOFile.setSampleGroupProperties(trak, sample, j, trak.sample_groups_info); + } + } + if (j>0) { + trak.samples[j-1].duration = Math.max(trak.mdia.mdhd.duration - trak.samples[j-1].dts, 0); + trak.samples_duration += trak.samples[j-1].duration; + } +} + +/* Update sample list when new 'moof' boxes are received */ +ISOFile.prototype.updateSampleLists = function() { + var i, j, k; + var default_sample_description_index, default_sample_duration, default_sample_size, default_sample_flags; + var last_run_position; + var box, moof, traf, trak, trex; + var sample; + var sample_flags; + + if (this.moov === undefined) { + return; + } + /* if the input file is fragmented and fetched in multiple downloads, we need to update the list of samples */ + while (this.lastMoofIndex < this.moofs.length) { + box = this.moofs[this.lastMoofIndex]; + this.lastMoofIndex++; + if (box.type == "moof") { + moof = box; + for (i = 0; i < moof.trafs.length; i++) { + traf = moof.trafs[i]; + trak = this.getTrackById(traf.tfhd.track_id); + trex = this.getTrexById(traf.tfhd.track_id); + if (traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_DESC) { + default_sample_description_index = traf.tfhd.default_sample_description_index; + } else { + default_sample_description_index = (trex ? trex.default_sample_description_index: 1); + } + if (traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_DUR) { + default_sample_duration = traf.tfhd.default_sample_duration; + } else { + default_sample_duration = (trex ? trex.default_sample_duration : 0); + } + if (traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_SIZE) { + default_sample_size = traf.tfhd.default_sample_size; + } else { + default_sample_size = (trex ? trex.default_sample_size : 0); + } + if (traf.tfhd.flags & BoxParser.TFHD_FLAG_SAMPLE_FLAGS) { + default_sample_flags = traf.tfhd.default_sample_flags; + } else { + default_sample_flags = (trex ? trex.default_sample_flags : 0); + } + traf.sample_number = 0; + /* process sample groups */ + if (traf.sbgps.length > 0) { + ISOFile.initSampleGroups(trak, traf, traf.sbgps, trak.mdia.minf.stbl.sgpds, traf.sgpds); + } + for (j = 0; j < traf.truns.length; j++) { + var trun = traf.truns[j]; + for (k = 0; k < trun.sample_count; k++) { + sample = {}; + sample.moof_number = this.lastMoofIndex; + sample.number_in_traf = traf.sample_number; + traf.sample_number++; + sample.number = trak.samples.length; + traf.first_sample_index = trak.samples.length; + trak.samples.push(sample); + sample.track_id = trak.tkhd.track_id; + sample.timescale = trak.mdia.mdhd.timescale; + sample.description_index = default_sample_description_index-1; + sample.description = trak.mdia.minf.stbl.stsd.entries[sample.description_index]; + sample.size = default_sample_size; + if (trun.flags & BoxParser.TRUN_FLAGS_SIZE) { + sample.size = trun.sample_size[k]; + } + trak.samples_size += sample.size; + sample.duration = default_sample_duration; + if (trun.flags & BoxParser.TRUN_FLAGS_DURATION) { + sample.duration = trun.sample_duration[k]; + } + trak.samples_duration += sample.duration; + if (trak.first_traf_merged || k > 0) { + sample.dts = trak.samples[trak.samples.length-2].dts+trak.samples[trak.samples.length-2].duration; + } else { + if (traf.tfdt) { + sample.dts = traf.tfdt.baseMediaDecodeTime; + } else { + sample.dts = 0; + } + trak.first_traf_merged = true; + } + sample.cts = sample.dts; + if (trun.flags & BoxParser.TRUN_FLAGS_CTS_OFFSET) { + sample.cts = sample.dts + trun.sample_composition_time_offset[k]; + } + sample_flags = default_sample_flags; + if (trun.flags & BoxParser.TRUN_FLAGS_FLAGS) { + sample_flags = trun.sample_flags[k]; + } else if (k === 0 && (trun.flags & BoxParser.TRUN_FLAGS_FIRST_FLAG)) { + sample_flags = trun.first_sample_flags; + } + sample.is_sync = ((sample_flags >> 16 & 0x1) ? false : true); + sample.is_leading = (sample_flags >> 26 & 0x3); + sample.depends_on = (sample_flags >> 24 & 0x3); + sample.is_depended_on = (sample_flags >> 22 & 0x3); + sample.has_redundancy = (sample_flags >> 20 & 0x3); + sample.degradation_priority = (sample_flags & 0xFFFF); + //ISOFile.process_sdtp(traf.sdtp, sample, sample.number_in_traf); + var bdop = (traf.tfhd.flags & BoxParser.TFHD_FLAG_BASE_DATA_OFFSET) ? true : false; + var dbim = (traf.tfhd.flags & BoxParser.TFHD_FLAG_DEFAULT_BASE_IS_MOOF) ? true : false; + var dop = (trun.flags & BoxParser.TRUN_FLAGS_DATA_OFFSET) ? true : false; + var bdo = 0; + if (!bdop) { + if (!dbim) { + if (j === 0) { // the first track in the movie fragment + bdo = moof.start; // the position of the first byte of the enclosing Movie Fragment Box + } else { + bdo = last_run_position; // end of the data defined by the preceding *track* (irrespective of the track id) fragment in the moof + } + } else { + bdo = moof.start; + } + } else { + bdo = traf.tfhd.base_data_offset; + } + if (j === 0 && k === 0) { + if (dop) { + sample.offset = bdo + trun.data_offset; // If the data-offset is present, it is relative to the base-data-offset established in the track fragment header + } else { + sample.offset = bdo; // the data for this run starts the base-data-offset defined by the track fragment header + } + } else { + sample.offset = last_run_position; // this run starts immediately after the data of the previous run + } + last_run_position = sample.offset + sample.size; + if (traf.sbgps.length > 0 || traf.sgpds.length > 0 || + trak.mdia.minf.stbl.sbgps.length > 0 || trak.mdia.minf.stbl.sgpds.length > 0) { + ISOFile.setSampleGroupProperties(trak, sample, sample.number_in_traf, traf.sample_groups_info); + } + } + } + if (traf.subs) { + trak.has_fragment_subsamples = true; + var sample_index = traf.first_sample_index; + for (j = 0; j < traf.subs.entries.length; j++) { + sample_index += traf.subs.entries[j].sample_delta; + sample = trak.samples[sample_index-1]; + sample.subsamples = traf.subs.entries[j].subsamples; + } + } + } + } + } +} + +/* Try to get sample data for a given sample: + returns null if not found + returns the same sample if already requested + */ +ISOFile.prototype.getSample = function(trak, sampleNum) { + var buffer; + var sample = trak.samples[sampleNum]; + + if (!this.moov) { + return null; + } + + if (!sample.data) { + /* Not yet fetched */ + sample.data = new Uint8Array(sample.size); + sample.alreadyRead = 0; + this.samplesDataSize += sample.size; + Log.debug("ISOFile", "Allocating sample #"+sampleNum+" on track #"+trak.tkhd.track_id+" of size "+sample.size+" (total: "+this.samplesDataSize+")"); + } else if (sample.alreadyRead == sample.size) { + /* Already fetched entirely */ + return sample; + } + + /* The sample has only been partially fetched, we need to check in all buffers */ + while(true) { + var index = this.stream.findPosition(true, sample.offset + sample.alreadyRead, false); + if (index > -1) { + buffer = this.stream.buffers[index]; + var lengthAfterStart = buffer.byteLength - (sample.offset + sample.alreadyRead - buffer.fileStart); + if (sample.size - sample.alreadyRead <= lengthAfterStart) { + /* the (rest of the) sample is entirely contained in this buffer */ + + Log.debug("ISOFile","Getting sample #"+sampleNum+" data (alreadyRead: "+sample.alreadyRead+" offset: "+ + (sample.offset+sample.alreadyRead - buffer.fileStart)+" read size: "+(sample.size - sample.alreadyRead)+" full size: "+sample.size+")"); + + DataStream.memcpy(sample.data.buffer, sample.alreadyRead, + buffer, sample.offset+sample.alreadyRead - buffer.fileStart, sample.size - sample.alreadyRead); + + /* update the number of bytes used in this buffer and check if it needs to be removed */ + buffer.usedBytes += sample.size - sample.alreadyRead; + this.stream.logBufferLevel(); + + sample.alreadyRead = sample.size; + + return sample; + } else { + /* the sample does not end in this buffer */ + + if (lengthAfterStart === 0) return null; + + Log.debug("ISOFile","Getting sample #"+sampleNum+" partial data (alreadyRead: "+sample.alreadyRead+" offset: "+ + (sample.offset+sample.alreadyRead - buffer.fileStart)+" read size: "+lengthAfterStart+" full size: "+sample.size+")"); + + DataStream.memcpy(sample.data.buffer, sample.alreadyRead, + buffer, sample.offset+sample.alreadyRead - buffer.fileStart, lengthAfterStart); + sample.alreadyRead += lengthAfterStart; + + /* update the number of bytes used in this buffer and check if it needs to be removed */ + buffer.usedBytes += lengthAfterStart; + this.stream.logBufferLevel(); + + /* keep looking in the next buffer */ + } + } else { + return null; + } + } +} + +/* Release the memory used to store the data of the sample */ +ISOFile.prototype.releaseSample = function(trak, sampleNum) { + var sample = trak.samples[sampleNum]; + if (sample.data) { + this.samplesDataSize -= sample.size; + sample.data = null; + sample.alreadyRead = 0; + return sample.size; + } else { + return 0; + } +} + +ISOFile.prototype.getAllocatedSampleDataSize = function() { + return this.samplesDataSize; +} + +/* Builds the MIME Type 'codecs' sub-parameters for the whole file */ +ISOFile.prototype.getCodecs = function() { + var i; + var codecs = ""; + for (i = 0; i < this.moov.traks.length; i++) { + var trak = this.moov.traks[i]; + if (i>0) { + codecs+=","; + } + codecs += trak.mdia.minf.stbl.stsd.entries[0].getCodec(); + } + return codecs; +} + +/* Helper function */ +ISOFile.prototype.getTrexById = function(id) { + var i; + if (!this.moov || !this.moov.mvex) return null; + for (i = 0; i < this.moov.mvex.trexs.length; i++) { + var trex = this.moov.mvex.trexs[i]; + if (trex.track_id == id) return trex; + } + return null; +} + +/* Helper function */ +ISOFile.prototype.getTrackById = function(id) { + if (this.moov === undefined) { + return null; + } + for (var j = 0; j < this.moov.traks.length; j++) { + var trak = this.moov.traks[j]; + if (trak.tkhd.track_id == id) return trak; + } + return null; +} +// file:src/isofile-item-processing.js +/* size of the buffers allocated for samples */ +ISOFile.prototype.itemsDataSize = 0; + +ISOFile.prototype.flattenItemInfo = function() { + var items = this.items; + var entity_groups = this.entity_groups; + var i, j; + var item; + var meta = this.meta; + if (meta === null || meta === undefined) return; + if (meta.hdlr === undefined) return; + if (meta.iinf === undefined) return; + for (i = 0; i < meta.iinf.item_infos.length; i++) { + item = {}; + item.id = meta.iinf.item_infos[i].item_ID; + items[item.id] = item; + item.ref_to = []; + item.name = meta.iinf.item_infos[i].item_name; + if (meta.iinf.item_infos[i].protection_index > 0) { + item.protection = meta.ipro.protections[meta.iinf.item_infos[i].protection_index-1]; + } + if (meta.iinf.item_infos[i].item_type) { + item.type = meta.iinf.item_infos[i].item_type; + } else { + item.type = "mime"; + } + item.content_type = meta.iinf.item_infos[i].content_type; + item.content_encoding = meta.iinf.item_infos[i].content_encoding; + item.item_uri_type = meta.iinf.item_infos[i].item_uri_type; + } + if (meta.grpl) { + for (i = 0; i < meta.grpl.boxes.length; i++) { + entity_group = {}; + entity_group.id = meta.grpl.boxes[i].group_id; + entity_group.entity_ids = meta.grpl.boxes[i].entity_ids; + entity_group.type = meta.grpl.boxes[i].type; + entity_groups[entity_group.id] = entity_group; + } + } + if (meta.iloc) { + for(i = 0; i < meta.iloc.items.length; i++) { + var offset; + var itemloc = meta.iloc.items[i]; + item = items[itemloc.item_ID]; + if (itemloc.data_reference_index !== 0) { + Log.warn("Item storage with reference to other files: not supported"); + item.source = meta.dinf.boxes[itemloc.data_reference_index-1]; + } + switch(itemloc.construction_method) { + case 0: // offset into the file referenced by the data reference index + break; + case 1: // offset into the idat box of this meta box + break; + case 2: // offset into another item + Log.warn("Item storage with construction_method : not supported"); + break; + } + item.extents = []; + item.size = 0; + for (j = 0; j < itemloc.extents.length; j++) { + item.extents[j] = {}; + item.extents[j].offset = itemloc.extents[j].extent_offset + itemloc.base_offset; + if (itemloc.construction_method == 1) { + item.extents[j].offset += meta.idat.start + meta.idat.hdr_size; + } + item.extents[j].length = itemloc.extents[j].extent_length; + item.extents[j].alreadyRead = 0; + item.size += item.extents[j].length; + } + } + } + if (meta.pitm) { + items[meta.pitm.item_id].primary = true; + } + if (meta.iref) { + for (i=0; i 0 && propEntry.property_index-1 < meta.iprp.ipco.boxes.length) { + var propbox = meta.iprp.ipco.boxes[propEntry.property_index-1]; + item.properties[propbox.type] = propbox; + item.properties.boxes.push(propbox); + } + } + } + } + } + } +} + +ISOFile.prototype.getItem = function(item_id) { + var buffer; + var item; + + if (!this.meta) { + return null; + } + + item = this.items[item_id]; + if (!item.data && item.size) { + /* Not yet fetched */ + item.data = new Uint8Array(item.size); + item.alreadyRead = 0; + this.itemsDataSize += item.size; + Log.debug("ISOFile", "Allocating item #"+item_id+" of size "+item.size+" (total: "+this.itemsDataSize+")"); + } else if (item.alreadyRead === item.size) { + /* Already fetched entirely */ + return item; + } + + /* The item has only been partially fetched, we need to check in all buffers to find the remaining extents*/ + + for (var i = 0; i < item.extents.length; i++) { + var extent = item.extents[i]; + if (extent.alreadyRead === extent.length) { + continue; + } else { + var index = this.stream.findPosition(true, extent.offset + extent.alreadyRead, false); + if (index > -1) { + buffer = this.stream.buffers[index]; + var lengthAfterStart = buffer.byteLength - (extent.offset + extent.alreadyRead - buffer.fileStart); + if (extent.length - extent.alreadyRead <= lengthAfterStart) { + /* the (rest of the) extent is entirely contained in this buffer */ + + Log.debug("ISOFile","Getting item #"+item_id+" extent #"+i+" data (alreadyRead: "+extent.alreadyRead+ + " offset: "+(extent.offset+extent.alreadyRead - buffer.fileStart)+" read size: "+(extent.length - extent.alreadyRead)+ + " full extent size: "+extent.length+" full item size: "+item.size+")"); + + DataStream.memcpy(item.data.buffer, item.alreadyRead, + buffer, extent.offset+extent.alreadyRead - buffer.fileStart, extent.length - extent.alreadyRead); + + /* update the number of bytes used in this buffer and check if it needs to be removed */ + buffer.usedBytes += extent.length - extent.alreadyRead; + this.stream.logBufferLevel(); + + item.alreadyRead += (extent.length - extent.alreadyRead); + extent.alreadyRead = extent.length; + } else { + /* the sample does not end in this buffer */ + + Log.debug("ISOFile","Getting item #"+item_id+" extent #"+i+" partial data (alreadyRead: "+extent.alreadyRead+" offset: "+ + (extent.offset+extent.alreadyRead - buffer.fileStart)+" read size: "+lengthAfterStart+ + " full extent size: "+extent.length+" full item size: "+item.size+")"); + + DataStream.memcpy(item.data.buffer, item.alreadyRead, + buffer, extent.offset+extent.alreadyRead - buffer.fileStart, lengthAfterStart); + extent.alreadyRead += lengthAfterStart; + item.alreadyRead += lengthAfterStart; + + /* update the number of bytes used in this buffer and check if it needs to be removed */ + buffer.usedBytes += lengthAfterStart; + this.stream.logBufferLevel(); + return null; + } + } else { + return null; + } + } + } + if (item.alreadyRead === item.size) { + /* fetched entirely */ + return item; + } else { + return null; + } +} + +/* Release the memory used to store the data of the item */ +ISOFile.prototype.releaseItem = function(item_id) { + var item = this.items[item_id]; + if (item.data) { + this.itemsDataSize -= item.size; + item.data = null; + item.alreadyRead = 0; + for (var i = 0; i < item.extents.length; i++) { + var extent = item.extents[i]; + extent.alreadyRead = 0; + } + return item.size; + } else { + return 0; + } +} + + +ISOFile.prototype.processItems = function(callback) { + for(var i in this.items) { + var item = this.items[i]; + this.getItem(item.id); + if (callback && !item.sent) { + callback(item); + item.sent = true; + item.data = null; + } + } +} + +ISOFile.prototype.hasItem = function(name) { + for(var i in this.items) { + var item = this.items[i]; + if (item.name === name) { + return item.id; + } + } + return -1; +} + +ISOFile.prototype.getMetaHandler = function() { + if (!this.meta) { + return null; + } else { + return this.meta.hdlr.handler; + } +} + +ISOFile.prototype.getPrimaryItem = function() { + if (!this.meta || !this.meta.pitm) { + return null; + } else { + return this.getItem(this.meta.pitm.item_id); + } +} + +ISOFile.prototype.itemToFragmentedTrackFile = function(_options) { + var options = _options || {}; + var item = null; + if (options.itemId) { + item = this.getItem(options.itemId); + } else { + item = this.getPrimaryItem(); + } + if (item == null) return null; + + var file = new ISOFile(); + file.discardMdatData = false; + // assuming the track type is the same as the item type + var trackOptions = { type: item.type, description_boxes: item.properties.boxes}; + if (item.properties.ispe) { + trackOptions.width = item.properties.ispe.image_width; + trackOptions.height = item.properties.ispe.image_height; + } + var trackId = file.addTrack(trackOptions); + if (trackId) { + file.addSample(trackId, item.data); + return file; + } else { + return null; + } +} + +// file:src/isofile-write.js +/* Rewrite the entire file */ +ISOFile.prototype.write = function(outstream) { + for (var i=0; i0 ? this.moov.traks[i].samples[0].duration: 0)); + initSegs.push(seg); + } + return initSegs; +} + +// file:src/box-print.js +/* + * Copyright (c) Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +BoxParser.Box.prototype.printHeader = function(output) { + this.size += 8; + if (this.size > MAX_SIZE) { + this.size += 8; + } + if (this.type === "uuid") { + this.size += 16; + } + output.log(output.indent+"size:"+this.size); + output.log(output.indent+"type:"+this.type); +} + +BoxParser.FullBox.prototype.printHeader = function(output) { + this.size += 4; + BoxParser.Box.prototype.printHeader.call(this, output); + output.log(output.indent+"version:"+this.version); + output.log(output.indent+"flags:"+this.flags); +} + +BoxParser.Box.prototype.print = function(output) { + this.printHeader(output); +} + +BoxParser.ContainerBox.prototype.print = function(output) { + this.printHeader(output); + for (var i=0; i>8)); + output.log(output.indent+"matrix: "+this.matrix.join(", ")); + output.log(output.indent+"next_track_id: "+this.next_track_id); +} + +BoxParser.tkhdBox.prototype.print = function(output) { + BoxParser.FullBox.prototype.printHeader.call(this, output); + output.log(output.indent+"creation_time: "+this.creation_time); + output.log(output.indent+"modification_time: "+this.modification_time); + output.log(output.indent+"track_id: "+this.track_id); + output.log(output.indent+"duration: "+this.duration); + output.log(output.indent+"volume: "+(this.volume>>8)); + output.log(output.indent+"matrix: "+this.matrix.join(", ")); + output.log(output.indent+"layer: "+this.layer); + output.log(output.indent+"alternate_group: "+this.alternate_group); + output.log(output.indent+"width: "+this.width); + output.log(output.indent+"height: "+this.height); +}// file:src/mp4box.js +/* + * Copyright (c) 2012-2013. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato + * License: BSD-3-Clause (see LICENSE file) + */ +var MP4Box = {}; + +MP4Box.createFile = function (_keepMdatData, _stream) { + /* Boolean indicating if bytes containing media data should be kept in memory */ + var keepMdatData = (_keepMdatData !== undefined ? _keepMdatData : true); + var file = new ISOFile(_stream); + file.discardMdatData = (keepMdatData ? false : true); + return file; +} + +if (typeof exports !== 'undefined') { + exports.createFile = MP4Box.createFile; +} diff --git a/public/worker/webgl2d.js b/public/worker/webgl2d.js new file mode 100644 index 0000000..6120cc1 --- /dev/null +++ b/public/worker/webgl2d.js @@ -0,0 +1,300 @@ +class WebGL2D { + constructor(canvas) { + this.canvas = canvas; + this.gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + + if (!this.gl) { + throw new Error('WebGL not supported'); + } + + // 状态管理 + this.stateStack = []; + this.currentState = { + transform: [1, 0, 0, 1, 0, 0], // 2D变换矩阵 [a, b, c, d, tx, ty] + fillStyle: '#000000', + globalAlpha: 1.0, + }; + + // 初始化WebGL + this._initShaders(); + this._initBuffers(); + this._resizeCanvas(); + + // 默认设置 + this.gl.clearColor(1, 1, 1, 1); + this.gl.enable(this.gl.BLEND); + this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA); + + // window.addEventListener('resize', () => this._resizeCanvas()); + } + + // ========== 初始化方法 ========== + _initShaders() { + // 顶点着色器 + const vertexShaderSource = ` + attribute vec2 a_position; + attribute vec2 a_texCoord; + uniform mat3 u_transform; + varying vec2 v_texCoord; + + void main() { + vec3 pos = u_transform * vec3(a_position, 1); + gl_Position = vec4(pos.xy, 0, 1); + v_texCoord = a_texCoord; + } + `; + + // 片段着色器 + const fragmentShaderSource = ` + precision mediump float; + varying vec2 v_texCoord; + uniform vec4 u_color; + uniform sampler2D u_image; + uniform bool u_useTexture; + uniform float u_globalAlpha; + + void main() { + if (u_useTexture) { + gl_FragColor = texture2D(u_image, v_texCoord) * u_globalAlpha; + } else { + gl_FragColor = u_color * u_globalAlpha; + } + } + `; + + this.program = this._createProgram(vertexShaderSource, fragmentShaderSource); + this.gl.useProgram(this.program); + + // 获取uniform和attribute位置 + this.uniformLocations = { + transform: this.gl.getUniformLocation(this.program, 'u_transform'), + color: this.gl.getUniformLocation(this.program, 'u_color'), + useTexture: this.gl.getUniformLocation(this.program, 'u_useTexture'), + image: this.gl.getUniformLocation(this.program, 'u_image'), + globalAlpha: this.gl.getUniformLocation(this.program, 'u_globalAlpha'), + }; + + this.attribLocations = { + position: this.gl.getAttribLocation(this.program, 'a_position'), + texCoord: this.gl.getAttribLocation(this.program, 'a_texCoord'), + }; + } + + _createProgram(vsSource, fsSource) { + const gl = this.gl; + + const vertexShader = this._compileShader(gl.VERTEX_SHADER, vsSource); + const fragmentShader = this._compileShader(gl.FRAGMENT_SHADER, fsSource); + + const program = gl.createProgram(); + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + gl.linkProgram(program); + + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + throw new Error('Program link error: ' + gl.getProgramInfoLog(program)); + } + + return program; + } + + _compileShader(type, source) { + const gl = this.gl; + const shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + const error = gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + throw new Error('Shader compile error: ' + error); + } + + return shader; + } + + _initBuffers() { + const gl = this.gl; + + // 位置缓冲区 + this.positionBuffer = gl.createBuffer(); + + // 纹理坐标缓冲区 + this.texCoordBuffer = gl.createBuffer(); + + // 索引缓冲区(用于绘制两个三角形组成矩形) + this.indexBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 2, 3]), gl.STATIC_DRAW); + } + + _resizeCanvas() { + // const devicePixelRatio = 1; // window.devicePixelRatio || 1; + // this.canvas.width = this.canvas.width * devicePixelRatio; + // this.canvas.height = this.canvas.height * devicePixelRatio; + this.gl.viewport(0, 0, this.canvas.width, this.canvas.height); + } + + // ========== 公共API方法 ========== + save() { + // 深拷贝当前状态 + this.stateStack.push({ + transform: [...this.currentState.transform], + fillStyle: this.currentState.fillStyle, + globalAlpha: this.currentState.globalAlpha, + }); + } + + restore() { + if (this.stateStack.length > 0) { + this.currentState = this.stateStack.pop(); + } + } + + translate(x, y) { + const [a, b, c, d, tx, ty] = this.currentState.transform; + this.currentState.transform = [a, b, c, d, tx + x, ty + y]; + } + + rotate(angle) { + const cos = Math.cos(angle); + const sin = Math.sin(angle); + const [a, b, c, d, tx, ty] = this.currentState.transform; + + this.currentState.transform = [a * cos + c * sin, b * cos + d * sin, c * cos - a * sin, d * cos - b * sin, tx, ty]; + } + + set fillStyle(color) { + this.currentState.fillStyle = color; + } + + get fillStyle() { + return this.currentState.fillStyle; + } + + set globalAlpha(alpha) { + this.currentState.globalAlpha = alpha; + } + + get globalAlpha() { + return this.currentState.globalAlpha; + } + + clear() { + this.gl.clear(this.gl.COLOR_BUFFER_BIT); + } + + fillRect(x, y, width, height) { + const gl = this.gl; + + // 设置顶点数据 + const positions = new Float32Array([x, y, x + width, y, x, y + height, x + width, y + height]); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer); + gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW); + + // 设置纹理坐标(虽然不使用纹理,但着色器需要) + const texCoords = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.texCoordBuffer); + gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW); + + // 设置uniform + this._updateTransform(); + this._updateColor(); + gl.uniform1i(this.uniformLocations.useTexture, false); + gl.uniform1f(this.uniformLocations.globalAlpha, this.currentState.globalAlpha); + + // 绘制 + this._drawElements(); + } + + async drawImage(image, dx, dy, dWidth, dHeight) { + const gl = this.gl; + + // 创建纹理(如果尚未创建) + if (!this.texture) { + this.texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + } + image = await createImageBitmap(image); + console.log('image.format', image); + + // 上传图像数据到纹理 + gl.bindTexture(gl.TEXTURE_2D, this.texture); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); + + // 设置顶点数据 + const positions = new Float32Array([dx, dy, dx + dWidth, dy, dx, dy + dHeight, dx + dWidth, dy + dHeight]); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer); + gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW); + + // 设置纹理坐标 + const texCoords = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.texCoordBuffer); + gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW); + + // 设置uniform + this._updateTransform(); + gl.uniform1i(this.uniformLocations.useTexture, true); + gl.uniform1f(this.uniformLocations.globalAlpha, this.currentState.globalAlpha); + + // 绘制 + this._drawElements(); + } + + // ========== 辅助方法 ========== + _updateTransform() { + const [a, b, c, d, tx, ty] = this.currentState.transform; + const transformMatrix = new Float32Array([a, c, tx, b, d, ty, 0, 0, 1]); + + this.gl.uniformMatrix3fv(this.uniformLocations.transform, false, transformMatrix); + } + + _updateColor() { + const color = this._hexToRgb(this.currentState.fillStyle); + this.gl.uniform4f(this.uniformLocations.color, color.r, color.g, color.b, 1.0); + } + + _drawElements() { + const gl = this.gl; + + // 启用属性 + gl.enableVertexAttribArray(this.attribLocations.position); + gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer); + gl.vertexAttribPointer(this.attribLocations.position, 2, gl.FLOAT, false, 0, 0); + + gl.enableVertexAttribArray(this.attribLocations.texCoord); + gl.bindBuffer(gl.ARRAY_BUFFER, this.texCoordBuffer); + gl.vertexAttribPointer(this.attribLocations.texCoord, 2, gl.FLOAT, false, 0, 0); + + // 绘制 + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); + gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); + } + + _hexToRgb(hex) { + // 移除#号 + hex = hex.replace('#', ''); + + // 处理缩写形式如 #FFF + if (hex.length === 3) { + hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; + } + + // 解析RGB值并归一化到0-1范围 + const bigint = parseInt(hex, 16); + return { + r: ((bigint >> 16) & 255) / 255, + g: ((bigint >> 8) & 255) / 255, + b: (bigint & 255) / 255, + }; + } +} diff --git a/src/App.module.less b/src/App.module.less new file mode 100644 index 0000000..e69de29 diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..44f803f --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,42 @@ +import './theme/theme.less'; +import React, { useEffect, useRef } from 'react'; +import { userService } from '@server/index'; +import { util } from '@utils/index'; +import { config } from '@config/index'; +import { renderRoutes } from 'react-router-config'; +import { user } from '@stores/user'; + +interface AppProps { + Router: any; + routes: any; + location?: any; + context?: any; +} + +function App(props: AppProps) { + const { Router, routes, ...otherProps } = props; + const routerRef = useRef(null); + + // URL token 自动登录 + useEffect(() => { + let token: any = util.getUrlQuery('token'); + if (token) { + window.history.pushState(null, '', util.delUrlParam('token')); + token = decodeURI(token); + user.setToken(token); + } + if (token) { + userService._setRqHeaderToken(token); + userService.getUserDetail(); + } + (window as any).RouterHistory = routerRef.current?.history; + }, []); + + return ( + + {renderRoutes(routes)} + + ); +} + +export default App; diff --git a/src/assets/images/login/loginBg.png b/src/assets/images/login/loginBg.png new file mode 100644 index 0000000..3b46669 Binary files /dev/null and b/src/assets/images/login/loginBg.png differ diff --git a/src/assets/images/logo-h5.png b/src/assets/images/logo-h5.png new file mode 100644 index 0000000..03e8ad7 Binary files /dev/null and b/src/assets/images/logo-h5.png differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..5fa83b1 Binary files /dev/null and b/src/assets/images/logo.png differ diff --git a/src/assets/images/logo1.png b/src/assets/images/logo1.png new file mode 100644 index 0000000..d4edbce Binary files /dev/null and b/src/assets/images/logo1.png differ diff --git a/src/assets/images/logo2.png b/src/assets/images/logo2.png new file mode 100644 index 0000000..4b21482 Binary files /dev/null and b/src/assets/images/logo2.png differ diff --git a/src/assets/images/logo_1.png b/src/assets/images/logo_1.png new file mode 100644 index 0000000..f12b2b8 Binary files /dev/null and b/src/assets/images/logo_1.png differ diff --git a/src/assets/images/logo_10.png b/src/assets/images/logo_10.png new file mode 100644 index 0000000..a3a99ff Binary files /dev/null and b/src/assets/images/logo_10.png differ diff --git a/src/assets/images/logo_11.png b/src/assets/images/logo_11.png new file mode 100644 index 0000000..843ada5 Binary files /dev/null and b/src/assets/images/logo_11.png differ diff --git a/src/assets/images/logo_12.png b/src/assets/images/logo_12.png new file mode 100644 index 0000000..21e33b8 Binary files /dev/null and b/src/assets/images/logo_12.png differ diff --git a/src/assets/images/logo_13.png b/src/assets/images/logo_13.png new file mode 100644 index 0000000..5f03bb8 Binary files /dev/null and b/src/assets/images/logo_13.png differ diff --git a/src/assets/images/logo_14.png b/src/assets/images/logo_14.png new file mode 100644 index 0000000..10943cd Binary files /dev/null and b/src/assets/images/logo_14.png differ diff --git a/src/assets/images/logo_2.png b/src/assets/images/logo_2.png new file mode 100644 index 0000000..c009cce Binary files /dev/null and b/src/assets/images/logo_2.png differ diff --git a/src/assets/images/logo_3.png b/src/assets/images/logo_3.png new file mode 100644 index 0000000..0a59bfc Binary files /dev/null and b/src/assets/images/logo_3.png differ diff --git a/src/assets/images/logo_4.png b/src/assets/images/logo_4.png new file mode 100644 index 0000000..efecf7d Binary files /dev/null and b/src/assets/images/logo_4.png differ diff --git a/src/assets/images/logo_5.png b/src/assets/images/logo_5.png new file mode 100644 index 0000000..1c249c9 Binary files /dev/null and b/src/assets/images/logo_5.png differ diff --git a/src/assets/images/logo_6.png b/src/assets/images/logo_6.png new file mode 100644 index 0000000..e33ad11 Binary files /dev/null and b/src/assets/images/logo_6.png differ diff --git a/src/assets/images/logo_7.png b/src/assets/images/logo_7.png new file mode 100644 index 0000000..57fbf27 Binary files /dev/null and b/src/assets/images/logo_7.png differ diff --git a/src/assets/images/logo_8.png b/src/assets/images/logo_8.png new file mode 100644 index 0000000..1e1a779 Binary files /dev/null and b/src/assets/images/logo_8.png differ diff --git a/src/assets/images/logo_9.png b/src/assets/images/logo_9.png new file mode 100644 index 0000000..809b9c7 Binary files /dev/null and b/src/assets/images/logo_9.png differ diff --git a/src/assets/images/matcap-porcelain-white.jpg b/src/assets/images/matcap-porcelain-white.jpg new file mode 100644 index 0000000..761f86d Binary files /dev/null and b/src/assets/images/matcap-porcelain-white.jpg differ diff --git a/src/assets/images/mv.png b/src/assets/images/mv.png new file mode 100644 index 0000000..8281d28 Binary files /dev/null and b/src/assets/images/mv.png differ diff --git a/src/assets/images/user/alipay.png b/src/assets/images/user/alipay.png new file mode 100644 index 0000000..337bf1b Binary files /dev/null and b/src/assets/images/user/alipay.png differ diff --git a/src/assets/images/user/avatar.png b/src/assets/images/user/avatar.png new file mode 100644 index 0000000..fa1ecf3 Binary files /dev/null and b/src/assets/images/user/avatar.png differ diff --git a/src/assets/images/user/weChat.png b/src/assets/images/user/weChat.png new file mode 100644 index 0000000..2897a5a Binary files /dev/null and b/src/assets/images/user/weChat.png differ diff --git a/src/components/audio/AudioItem.tsx b/src/components/audio/AudioItem.tsx new file mode 100644 index 0000000..ee39a60 --- /dev/null +++ b/src/components/audio/AudioItem.tsx @@ -0,0 +1,90 @@ +import { observer } from 'mobx-react'; +import styles from './audio.module.less'; +import { audios } from '@stores/audios'; +import { useReducer, useRef, useState } from 'react'; +import { Play, PauseOne } from '@icon-park/react'; +import $ from 'jquery'; +import { util } from '@utils/index'; +import classNames from 'classnames'; + +export interface IProps { + item: any; + noName?: boolean; +} + +function AudioItem(props: IProps) { + const [, forceUpdate] = useReducer(x => x + 1, 0); + const item = props.item; + const ref = useRef(); + const [x, setX] = useState(0); + audios.progress; + + const isActive = audios.selectedId === item.id; + + const [name, ext] = item.name.split('.'); + return ( +
{ + audios.setProgress(x); + }} + onMouseEnter={(e: any) => { + if (isActive) { + const offset = $(ref.current).offset(); + const width = $(ref.current).width(); + setX((e.pageX - offset.left) / width); + $(ref.current).on('mousemove', em => { + setX((em.pageX - offset.left) / width); + }); + } + }} + onMouseLeave={e => { + if (isActive) { + $(ref.current).off('mousemove'); + setX(0); + } + }} + > + { + e.stopPropagation(); + audios.duration = item.attrs.duration; + if (audios.selectedId === item.id) { + if (!audios.selectedId) { + audios.selectedId = item.id; + audios.audioURL = item.urls.url; + audios.play(); + } else { + audios.stop(); + } + } else { + audios.pause(); + audios.selectedId = item.id; + audios.audioURL = item.urls.url; + audios.play(); + } + forceUpdate(); + }} + > + {isActive ? ( + + ) : ( + + )} + +
+ {!props.noName && ( + + {name.length > 10 ? name.substr(0, 10) + '...' : name} + {ext} + + )} +
+ {isActive && } + {isActive && !!x && } +
+ ); +} +export default observer(AudioItem); diff --git a/src/components/audio/audio.module.less b/src/components/audio/audio.module.less new file mode 100644 index 0000000..e4130d0 --- /dev/null +++ b/src/components/audio/audio.module.less @@ -0,0 +1,77 @@ +.audioItem { + position: relative; + width: 100%; + height: 100%; + color: var(--theme-text); + font-size: 12px; + overflow: hidden; + text-align: center; + // display: flex; + // height: 54px; + + .right { + position: relative; + z-index: 10; + :global { + .semi-slider-handle { + width: 10px; + height: 10px; + margin-top: 10px; + display: none; + } + .semi-slider-rail { + height: 3px; + } + .semi-slider-track { + height: 3px; + background: rgba(0, 255, 132, 1); + } + } + } + .btn { + display: inline-block; + margin-top: 20px; + margin-bottom: 5px; + position: relative; + z-index: 10; + } + .name, + .time { + display: block; + } + .time { + margin-top: 5px; + opacity: 0.5; + } + + .ext { + display: inline-block; + padding: 1px 3px; + margin-left: 5px; + border-radius: 4px; + font-size: 12px; + color: #fff; + background: linear-gradient(30deg, #00e9fa 0%, #007bff 50%, #bb00fa 100%); + } + + .progress { + position: absolute; + z-index: 0; + background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 255, 132, 0.3)); + top: 0; + left: 0; + height: 100%; + width: 0; + } + + .line { + width: 1px; + opacity: 0.8; + background-color: var(--theme-text); + position: absolute; + top: 0; + z-index: 30; + height: 100%; + pointer-events: none; + } +} diff --git a/src/components/content-user/ContentUser.tsx b/src/components/content-user/ContentUser.tsx new file mode 100644 index 0000000..161b4f3 --- /dev/null +++ b/src/components/content-user/ContentUser.tsx @@ -0,0 +1,18 @@ +import styles from './styles.module.less'; +export interface IProps { + title: string; + children?: JSX.Element; +} + +function ContentUser(props: IProps) { + return ( +
+
+

{props.title}

+
+
{props.children}
+
+ ); +} + +export default ContentUser; diff --git a/src/components/content-user/index.ts b/src/components/content-user/index.ts new file mode 100644 index 0000000..8197080 --- /dev/null +++ b/src/components/content-user/index.ts @@ -0,0 +1,3 @@ +import ContentUser from './ContentUser'; + +export default ContentUser; diff --git a/src/components/content-user/styles.module.less b/src/components/content-user/styles.module.less new file mode 100644 index 0000000..6821f31 --- /dev/null +++ b/src/components/content-user/styles.module.less @@ -0,0 +1,20 @@ +.content { + margin: 30px; + + .title { + display: flex; + align-items: center; + justify-content: space-between; + color: var(--theme-text); + + h1 { + font-size: 24px; + font-weight: bolder; + align-items: center; + } + } + + .contents { + margin-top: 20px; + } +} diff --git a/src/components/content/Content.tsx b/src/components/content/Content.tsx new file mode 100644 index 0000000..e3e9e17 --- /dev/null +++ b/src/components/content/Content.tsx @@ -0,0 +1,688 @@ +import styles from './content.module.less'; +import { Button, Space, Toast, Upload, Pagination, Modal } from '@douyinfe/semi-ui'; +import SourceList from './SourceList'; +import { observer } from 'mobx-react'; +import { layout } from '@stores/layout'; +import { useReducer, useState, useRef, useCallback, useEffect, useImperativeHandle, forwardRef } from 'react'; +import { userService } from '@server/user.service'; +import Folders from './Folders'; +import { pubsub } from '@utils/pubsub'; +import { util } from '@utils/index'; +import _remove from 'lodash/remove'; +import { FailPicture, Right, Scissors, Upload as UploadIcon } from '@icon-park/react'; +import { Link } from 'react-router-dom'; +import SelectedSet from './SelectedSet'; +import { user } from '@stores/user'; +import { uploadInfo } from '@utils/uploadInfo.es.js'; +import { language } from '@language/language'; +import { config } from '@config/index'; +import VideoSplit from './video-split/VideoSplit'; +import PictureSplit from './picture-split/PictureSplit'; +import { + isFSApiSupported, + getRootHandle, + getLocalCategoryList, + createLocalCategory, +} from '@services/localStorageService'; + +export interface IProps { + item: (a: any) => JSX.Element; + itemClassName: string; + itemWidth: number; + type: 'draft' | 'material'; // 类型 + title: string | JSX.Element; // 标题 + subTitle?: JSX.Element; + getListServer: (n: any) => Promise<[any, boolean]>; // 获取素材的回调 + seekItemStatus?: (ids: string[]) => Promise; // seekItemStatus的回调 + categoryId: string; + contentHeight?: number; // 内容高度 + categoryName: string; + catesCallback: (cates: any[]) => void; + moveCallBack: (cid: string, ids: string[]) => void; // 移动元素的回调 + createUserMaterial?: (params: { + category_id?: string; // 直接创建到该分类下面 + name: string; + urls: Record; + attrs: Record; + size?: number; + convert_status?: number; + }) => Promise<[any, boolean]>; +} + +export interface UploadItem { + id: string; + status: 'ready' | 'uploadStart' | 'uploading' | 'decoding' | 'uploaded'; + progress: number; // 当前进度 + type?: string; // 文件类型 + name?: string; + size?: number; // 文件大小 + thumb?: string; // 缩图 + naturalHeight?: number; // 图片真实尺寸 + naturalWidth?: number; + duration?: number; // 时长 + // 视频相关 + rotate?: boolean; // 视频是否旋转了 + hasAudioTrack?: boolean; // 视频是否有声音 + videoWidth?: number; // 视频真实尺寸 + videoHeight?: number; + wave?: string; // 音波json数据 + frames?: string; // 1s单位的帧图 +} + +function Content(props: IProps, ref: any) { + const [, forceUpdate] = useReducer(x => x + 1, 0); + const [cates, setCates] = useState([]); + const [useLocal, setUseLocal] = useState(false); + const timer = useRef(null); + const totalRef = useRef(0); + const [showVideoSplit, setShowVideoSplit] = useState(false); + const [showImageSplit, setShowImageSplit] = useState(false); + const params = useRef({ + page: 1, + page_size: 100, + keyword: '', + category_id: props.categoryId || '0', + }); + // 使用ref存储items避免轮询时的闭包问题 + const itemsRef = useRef(null); + // 缓存info数据 + const cacheInfoData = useRef>({}); + + // item中convert_status 状态(-1无需处理,0-待处理 1-处理中 2-处理成功 3-处理失败) + // 0,1 编码中 + // 2 编码成功 + // 3 编码失败 + // 如果状态是0和1轮训,并且修改item.status.decoding,直到状态是2或3,修改item.status为uploaded或error。 + const seekItemStatus = useCallback( + async ids => { + if (!itemsRef.current) { + return; + } + if (!props.seekItemStatus) { + return; + } + if (ids.length === 0) { + forceUpdate(); + return; + } + const [res, err] = await props.seekItemStatus(ids); + if (err) { + return Toast.error(err); + } + + // 更新itemsRef中的数据 + const currentItems = itemsRef.current; + res.forEach(d => { + const item = currentItems.find(item => item.id === d.source_id); + if (item) { + item.convert_status = d.status; + } + }); + // 同步更新state + itemsRef.current = [...currentItems]; + forceUpdate(); + + // 继续轮询需要处理的项 + const idArr = res + .map(d => { + if ([0, 1].includes(d.status)) { + return d.source_id; + } + return null; + }) + .filter(d => d !== null); + + if (idArr.length > 0) { + timer.current = setTimeout(() => { + seekItemStatus(idArr); + }, 1000); + } else { + timer.current = null; + } + }, + [props.seekItemStatus], + ); + + // ref暴露getList方法 + useImperativeHandle(ref, () => ({ + getList, + })); + + // 获取素材 + const getList = async itemsArr => { + // 清理之前的轮询 + if (timer.current) { + clearTimeout(timer.current); + timer.current = null; + } + + const { list, total } = await getItems(props.type, params.current, props.getListServer); + totalRef.current = total; + + console.log(list, total, 'list.length-------------------------'); + + // 同步更新ref和state + itemsRef.current = [...list]; + forceUpdate(); + + // 开始轮询状态变化 + const pendingIds = list + .map(d => { + if ([0, 1].includes(d.convert_status)) { + return d.id; + } + return null; + }) + .filter(d => d !== null); + + if (pendingIds.length > 0) { + seekItemStatus(pendingIds); + } + }; + + // 检测本地存储模式 + useEffect(() => { + if (isFSApiSupported()) { + getRootHandle().then(handle => setUseLocal(!!handle)); + } + }, []); + + // 获取全部分类 + const getCategoryList = useCallback(() => { + const t = props.type === 'draft' ? 'project' : 'material'; + if (useLocal) { + getLocalCategoryList(t as 'project' | 'material').then(resp => { + const [res, err] = resp; + if (err) { + return Toast.error(err); + } else { + setCates(res.data); + props.catesCallback(res.data); + } + }); + } else { + userService.getCategoryList({ type: t, page: 1, page_size: 100 }).then(resp => { + const [res, err] = resp; + if (err) { + return Toast.error(err); + } else { + setCates(res.data); + props.catesCallback(res.data); + } + }); + } + }, [useLocal]); + + useEffect(() => { + getCategoryList(); + getList([]); + + return () => { + layout.cancelSelected(); + if (timer.current) { + clearTimeout(timer.current); + } + timer.current = null; + }; + }, []); + + // 显示上传中的信息 + const uploadList = Object.values(cacheInfoData.current) + .map(d => { + return { + id: d.id, + name: d.name, + type: d.type, + urls: { thumb: d.thumb }, + attrs: { + width: d.naturalWidth || d.videoWidth || 200, + height: d.naturalHeight || d.videoHeight || 180, + }, + status: d.status, + progress: d.progress, + }; + }) + .filter(d => { + return d.status !== 'uploaded'; + }); + // console.log(layout.openSelectManage, items, cates, 'layout.openSelectManage, items, cates'); + + return ( +
+
+

+ {props.title} + + + {language.val('common_all')} + + {props.categoryName ? ( + <> + + {props.categoryName} + + ) : null} + +

+ {layout.openSelectManage && (cates?.length || itemsRef.current?.length) ? ( + { + const [_items] = params; + itemsRef.current = [..._items]; + forceUpdate(); + }} + /> + ) : null} + + {props.type === 'material' && ( + <> + + + + )} + {props.type === 'material' && ( + { + console.log(v.file, 'v.file'); + + const ftype = v.file.fileInstance.type.split('/')[0]; + + let thumb = ftype === 'image' ? v.file.url : ''; + if (ftype === 'image') { + const base64 = (await util.blobURL2Data(v.file.url as any)) as string; + const thumbBase64 = (await util.resizeBase64Image(base64, 300)) as string; + const [res] = await userService.uploadBase64({ + content: thumbBase64, + name: v.file.name, + file_type: 'image', + }); + thumb = res.storage_path; + } + + cacheInfoData.current[v.file.name] = { + id: v.file.uid, + progress: 0, + status: 'ready', + thumb, + type: v.file.fileInstance.type, + size: v.file.fileInstance.size, + name: v.file.name, + }; + forceUpdate(); + + // console.log( + // v.file, + // 'v.file.?????', + // util.getFileTypeByURL('', v.file.name.split('.').pop().toLowerCase()), + // ); + // 获取blob url + const info = await uploadInfo.getUploadBeforeData({ + url: v.file.url, + type: util.getFileTypeByURL('', v.file.name.split('.').pop().toLowerCase()), + uploadBase64: userService.uploadBase64, + }); + + Object.assign(cacheInfoData.current[v.file.name], { + ...info, + status: 'uploadStart', + progress: 0, + desc: '', + }); + forceUpdate(); + + // 异步执行openaiImageDesc,不阻塞上传业务 + if (['video', 'image'].includes(ftype)) { + (async () => { + try { + if (cacheInfoData.current[v.file.name]) { + //@ts-ignore + cacheInfoData.current[v.file.name].descWaiting = true; + } + let base64 = ''; + if (ftype === 'video') { + const res = (await uploadInfo.decoderVideoDrawFrameImage({ + url: v.file.url, + aspectRatio: info.videoWidth / info.videoHeight, + audioTrack: null, + videoRotation: info.rotate ? 90 : 0, + frameScale: 10, + duration: info.duration, + workerPath: '/assets/worker', + })) as any; + console.log(res, info, 'res--------->'); + base64 = await util.blobUrlToBase64(res.url); + + // base64 缩小5倍,frameScale刚好是2 + const _img = await util.imgLazy(base64); + const base642 = await util.resizeBase64Image(base64, _img.naturalWidth / 5); + // 上传到资源服务器 + const [res2] = await userService.uploadBase64({ + content: base642, + name: util.randomID() + '.png', + file_type: 'image', + }); + console.log(res2, 'res2'); + // 更新cacheInfoData + cacheInfoData.current[v.file.name].frames = res2.storage_path; + } else { + base64 = util.reURL(thumb, config.resourcesHost); + } + const [res3] = await userService.openaiImageDesc([ + { + role: 'user', + content: [ + { + type: 'image_url', + image_url: util.reURL(base64, config.resourcesHost), + }, + { + type: 'text', + text: + ftype === 'video' + ? '这是一组1秒/帧的视频帧图,请一句话描述一下视频内容:视频展示了...' + : '这是一张图片,请一句话描述一下图片内容', + }, + ], + }, + ]); + + if (cacheInfoData.current[v.file.name]) { + //@ts-ignore + cacheInfoData.current[v.file.name].desc = res3?.choices?.[0]?.message?.content || ''; + // 描述生成完成,更新状态 + //@ts-ignore + cacheInfoData.current[v.file.name].descWaiting = false; + forceUpdate(); + } + } catch (error) { + console.error('openaiImageDesc执行失败:', error); + // 描述生成失败,更新状态 + //@ts-ignore + cacheInfoData.current[v.file.name].descWaiting = false; + } + })(); + } + + return { + shouldUpload: true, + status: 'success', + }; + }} + onProgress={(p, file, all) => { + cacheInfoData.current[file.name].status = 'uploading'; + cacheInfoData.current[file.name].progress = p; + forceUpdate(); + }} + onSuccess={async (res, file, all) => { + if (res.code !== 0) { + Toast.error(res.message); + cacheInfoData.current[file.name].status = 'uploaded'; + forceUpdate(); + return; + } + + cacheInfoData.current[file.name].status = 'decoding'; + forceUpdate(); + + // 等待描述生成完成 + //@ts-ignore + while (cacheInfoData.current[file.name].descWaiting) { + await new Promise(resolve => setTimeout(resolve, 100)); + } + + const { name, thumb, progress, id, status, ...other } = cacheInfoData.current[file.name]; + const attrs = {}; + for (let key in other) { + if (key.split('')[0] !== '_') { + attrs[key] = other[key]; + } + } + + const url = res.data.storage_path; + + // 保存到素材库 + const [item, err] = await props.createUserMaterial({ + category_id: props.categoryId || '0', + name: name, + urls: { url, thumb }, + attrs, + convert_status: -1, + }); + cacheInfoData.current[file.name].status = 'uploaded'; + params.current.page = 1; + getList([]); + }} + onError={(...v) => console.log('error', v)} + > + + + )} + {!props.categoryName && ( + + )} + + +
+ {props.subTitle ? props.subTitle : null} + {!props.categoryId && ( + { + setCates(cs); + props.catesCallback(cs); + }} + type={props.type} + /> + )} +
+ { + console.log(d); + if (d.convert_status === 0 || d.convert_status === 1) { + d.status = 'decoding'; + } else if (d.convert_status === 2 || d.convert_status === -1) { + d.status = 'uploaded'; + } else if (d.convert_status === 3) { + d.status = 'error'; + } + return d; + }), + ].map(d => { + return { + ...d, + thumb: d.urls?.thumb || d.attrs?.thumb || d.thumb, + width: d.attrs?.width || d.attrs?.naturalWidth || d.attrs?.videoWidth || 200, + height: d.attrs?.height || d.attrs?.naturalHeight || d.attrs?.videoHeight || 180, + }; + })} + type={props.type} + /> +
+ {totalRef.current > 0 && ( +
+ { + params.current.page = page; + getList([]); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }} + showSizeChanger={false} + /> +
+ )} + setShowVideoSplit(false)} + onOk={() => setShowVideoSplit(false)} + width={1200} + > + {showVideoSplit && } + + setShowImageSplit(false)} + onOk={() => setShowImageSplit(false)} + width={1200} + > + {showImageSplit && } + +
+ ); +} + +/** + * 获取素材的列表Items数据 + * @param type + * @param params + * @param items + * @returns + */ +export async function getItems( + type: 'draft' | 'material', // 类型 + params: { + page: number; + page_size: number; + keyword: string; + category_id?: string; + project_id?: string; + }, + apiServer: (n: any) => Promise<[any, boolean]>, +) { + const [res, err] = await apiServer({ ...params }); + + if (!err) { + const newData = res.data.map((d: any) => { + const item: any = { ...d, convert_status: d.convert_status ?? -1 }; + if (type === 'draft') { + return { ...item, width: 200, height: 180 }; + } else if (type === 'material') { + if (item.type === 'audio') { + return { ...item, width: 200, height: 80 }; + } else { + return { + ...item, + width: item.attrs.width || item.attrs.videoWidth || item.attrs.naturalWidth, + height: item.attrs.height || item.attrs.videoHeight || item.attrs.naturalHeight, + }; + } + } else { + throw new Error('类型不支持', type); + } + }); + + // 分页模式下直接返回新数据,不合并 + const list = newData; + + return { + list, + total: res.total, + }; + } else { + return { + list: [], + total: 0, + }; + } +} + +//@ts-ignore +export default observer(forwardRef(Content)); diff --git a/src/components/content/Folders.tsx b/src/components/content/Folders.tsx new file mode 100644 index 0000000..ce73236 --- /dev/null +++ b/src/components/content/Folders.tsx @@ -0,0 +1,129 @@ +import { observer } from 'mobx-react'; +import styles from './folders.module.less'; +import { layout } from '@stores/layout'; +import { FolderIcon } from './icon'; +import { Button, Space, Checkbox, Toast } from '@douyinfe/semi-ui'; +import { userService } from '@server/user.service'; +import { useCallback, useEffect, useReducer, useRef, useState } from 'react'; +import { pubsub } from '@utils/pubsub'; +import { Link } from 'react-router-dom'; +import classNames from 'classnames'; +import { language } from '@language/language'; +import { + isFSApiSupported, + getRootHandle, + getLocalCategoryList, + createLocalCategory, + updateLocalCategory, +} from '@services/localStorageService'; + +export interface IProps { + type: 'draft' | 'material'; // 类型 + catesCallback: (cates: any[]) => void; + noCheckbox?: boolean; + onClick?: (item: any) => void; +} + +function Folders(props: IProps) { + const [list, setList] = useState([]); + const [, forceUpdate] = useReducer(x => x + 1, 0); + const currentName = useRef(); + + const getList = useCallback(() => { + const t = props.type === 'draft' ? 'project' : 'material'; + getLocalCategoryList(t as 'project' | 'material').then(resp => { + const [res, err] = resp; + if (err) { + return Toast.error(err); + } else { + setList(res.data); + props.catesCallback(res.data); + } + }); + }, []); + + useEffect(() => { + pubsub.subscribe('updateFolders', () => { + getList(); + }); + + getList(); + + return () => { + pubsub.unsubscribe('updateFolders'); + }; + }, []); + + const checkboxStyle: any = {}; + if (layout.openSelectManage) { + checkboxStyle.display = 'flex'; + } + + console.log('list', list); + + return ( +
+ {list.map(item => { + return ( +
+ {props.noCheckbox ? null : ( + d.id === item.id)} + onChange={e => { + layout.setSelected( + { + id: item.id, + type: 'folder', + }, + e.target.checked, + ); + }} + /> + )} + {props.onClick ? ( + props.onClick(item)}> + + + ) : ( + + + + )} + + { + currentName.current = e.target.value; + }} + onChange={e => { + item.name = e.target.value; + forceUpdate(); + }} + onBlur={async e => { + if (item.name === currentName.current) { + return; + } + let [res, err] = await updateLocalCategory(item.id, { name: item.name }); + if (!err) { + Toast.success(language.val('draft_name_success')); + } + getList(); + }} + /> +
+ ); + })} +
+ ); +} + +export default observer(Folders); diff --git a/src/components/content/SelectedSet.tsx b/src/components/content/SelectedSet.tsx new file mode 100644 index 0000000..892fbcb --- /dev/null +++ b/src/components/content/SelectedSet.tsx @@ -0,0 +1,174 @@ +import styles from './content.module.less'; +import { server as draftServer } from '@pages/workspace/draft/server'; +import { server as materialServer } from '@pages/workspace/material/server'; +import { Button, Space, Checkbox, Modal, Toast, Popover } from '@douyinfe/semi-ui'; +import { observer } from 'mobx-react'; +import { layout } from '@stores/layout'; +import { userService } from '@server/user.service'; +import { pubsub } from '@utils/pubsub'; +import _remove from 'lodash/remove'; +import { language, Intl } from '@language/index'; + +export interface IProps { + items: any[]; + total: number; + type: 'draft' | 'material'; // 类型 + cates: any[]; // 分类 + removeCallBack: (params: [any[]]) => void; // 移除元素的回调 + moveCallBack: (cid: string, ids: string[]) => void; // 移动元素的回调 +} + +// 选中元素的操作 +function SelectedSet(props: IProps) { + const { items, cates, total, removeCallBack } = props; + // console.log( + // layout.selects.length, + // items, + // cates, + // (items || []).length + (cates || []).length, + // "layout.selects, items, cates" + // ); + return ( + + { + if (e.target.checked) { + //@ts-ignore + layout.selects = [ + ...(items || []).map(item => { + return { + type: 'item', + id: item.id, + }; + }), + ]; + } else { + layout.selects = []; + } + }} + indeterminate={layout.selects.length > 0 && layout.selects.length < (items || []).length + (cates || []).length} + checked={layout.selects.length === (items || []).length + (cates.filter(d => d.type === 'folder') || []).length} + > + {language.val('common_all')} + + + + + + + + + + ); +} +export default observer(SelectedSet); diff --git a/src/components/content/SourceList.tsx b/src/components/content/SourceList.tsx new file mode 100644 index 0000000..44f3060 --- /dev/null +++ b/src/components/content/SourceList.tsx @@ -0,0 +1,147 @@ +import { IconSpin } from '@douyinfe/semi-icons'; +// import InfiniteScroll from 'react-infinite-scroll-component'; +import styles from './sourceList.module.less'; +import WaterFull from '@components/water-full'; +import classNames from 'classnames'; +import { Progress, Checkbox, Toast, Empty } from '@douyinfe/semi-ui'; +import { userService } from '@server/user.service'; +import { observer } from 'mobx-react'; +import { layout } from '@stores/layout'; +import { useReducer } from 'react'; +import { language } from '@language/language'; +import { + IllustrationConstruction, + IllustrationConstructionDark, + IllustrationNoResult, + IllustrationNoResultDark, +} from '@douyinfe/semi-illustrations'; +import { Link } from 'react-router-dom'; + +export interface IProps { + items: any[]; + itemWidth: number; + item: (a: any) => JSX.Element; + itemClassName: string; + type: 'draft' | 'material'; // 资源类型 + selects?: any[]; + setSelects?: (selects: any[]) => void; + propsCheckboxStyle?: React.CSSProperties; +} + +export interface ChildProps { + children?: any; + className?: string; + item: any; +} + +function SourceList(props: IProps) { + const { items, type, itemWidth, propsCheckboxStyle = {} } = props; + // console.log(items, hasMore, "items"); + if (!items) { + return ( +
+ + +   {language.val('loading_more')} + +
+ ); + } + + const checkboxStyle: any = {}; + if (layout.openSelectManage) { + checkboxStyle.display = 'block'; + } + + layout.selects; + + if (items.length === 0) { + if (type === 'draft') { + // 草稿/作品页 + return ( + } + darkModeImage={} + title={'暂无作品'} + description="暂无任何作品,点击上方「创建项目」开始创作" + /> + ); + } + // 素材页 + return ( + } + darkModeImage={} + title={'暂无素材'} + description="暂无任何素材去选择" + /> + ); + } + + return ( + // + // {hasMore && ( + //
+ // + // + //   加载中... + // + //
+ // )} + // + // } + // scrollableTarget={scrollableTarget ? scrollableTarget : `sourceItemsScrollDOM_${props.type}`} + // endMessage={

{language.val('no_more_data')}

} + // > + { + return ( + + {props.item(item)} + {item.id !== 'null' && ( + + {props.selects ? ( + d.id === item.id)} + onChange={e => { + if (e.target.checked) { + props.setSelects([...props.selects, { ...item }]); + } else { + props.setSelects([...props.selects.filter(d => d.id !== item.id)]); + } + }} + > + ) : ( + d.id === item.id)} + onChange={e => { + layout.setSelected( + { + id: item.material_id || item.id, + type: 'item', + }, + e.target.checked, + ); + }} + > + )} + + )} + + ); + }} + /> + //
+ ); +} + +export default observer(SourceList); diff --git a/src/components/content/content.module.less b/src/components/content/content.module.less new file mode 100644 index 0000000..1495364 --- /dev/null +++ b/src/components/content/content.module.less @@ -0,0 +1,118 @@ +.content { + // padding: 30px; + // min-height: 100vh; + + .title { + display: flex; + align-items: center; + justify-content: space-between; + color: var(--theme-text); + + h1 { + font-size: 24px; + font-weight: bolder; + align-items: center; + } + + .cates { + align-items: center; + margin-left: 30px; + font-size: 18px; + color: var(--theme-text); + a { + color: var(--theme-main); + } + :global { + .i-icon { + opacity: 0.5; + position: relative; + top: 3px; + } + } + } + } +} + +.contents { + margin-top: 20px; + // padding-top: 20px; + overflow: auto; + position: relative; +} + +.selectedManager { + position: fixed; + left: 50%; + margin-left: -100px; + z-index: 100; + background-color: var(--theme-bg); + padding: 10px 20px; + border-radius: 4px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); +} + +.menus { + padding: 15px 8px; + li { + display: flex; + align-items: center; + padding: 6px 16px; + cursor: pointer; + border-radius: 4px; + transition: 0.4s; + color: var(--theme-text); + + :global { + .i-icon { + margin-right: 5px; + position: relative; + top: 3px; + } + } + &:hover { + background-color: var(--theme-input); + } + } +} + +.pagination { + display: flex; + justify-content: center; + padding: 30px 0; + + :global { + .semi-page-item { + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.6); + + &:hover { + background: rgba(255, 255, 255, 0.1); + color: #fff; + } + + &-active { + background: #0066ff; + border-color: #0066ff; + color: #fff; + } + } + + .semi-page-prev, + .semi-page-next { + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.6); + + &:hover { + background: rgba(255, 255, 255, 0.1); + color: #fff; + } + + &.semi-page-item-disabled { + opacity: 0.3; + cursor: not-allowed; + } + } + } +} diff --git a/src/components/content/folders.module.less b/src/components/content/folders.module.less new file mode 100644 index 0000000..0dcd9ee --- /dev/null +++ b/src/components/content/folders.module.less @@ -0,0 +1,52 @@ +.folders { + // margin: 20px 0; + margin-top: 20px; + max-height: 240px; + overflow-y: auto; + .folderItem { + display: inline-block; + text-align: center; + width: 120px; + height: 110px; + padding: 10px; + position: relative; + cursor: pointer; + :global { + .semi-checkbox { + position: absolute; + top: 5px; + right: 5px; + } + } + input { + display: block; + text-overflow: ellipsis; + text-align: center; + width: 100%; + overflow: hidden; + white-space: nowrap; + font-size: 12px; + background-color: transparent; + border: none; + border: 1px solid transparent; + border-radius: 2px; + color: var(--theme-text); + &:focus { + border: 1px solid #000; + } + } + :global { + .semi-checkbox { + display: none; + } + } + &:hover { + background-color: var(--theme-input); + :global { + .semi-checkbox { + display: flex; + } + } + } + } +} diff --git a/src/components/content/icon.tsx b/src/components/content/icon.tsx new file mode 100644 index 0000000..653c210 --- /dev/null +++ b/src/components/content/icon.tsx @@ -0,0 +1,27 @@ +export interface IconProps { + size: number; + color?: string; +} + +export function FolderIcon(props: IconProps) { + return ( + + + + + ); +} diff --git a/src/components/content/index.ts b/src/components/content/index.ts new file mode 100644 index 0000000..4a68109 --- /dev/null +++ b/src/components/content/index.ts @@ -0,0 +1,3 @@ +import Content from './Content'; + +export default Content; diff --git a/src/components/content/picture-split/PictureSplit.tsx b/src/components/content/picture-split/PictureSplit.tsx new file mode 100644 index 0000000..d037625 --- /dev/null +++ b/src/components/content/picture-split/PictureSplit.tsx @@ -0,0 +1,278 @@ +import styles from './styles.module.less'; +import { useCallback, useState } from 'react'; +import { observer } from 'mobx-react'; +import { Button, InputNumber, Space, Upload, Toast, Modal } from '@douyinfe/semi-ui'; +import { language } from '@language/language'; +import JSZip from 'jszip'; +import ReactCrop, { type Crop, type PixelCrop } from 'react-image-crop'; +import 'react-image-crop/dist/ReactCrop.css'; + +export interface IProps {} + +/** + * AI 人像分割 + * @param props + * @returns + */ +function PictureSplit(props: IProps) { + const [imgURL, setImgURL] = useState(''); + const [key, setKey] = useState(1); + const [num, setNum] = useState({ + x: 3, + y: 3, + padding: 0, + }); + const [loading, setLoading] = useState(false); + const [crop, setCrop] = useState(null); + const [showCrop, setShowCrop] = useState(false); + const [croppedImage, setCroppedImage] = useState(''); + + const getBase64 = file => { + return new Promise(resolve => { + var reader = new FileReader(); + reader.onload = function (e) { + resolve(e.target.result); + }; + reader.readAsDataURL(file); + }); + }; + + const splitAndDownload = useCallback(async () => { + if (!imgURL) { + Toast.error('请先上传图片'); + return; + } + + setLoading(true); + try { + const img = new Image(); + img.crossOrigin = 'anonymous'; + + await new Promise((resolve, reject) => { + img.onload = resolve; + img.onerror = reject; + img.src = imgURL; + }); + + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + + const scale = img.naturalWidth / 1000; + + const padding = num.padding * scale; + const pieceWidth = Math.floor((img.width - padding * (num.x + 1)) / num.x); + const pieceHeight = Math.floor((img.height - padding * (num.y + 1)) / num.y); + + canvas.width = pieceWidth; + canvas.height = pieceHeight; + + const zip = new JSZip(); + const imgFolder = zip.folder('split_images'); + + for (let row = 0; row < num.y; row++) { + for (let col = 0; col < num.x; col++) { + ctx.clearRect(0, 0, pieceWidth, pieceHeight); + + const sx = padding + col * (pieceWidth + padding); + const sy = padding + row * (pieceHeight + padding); + + ctx.drawImage(img, sx, sy, pieceWidth, pieceHeight, 0, 0, pieceWidth, pieceHeight); + + const blob = await new Promise(resolve => { + canvas.toBlob(resolve, 'image/png'); + }); + + const index = row * num.x + col + 1; + imgFolder.file(`image_${index}.png`, blob as Blob); + } + } + + const content = await zip.generateAsync({ type: 'blob' }); + + const link = document.createElement('a'); + link.href = URL.createObjectURL(content); + link.download = 'split_images.zip'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(link.href); + + Toast.success('图片分割完成,已开始下载'); + } catch (error) { + console.error('分割图片失败:', error); + Toast.error('分割图片失败'); + } finally { + setLoading(false); + } + }, [imgURL, num.x, num.y, num.padding]); + + const handleCropChange = useCallback((crop: any) => { + setCrop(crop); + }, []); + + const handleCropComplete = useCallback( + async (crop: any) => { + if (!crop || !imgURL) return; + + const img = new Image(); + img.crossOrigin = 'anonymous'; + + await new Promise((resolve, reject) => { + img.onload = resolve; + img.onerror = reject; + img.src = imgURL; + }); + + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + + const scale = img.naturalWidth / 1000; + canvas.width = crop.width * scale; + canvas.height = crop.height * scale; + + ctx.drawImage( + img, + crop.x * scale, + crop.y * scale, + crop.width * scale, + crop.height * scale, + 0, + 0, + crop.width * scale, + crop.height * scale, + ); + + canvas.toBlob(blob => { + if (blob) { + const url = URL.createObjectURL(blob); + setCroppedImage(url); + } + }, 'image/png'); + }, + [imgURL], + ); + + const downloadCroppedImage = useCallback(() => { + if (!croppedImage) { + Toast.error('请先完成裁剪'); + return; + } + + const link = document.createElement('a'); + link.href = croppedImage; + link.download = 'cropped_image.png'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(croppedImage); + }, [croppedImage]); + + return ( +
+ { + getBase64(obj.file.fileInstance).then(res => { + setKey(+new Date()); + setImgURL(res as string); + }); + return true; + }} + customRequest={() => {}} + draggable={true} + style={{ height: 200 }} + dragMainText={language.val('ai_upload_tip')} + dragSubText={language.val('ai_upload_sub_tip', { + format: 'PNG/GIF/JPG', + })} + > +
+ + { + setNum({ ...num, x: Number(value) }); + }} + min={1} + max={20} + step={1} + /> + x + { + setNum({ ...num, y: Number(value) }); + }} + min={1} + max={20} + step={1} + /> + padding: + { + setNum({ ...num, padding: Number(value) }); + }} + min={0} + max={100} + step={1} + suffix="px" + /> + + + +
+ {!!imgURL && ( +
+ {Array(num.x * num.y) + .fill(1) + .map((_, i) => { + const row = Math.floor(i / num.x); + const col = i % num.x; + const padding = num.padding; + return ( + + {/* {i + 1} */} + + ); + })} + +
+ )} + setShowCrop(false)} footer={null} width={1100}> + {imgURL && ( +
+ + + + {croppedImage && ( + + )} +
+ )} +
+
+ ); +} + +export default observer(PictureSplit); diff --git a/src/components/content/picture-split/styles.module.less b/src/components/content/picture-split/styles.module.less new file mode 100644 index 0000000..620d42a --- /dev/null +++ b/src/components/content/picture-split/styles.module.less @@ -0,0 +1,52 @@ +.body { + width: 1000px; + margin: 20px auto; + + .title { + text-align: center; + color: var(--theme-text); + padding: 40px 20px 20px 20px; + p { + margin: 20px 0; + opacity: 0.5; + } + } +} + +.tools { + margin: 20px 0; +} + +.videoBox { + margin-top: 20px; + position: relative; + .span { + position: absolute; + border: 1px dashed #000; + } +} + +:global { + .ReactCrop { + max-width: 100%; + img { + max-width: 100%; + } + } +} + +.croppedPreview { + margin-top: 20px; + padding: 15px; + background: #fff; + border-radius: 4px; + h4 { + margin-bottom: 10px; + color: var(--theme-text); + } + img { + max-width: 100%; + max-height: 300px; + border: 1px solid #ddd; + } +} diff --git a/src/components/content/sourceList.module.less b/src/components/content/sourceList.module.less new file mode 100644 index 0000000..2a2a293 --- /dev/null +++ b/src/components/content/sourceList.module.less @@ -0,0 +1,89 @@ +.loadingMore, +.noMoreTips { + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + font-size: 12px; + color: var(--theme-text); + path { + fill: #fff !important; + } +} +.loadingMore { + & > span { + display: flex; + align-items: center; + } +} + +.item { + position: relative; + -webkit-user-drag: none; + + img { + -webkit-user-drag: none; + } + + .checkbox { + position: absolute; + z-index: 10; + top: 5px; + right: 5px; + background-color: #fff; + width: 16px; + height: 16px; + border-radius: 3px; + display: none; + :global { + .semi-checkbox { + top: -2px; + } + } + } + + .save, + .add { + position: absolute; + z-index: 100; + bottom: 5px; + right: 5px; + background-color: var(--theme-main); + width: 16px; + height: 16px; + border-radius: 3px; + align-items: center; + justify-content: center; + display: none; + } + .save { + right: 25px; + background-color: rgb(255, 167, 58); + } + + &:hover { + .save, + .add { + display: flex; + } + .checkbox { + display: block; + } + } + + .progress { + font-size: 14px; + font-weight: bolder; + color: #fff; + position: absolute; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + z-index: 100; + background-color: rgba(0, 0, 0, 0.5); + top: 0; + left: 0; + } +} diff --git a/src/components/content/video-split/VideoSplit.tsx b/src/components/content/video-split/VideoSplit.tsx new file mode 100644 index 0000000..cb0c10a --- /dev/null +++ b/src/components/content/video-split/VideoSplit.tsx @@ -0,0 +1,297 @@ +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styles from './styles.module.less'; +import { Upload, Button, Toast, Spin, Space, InputNumber } from '@douyinfe/semi-ui'; +import JSZip from 'jszip'; +import { util } from '@utils/index'; +import { language } from '@language/language'; +import { uploadInfo } from '@utils/uploadInfo.es.js'; +import { userService } from '@server/user.service'; + +type Props = {}; + +const VideoSplit = (props: Props) => { + const [progress, setProgress] = useState(0); + const [url, setUrl] = useState(''); + const [frameURL, setFrameURL] = useState(''); + // const [stepFrameDraw, setStepFrameDraw] = useState(10); + const [duration, setDuration] = useState(0); + const [mouseX, setMouseX] = useState(-1); + const [markers, setMarkers] = useState([]); + const [loading, setLoading] = useState(false); + const videoRef = useRef(null); + const frameContainerRef = useRef(null); + const frameRef = useRef(null); + const [paddingTime, setPaddingTime] = useState(0); + + const downCapture = async () => { + if (markers.length === 0) { + Toast.error('请先添加分割标记'); + return; + } + + console.log('markers', markers); + setProgress(0); + setLoading(true); + + try { + // 使用ffmpeg对视频进行裁剪 + const ffmpeg = (window as any)._ffmpegWASMInstance; + while (!ffmpeg.loaded) { + await util.sleep(1000); + } + + // 开始 + ffmpeg.on('progress', ({ progress }: any) => { + setProgress(progress); + }); + await ffmpeg.writeFile('input.mp4', await util.fetchFile(url)); + + // 根据 markers 计算时间节点并排序 + const times = markers + .map(n => { + const container = frameContainerRef.current; + if (!container) return 0; + const img = container.querySelector('img'); + if (!img) return 0; + const imgWidth = img.scrollWidth; + const percent = Math.min(Math.max(n / imgWidth, 0), 1); + return percent * duration; + }) + .sort((a, b) => a - b); + + console.log('分割时间点:', times); + + // 生成分割命令 + const segments = []; + let startTime = 0; + + for (let i = 0; i <= times.length; i++) { + const endTime = i < times.length ? times[i] : duration; + const segmentDuration = endTime - startTime; + + if (segmentDuration > 0.1) { + // 过滤掉太短的片段 + const outputFile = `segment_${i + 1}.mp4`; + segments.push(outputFile); + + // 执行分割命令(使用copy参数快速分割,不重新编码) + await ffmpeg.exec([ + '-ss', + (startTime + (i === 0 ? 0 : paddingTime / 2)).toFixed(2), + '-i', + 'input.mp4', + '-t', + (endTime - startTime - (i === times.length - 1 ? 0 : paddingTime / 2)).toFixed(2), + '-c', + 'copy', + '-y', + outputFile, + ]); + + startTime = endTime; + } + } + + console.log('分割完成,生成的片段:', segments); + + // 创建zip文件 + const zip = new JSZip(); + const videoFolder = zip.folder('video_segments'); + + // 读取所有分割后的片段并添加到zip + for (const segment of segments) { + const data = await ffmpeg.readFile(segment); + videoFolder.file(segment, data.buffer); + + // 清理临时文件 + ffmpeg.deleteFile(segment); + } + + // 生成zip文件并下载 + const content = await zip.generateAsync({ type: 'blob' }); + const zipUrl = URL.createObjectURL(content); + + const link = document.createElement('a'); + link.href = zipUrl; + link.download = 'video_segments.zip'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(zipUrl); + + // 清理临时文件 + ffmpeg.deleteFile('input.mp4'); + + // 显示成功提示 + Toast.success(`视频已分割为 ${segments.length} 个片段,已打包成zip文件`); + } catch (error) { + console.error('分割视频失败:', error); + Toast.error('分割视频失败'); + } finally { + setLoading(false); + } + }; + + const drawFrameImage = async (url: string) => { + const info = await uploadInfo.getUploadBeforeData({ + url, + type: 'video', + uploadBase64: null, + }); + console.log('info1', info); + setDuration(info.duration); + const res = (await uploadInfo.decoderVideoDrawFrameImage({ + url, + aspectRatio: info.videoWidth / info.videoHeight, + audioTrack: null, + drawRectangle: false, + stepFrameDraw: 10, // 每10帧绘制一次 + videoRotation: info.rotate ? 90 : 0, + frameScale: 2, + duration: info.duration, + workerPath: '/assets/worker', + })) as any; + setFrameURL(res.url); + console.log(res, 'res--------->'); + }; + + const handleMouseMove = (e: React.MouseEvent) => { + if (!frameContainerRef.current) return; + + const container = frameContainerRef.current; + const rect = container.getBoundingClientRect(); + const x = e.clientX - rect.left + container.scrollLeft; + + // 获取图片实际宽度 + const img = container.querySelector('img'); + if (img) { + const imgWidth = img.scrollWidth; + // 限制x坐标在图片宽度范围内 + const limitedX = Math.min(Math.max(x, 0), imgWidth); + setMouseX(limitedX); + + // 计算当前时间点 + if (videoRef.current && duration > 0) { + const percent = limitedX / imgWidth; + const currentTime = percent * duration; + videoRef.current.currentTime = currentTime; + } + } + }; + + const handleMouseLeave = () => { + setMouseX(-1); + }; + + const handleClick = (e: React.MouseEvent) => { + if (!frameContainerRef.current) return; + + const container = frameContainerRef.current; + const rect = container.getBoundingClientRect(); + const x = e.clientX - rect.left + container.scrollLeft; + + // 获取图片实际宽度 + const img = container.querySelector('img'); + if (img) { + const imgWidth = img.scrollWidth; + // 限制x坐标在图片宽度范围内 + const limitedX = Math.min(Math.max(x, 0), imgWidth); + setMarkers([...markers, limitedX]); + } + }; + + const removeMarker = (index: number) => { + setMarkers(markers.filter((_, i) => i !== index)); + }; + + useEffect(() => { + if (url) { + drawFrameImage(url); + } + }, [url]); + + return ( + +
+ {}} + beforeUpload={obj => { + setUrl(obj.file.url); + return true; + }} + draggable={true} + style={{ height: 200 }} + dragMainText={language.val('mp4_upload_tip', { format: 'MP4' })} + dragSubText={language.val('mp4_upload_sub_tip', { format: 'MP4' })} + > + {url && ( +
+ +
+ )} +
+ + + {/* 鼠标跟随竖线 */} + {mouseX >= 0 &&
} + + {/* 标记红线 */} + {markers.map((x, index) => ( +
+
{ + e.stopPropagation(); + removeMarker(index); + }} + > + × +
+
+
+ ))} +
+
+
+ 分割时间点: + {frameRef.current && + duration && + markers + .sort((a, b) => a - b) + .map(x => `${((x / frameRef.current.width) * duration).toFixed(2)}秒`) + .join('、')} +
+ + setPaddingTime(Number(value))} + min={0} + max={duration} + style={{ width: 160 }} + step={0.01} + suffix="秒" + /> + + +
+
+ + ); +}; + +export default VideoSplit; diff --git a/src/components/content/video-split/styles.module.less b/src/components/content/video-split/styles.module.less new file mode 100644 index 0000000..df26b7a --- /dev/null +++ b/src/components/content/video-split/styles.module.less @@ -0,0 +1,98 @@ +.zip { + width: 1000px; + margin: 20px auto; + height: 600px; + a { + color: var(--theme-text); + } + .title { + text-align: center; + color: var(--theme-text); + padding: 40px 20px 20px 20px; + p { + margin: 20px 0; + opacity: 0.5; + } + } +} + +.videoBox{ + margin-top: 20px; + background-color: #000; + text-align: center; +} + +.videoFrames{ + margin-top: 20px; + position: relative; + cursor: pointer; + height: 80px; + overflow-x: auto; + overflow-y: hidden; + + img{ + height: 100%; + width: auto !important; + } + + .mouseLine{ + position: absolute; + top: 0; + bottom: 0; + width: 1px; + background-color: #007bff; + z-index: 10; + pointer-events: none; + } + + .padding{ + position: absolute; + height: 100%; + background-color: rgba(229, 255, 0, 0.63); + z-index: 10; + left: 50%; + transform: translateX(-50%); + pointer-events: none; + } + + .markerLine{ + position: absolute; + top: 0; + bottom: 0; + width: 1px; + background-color: #ff0000; + z-index: 5; + pointer-events: none; + + .markerDelete{ + position: absolute; + top: 20px; + left: -8px; + width: 16px; + height: 16px; + background-color: #ff0000; + color: white; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 14px; + cursor: pointer; + z-index: 20; + pointer-events: auto; + + &:hover{ + background-color: #cc0000; + } + } + } +} + +.markerBox{ + margin-top: 20px; + display: flex; + justify-content: space-between; +} +.markerTime{ + color: #fff; +} diff --git a/src/components/folder-guard/FolderGuard.tsx b/src/components/folder-guard/FolderGuard.tsx new file mode 100644 index 0000000..a5c4674 --- /dev/null +++ b/src/components/folder-guard/FolderGuard.tsx @@ -0,0 +1,79 @@ +import React, { useEffect, useState, useCallback } from 'react'; +import { Button, Modal, Typography } from '@douyinfe/semi-ui'; +import { FolderOpen } from '@icon-park/react'; +import { initLocalFolder, getRootHandle, isFSApiSupported } from '@services/localStorageService'; + +interface FolderGuardProps { + children: React.ReactNode; +} + +const FolderGuard: React.FC = ({ children }) => { + const supported = isFSApiSupported(); + const [folderReady, setFolderReady] = useState(!supported); + const [folderLoading, setFolderLoading] = useState(false); + + // 组件挂载时检查文件夹是否已初始化 + useEffect(() => { + if (supported) { + getRootHandle().then(handle => { + if (handle) { + setFolderReady(true); + } + }); + } + }, [supported]); + + const handleInitFolder = useCallback(async () => { + setFolderLoading(true); + try { + const handle = await initLocalFolder(); + if (handle) { + setFolderReady(true); + } + } finally { + setFolderLoading(false); + } + }, []); + + // 不支持 FSApi,直接渲染子组件 + if (!supported) { + return <>{children}; + } + + // 文件夹未就绪,显示选择弹窗 + if (!folderReady) { + return ( + + + + 选择本地存储文件夹 + + + 请选择一个本地文件夹用于存放素材和项目数据,素材将不会上传到服务器 + + + + ); + } + + return <>{children}; +}; + +export default FolderGuard; diff --git a/src/components/footer/Footer.tsx b/src/components/footer/Footer.tsx new file mode 100644 index 0000000..74bdd10 --- /dev/null +++ b/src/components/footer/Footer.tsx @@ -0,0 +1,77 @@ +import { theme } from '@theme'; +import styles from './footer.module.less'; +import { Intl } from '@language/index'; + +export interface IProps {} + +export default function Footer(props: IProps) { + return ( +
+
+
+
+ + + + +
+
+

+ +
+
+

+ +
+
+

+
+

+ +
+ : 13551301693 +

+ + + + {/* + 董经理 + 13551301693 + */} +
+
+
+
+ + + + {/* + 开启cookie提供更好的服务 接受 + */} +
+
+ ); +} diff --git a/src/components/footer/footer.module.less b/src/components/footer/footer.module.less new file mode 100644 index 0000000..952f9c0 --- /dev/null +++ b/src/components/footer/footer.module.less @@ -0,0 +1,201 @@ +.footer { + padding-top: 20px; + .divider { + height: 3px; + background: linear-gradient(285.39deg, rgba(158, 128, 255, 0.4) -2.87%, rgba(194, 177, 248, 0) 27.22%), + linear-gradient(107.57deg, #78e4ef -0.21%, #fda8ff 98.69%); + } + .footerInner { + max-width: 1000px; + margin: 20px auto; + display: flex; + justify-content: space-between; + } + .footerBottom { + border-top: var(--theme-border); + margin: 20px auto; + max-width: 1000px; + display: flex; + justify-content: center; + font-size: 12px; + padding: 20px 0; + color: var(--theme-text); + .copyRight { + opacity: 0.5; + } + a { + color: var(--theme-main); + } + } + .item { + font-size: 14px; + width: 25%; + padding-right: 30px; + color: var(--theme-text); + span { + display: inline-block; + } + .logo { + display: block; + width: 160px; + height: 60px; + background-image: var(--theme-logoen); + margin-bottom: 30px; + } + .info { + font-size: 12px; + opacity: 0.6; + line-height: 20px; + width: 80%; + } + a { + color: var(--theme-text); + } + h3 { + line-height: 60px; + height: 60px; + font-size: 16px; + font-weight: bolder; + margin-bottom: 30px; + } + .links { + opacity: 0.5; + li { + margin-bottom: 15px; + } + } + + .contact { + p { + display: block; + width: 100%; + } + .span { + margin-top: 10px; + display: block; + & > i { + display: inline-block; + width: 60px; + font-style: normal; + opacity: 0.5; + } + & > img { + width: 80px; + } + } + } + } +} + +@media screen and (max-width: 1000px) { + .footer { + .footerInner { + flex-wrap: wrap; // 换行 + padding: 0 20px; + } + .item { + width: 100%; + margin: 0 20px; + h3 { + margin-bottom: 0; + } + } + .links li { + display: inline-block; + margin-right: 20px; + } + } +} + +// 小于768px时候(移动端) +@media screen and (max-width: 768px) { + .footer { + padding-top: 10px; + .divider { + height: 2px; + } + .footerInner { + margin: 10px auto; + padding: 0 15px; + } + .item { + width: 100%; + padding: 15px 0; + border-bottom: 1px solid var(--theme-border); + &:last-child { + border-bottom: none; + } + .logo { + width: 120px; + height: 45px; + margin-bottom: 15px; + } + .info { + width: 100%; + font-size: 11px; + } + h3 { + height: 40px; + line-height: 40px; + font-size: 14px; + margin-bottom: 10px; + } + .links { + li { + display: block; + margin-bottom: 8px; + font-size: 13px; + } + } + .contact { + p { + font-size: 12px; + } + .span { + margin-top: 15px; + img { + width: 100px; + } + } + } + } + .footerBottom { + margin: 10px auto; + padding: 15px 0; + font-size: 11px; + } + } +} + +// 小于480px时候(小屏移动端) +@media screen and (max-width: 480px) { + .footer { + .footerInner { + padding: 0 10px; + } + .item { + padding: 12px 0; + .logo { + width: 100px; + height: 38px; + } + h3 { + font-size: 13px; + } + .links li { + font-size: 12px; + } + .contact { + p { + font-size: 11px; + } + .span img { + width: 80px; + } + } + } + .footerBottom { + font-size: 10px; + } + } +} diff --git a/src/components/footer/index.ts b/src/components/footer/index.ts new file mode 100644 index 0000000..ced11e5 --- /dev/null +++ b/src/components/footer/index.ts @@ -0,0 +1,3 @@ +import Footer from './Footer'; + +export default Footer; diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx new file mode 100644 index 0000000..474ad3f --- /dev/null +++ b/src/components/header/Header.tsx @@ -0,0 +1,205 @@ +import React, { useReducer, useEffect, useState } from 'react'; +import styles from './header.module.less'; +import { NavLink, Link, withRouter } from 'react-router-dom'; +import { observer } from 'mobx-react'; +import { user } from '@stores/user'; +import logoImg from '@images/logo2.png'; +import { Button, Popover, Avatar, Space, Toast } from '@douyinfe/semi-ui'; +import Login from '@components/login'; +import User from './user/User'; +import { config } from '@config/index'; +import { theme, ThemeName } from '@theme'; +import { layout } from '@stores/layout'; +import { IconDuration, IconSun } from '@douyinfe/semi-icons'; +import { getInitData } from '@config/initData'; +import { server } from './server'; +import { pubsub } from '@utils/pubsub'; +import Intl from '@language/Intl'; +import { language } from '@language/language'; +import { AllApplication, Box, International } from '@icon-park/react'; +import classNames from 'classnames'; +import { reURL } from '@utils/util'; +import VipRecharge from '@pages/editor/components/header/VipRecharge'; +import CreditRecharge from '@pages/editor/components/header/CreditRecharge'; + +export interface IProps { + componentName?: string; + match?: any; + navs?: any[]; +} + +const Header = (props: IProps) => { + // const [, forceUpdate] = useReducer(x => x + 1, 0); + const [cid = '', cname = ''] = props.match.params.cid?.split('_') || []; + const [vipRechargeVisible, setVipRechargeVisible] = useState(false); + const [creditRechargeVisible, setCreditRechargeVisible] = useState(false); + + // 创建视频 + const createVideo = async () => { + if (!user.info) { + pubsub.publish('showLoginModal', true); + return; + } + + const initData = getInitData(); + if (cid) { + initData.category_id = cid; + } + const [res, err] = await server.createVideo(initData); + if (err) { + Toast.error(err); + return; + } + location.href = `${config.editorHost}/${res.id}`; + }; + + useEffect(() => { + const vipSub = pubsub.subscribe('showVipRecharge', () => { + setVipRechargeVisible(true); + }); + const creditSub = pubsub.subscribe('showCreditRecharge', () => { + setCreditRechargeVisible(true); + }); + return () => { + pubsub.unsubscribe('showVipRecharge'); + pubsub.unsubscribe('showCreditRecharge'); + }; + }, []); + + const languageType = language.getLanguage(); + + return ( +
+
+ + {/*
{' '} */} + +
✂
+ 无界云剪辑 +
+ +
+ {/* { + if (location.pathname === '/') { + return true; + } + }} + > + + */} + {props.navs?.map((item, index) => ( + + {item.name} + + ))} + {/* + 会员中心 + */} + {/* + + */} + {/* + + */} + {/* + + */} +
+
+ + {/* { + if (language.getLanguage() === 'en-US') { + language.setLanguage('zh-CN'); + } else { + language.setLanguage('en-US'); + } + }} + > + + */} + {!!user.info && ( + <> + + {/* */} + + 素材 + + + {/* */} + + 项目 + + + )} + + + + + GitHub + + + + + + + + + Gitee + + {/* + + */} + {user.info ? ( + } position="bottomRight" trigger="hover"> + + {user.info.name.toUpperCase().split('')[0]} + + + ) : ( + + + + )} + + setVipRechargeVisible(false)} /> + setCreditRechargeVisible(false)} /> +
+ ); +}; + +export default withRouter(observer(Header)); diff --git a/src/components/header/header.module.less b/src/components/header/header.module.less new file mode 100644 index 0000000..935459d --- /dev/null +++ b/src/components/header/header.module.less @@ -0,0 +1,162 @@ +.header { + position: fixed; + padding: 0 160px; + top: 0; + left: 0; + z-index: 900; + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + height: 60px; + // padding: 0 20px; + box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.1); + background-color: var(--theme-bg4); + backdrop-filter: blur(20px); + + .logoBrand { + display: flex; + align-items: center; + gap: 10px; + font-size: 18px; + font-weight: 700; + color: var(--theme-text); + text-decoration: none; + } + .logoBrand .logo { + width: 34px; + height: 34px; + border-radius: 10px; + background: linear-gradient(135deg, #7c3aed, #5a29c6); + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + } + + // .logoNav { + // display: flex; + // .logo { + // display: inline-block; + // width: 160px; + // height: 60px; + // background-image: var(--theme-logo); + // background-repeat: no-repeat; + // background-size: 80%; + // background-position: center; + // } + // .logoen { + // display: inline-block; + // width: 160px; + // height: 60px; + // background-image: var(--theme-logoen); + // background-repeat: no-repeat; + // background-size: cover; + // } + // .nav { + // .text { + // display: inline-block; + // margin-left: 40px; + // height: 55px; + // line-height: 55px; + // font-family: Inter; + // font-size: 14px; + // font-weight: 500; + // color: var(--theme-text); + // } + // .active { + // border-bottom: solid 2px var(--theme-text-active); + // } + // } + // } + + .space { + color: var(--theme-text); + background: var(--theme-bg); + padding: 5px 20px; + border-radius: 6px; + display: flex; + box-shadow: 0 0 2px rgba(139, 92, 246, 0.3); + align-items: center; + :global { + .i-icon { + margin-right: 10px; + display: inline-block; + height: 18px; + } + } + } + .active { + box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3); + background: linear-gradient(135deg, #7c3aed, #551db6); + } +} + +.create { + background: linear-gradient(45deg, #00e9fa 0%, rgb(32, 127, 251) 100%); + &:hover { + background: linear-gradient(60deg, #00e9fa 0%, rgb(32, 127, 251) 100%) !important; + } +} + +.loginBtn { + background: linear-gradient(45deg, #00e9fa 0%, #8b20fb 51%, #bb00fa 100%); + &:hover { + background: linear-gradient(60deg, #00e9fa 0%, #8b20fb 51%, #bb00fa 100%) !important; + } +} + +// 小于1000px时候 +@media screen and (max-width: 1000px) { + .header { + padding: 0 15px; + } + .space { + display: none; + } + .createVideoBtn { + display: none; + } + .logoNav { + .logo { + margin-top: 10px; + width: 100px; + height: 35px; + } + .logoen { + margin-top: 10px; + width: 100px; + height: 35px; + } + .nav .text { + margin-left: 20px; + font-size: 13px; + } + } +} + +// 小于768px时候(移动端) +@media screen and (max-width: 768px) { + .header { + height: 50px; + padding: 0 12px; + } + .logoNav { + .logo { + width: 80px; + height: 30px; + margin-top: 8px; + } + .logoen { + width: 80px; + height: 30px; + margin-top: 8px; + } + .nav { + display: none; // 移动端隐藏导航,可以改为汉堡菜单 + } + } + .space { + display: none; + } +} diff --git a/src/components/header/index.ts b/src/components/header/index.ts new file mode 100644 index 0000000..a9ce105 --- /dev/null +++ b/src/components/header/index.ts @@ -0,0 +1,3 @@ +import Header from './Header'; + +export default Header; diff --git a/src/components/header/server.ts b/src/components/header/server.ts new file mode 100644 index 0000000..c998eee --- /dev/null +++ b/src/components/header/server.ts @@ -0,0 +1,11 @@ +import BasicService from '@server/BasicService'; +class Server extends BasicService { + /** + * @desc 创建视频 + */ + createVideo = async data => { + return await this.post('/user/apps/create', data); + }; +} + +export const server = new Server(); diff --git a/src/components/header/user/User.tsx b/src/components/header/user/User.tsx new file mode 100644 index 0000000..dd1c8f1 --- /dev/null +++ b/src/components/header/user/User.tsx @@ -0,0 +1,139 @@ +import styles from './user.module.less'; +import { Avatar } from '@douyinfe/semi-ui'; +import { VipOne, Workbench, Power, People, Theme, International } from '@icon-park/react'; +import { observer } from 'mobx-react'; +import { user } from '@stores/user'; +import classNames from 'classnames'; +import { theme, ThemeName } from '@theme'; +import { layout } from '@stores/layout'; +import { Link } from 'react-router-dom'; +import { useReducer } from 'react'; +import { language, Intl } from '@language/index'; +import { reURL } from '@utils/util'; +import { config } from '@config/index'; +import { util } from '@utils/index'; +import { pubsub } from '@utils/pubsub'; + +export interface IProps {} + +function User(props: IProps) { + const [, forceUpdate] = useReducer(x => x + 1, 0); + const info = user.info; + const isVip = Number(info.vip_level || 0) > 0 && info.vip_expire && new Date(info.vip_expire).getTime() > Date.now(); + const vipExpire = info.vip_expire ? util.formatDate(info.vip_expire, 'YYYY-MM-DD') : '未开通'; + return ( +
+
+ + {info.name.toUpperCase().split('')[0]} + + +

{info.name}

+

+ + : + + {info.id} +

+
+
+
+
    +
  • { + e.stopPropagation(); + pubsub.publish('showVipRecharge'); + }} + > + + + {isVip ? '会员用户' : '开通会员'} + + {isVip ? `有效期至 ${vipExpire}` : '普通用户'} +
  • +
  • { + e.stopPropagation(); + pubsub.publish('showCreditRecharge'); + }} + > + + + 积分充值 + + {user.info?.credits || 0} +
  • + +
  • + + + + + + +
  • + + +
  • + + + + + + +
  • + +
  • { + if (theme.getTheme() === 'dark') { + theme.setTheme(ThemeName.LIGHT); + } else { + theme.setTheme(ThemeName.DARK); + } + layout.themeUpdateKey = theme.getTheme(); + }} + > + + + + + + + {layout.themeUpdateKey === 'dark' ? 'Black' : 'Light'} +
  • +
  • { + if (language.getLanguage() === 'en-US') { + language.setLanguage('zh-CN'); + } else { + language.setLanguage('en-US'); + } + }} + > + + + + + + +
  • +
  • + { + user.logout(); + }} + > + + + + + +
  • +
+
+
+ ); +} + +export default observer(User); diff --git a/src/components/header/user/user.module.less b/src/components/header/user/user.module.less new file mode 100644 index 0000000..47800ce --- /dev/null +++ b/src/components/header/user/user.module.less @@ -0,0 +1,99 @@ +.user { + width: 300px; + padding: 20px; + background-color: var(--theme-bg); + border-radius: var(--semi-border-radius-small); + font-size: 14px; + color: var(--theme-text); + + .photo { + display: flex; + align-items: center; + .right { + margin-left: 10px; + h3 { + font-weight: bolder; + margin-bottom: 6px; + } + p { + font-size: 13px; + opacity: 0.7; + } + } + } + + .vipTips { + margin-top: 20px; + display: flex; + align-items: center; + background: rgba(255, 148, 49, 0.2); + padding: 10px; + border-radius: var(--semi-border-radius-small); + + .right { + margin-left: 10px; + } + h3 { + font-weight: bolder; + margin-bottom: 6px; + color: #a1520a; + } + p { + span { + font-size: 13px; + opacity: 0.7; + } + } + a { + color: var(--theme-main); + font-weight: bolder; + margin-left: 5px; + } + } + + .noVipTips { + background: rgba(0, 0, 0, 0.05); + h3 { + color: var(--theme-text); + } + } + + .menus { + margin-top: 20px; + .right { + opacity: 0.5; + font-size: 12px; + } + .vipRight { + max-width: 145px; + opacity: 0.65; + font-size: 12px; + line-height: 18px; + text-align: right; + word-break: keep-all; + } + .vipMenu { + background: rgba(255, 148, 49, 0.12); + } + li { + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + padding: 10px 10px; + border-radius: var(--semi-border-radius-small); + transition: 0.3s; + :global { + .i-icon { + opacity: 0.7; + margin-right: 10px; + } + } + color: var(--theme-text); + + &:hover { + background-color: rgba(0, 0, 0, 0.05); + } + } + } +} diff --git a/src/components/login/LoginRegister.tsx b/src/components/login/LoginRegister.tsx new file mode 100644 index 0000000..9173f50 --- /dev/null +++ b/src/components/login/LoginRegister.tsx @@ -0,0 +1,63 @@ +import styles from './login-register.module.less'; +import React, { useState, useEffect } from 'react'; +import { Modal } from '@douyinfe/semi-ui'; +import LoginRegisterBox from './loginRegisterBox/LoginRegisterBox'; +import { pubsub } from '@utils/index'; +import { Close } from '@icon-park/react'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; + +function LoginRegister({ children }: any) { + const [visible, setVisible] = useState(false); + + const showVisible = () => { + if (!stores.user.info) { + setVisible(true); + } else { + console.log(stores.user.info); + console.warn('已经登录过了'); + // history.push(location.pathname); + } + }; + + useEffect(() => { + pubsub.subscribe('showLoginModal', (_eventName: string, mark: boolean) => { + if (mark !== undefined) { + setVisible(mark); + } else { + setVisible(true); + } + }); + return () => { + pubsub.unsubscribe('showLoginModal'); + }; + }, []); + + return ( +
+ {children ? ( + {children} + ) : ( + + {language.val('login_login0')} + + )} + } + onCancel={() => setVisible(false)} + > + {visible && } + +
+ ); +} + +export default LoginRegister; diff --git a/src/components/login/index.ts b/src/components/login/index.ts new file mode 100644 index 0000000..29aee41 --- /dev/null +++ b/src/components/login/index.ts @@ -0,0 +1,3 @@ +import LoginRegister from './LoginRegister'; + +export default LoginRegister; diff --git a/src/components/login/login-register.module.less b/src/components/login/login-register.module.less new file mode 100644 index 0000000..6c1b5df --- /dev/null +++ b/src/components/login/login-register.module.less @@ -0,0 +1,27 @@ +.loginRegister { + .loginRegisterBtn { + color: var(--theme-color1); + font-size: 14px; + } +} + +:global { + .loginRegisterModal { + .semi-modal-content { + padding: 0 !important; + border: none !important; + } + .semi-modal-body-wrapper { + position: relative; + margin: 0 !important; + } + .semi-button.semi-button-with-icon-only.semi-button-size-small { + position: absolute; + right: 10px; + top: 10px; + svg { + font-size: 20px; + } + } + } +} diff --git a/src/components/login/loginEmail/LoginEmail.tsx b/src/components/login/loginEmail/LoginEmail.tsx new file mode 100644 index 0000000..670f3ee --- /dev/null +++ b/src/components/login/loginEmail/LoginEmail.tsx @@ -0,0 +1,175 @@ +import styles from './styles.module.less'; +import React, { useEffect, useState, useRef } from 'react'; +import { Form, Input, Button, Row, Col, Divider, Toast } from '@douyinfe/semi-ui'; +import { userService } from '@server/index'; +import { pubsub } from '@utils/index'; +import { config } from '@config/index'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; +function LoginEmail({ setShow }: any) { + const [captcha, setCaptcha] = useState({ + key: '', + code: '', + }); + const formRef = useRef(); + const formApiRef = useRef(); + const timer = useRef(); + const [time, setTime] = useState(60); + + const onFinish = async (values: any) => { + // 1、登录成功后自动设置x-token + const [res, err] = await userService.login({ + email: values.email, + code: values.emailCode, + type: 'email_code', + }); + + if (res) { + Toast.success(language.val('login_success')); + } else { + Toast.error(err); + } + if (err) { + // 切换验证码 + getImageKey(); + return; + } + // 2、获取用户详情,设置x-user-info + const [userRes, userError] = await userService.getUserDetail(); + if (userRes) { + (window as any).RouterHistory.push(config.loginSuccessLink); + pubsub.publish('showLoginModal', false); + if (stores.editor.onLoginSuccess) { + userRes.token = res.token; + stores.editor.onLoginSuccess(userRes); + } + } + }; + useEffect(() => { + getImageKey(); + }, []); + + const getImageKey = async () => { + const [res, err] = await userService.getCaptcha(); + if (res) { + setCaptcha({ + code: res.captcha_code, + key: res.captcha_key, + }); + } + }; + + const getFormApi = formApi => { + formApiRef.current = formApi; + }; + + // 发送邮箱验证码 + const sendEmailCode = async () => { + const { email, captchaCode } = formApiRef.current.getValues(); + console.log('formApiRef.current', formApiRef.current.getValues()); + if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { + Toast.error(language.val('login_email_error')); + return; + } + if (!captchaCode) { + Toast.error({ content: language.val('login_captcha_error'), duration: 10000 }); + return; + } + // 发送验证码 + const [res, err] = await userService.sendEmailCodeLogin({ + email: email, + captchaCode: captchaCode, + captchaKey: captcha.key, + }); + if (res) { + Toast.success(language.val('login_email_code_success')); + } else { + Toast.error(err); + } + + let t = 60; + timer.current = setInterval(() => { + if (t - 1 === 0) { + clearInterval(timer.current); + setTime(60); + return; + } + t--; + setTime(t); + }, 1000); + }; + + useEffect(() => { + return () => { + if (timer.current) { + clearInterval(timer.current); + timer.current = null; + } + }; + }, []); + + return ( +
+

+ {language.val('login_email_login')} +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export default LoginEmail; diff --git a/src/components/login/loginEmail/index.ts b/src/components/login/loginEmail/index.ts new file mode 100644 index 0000000..4a4376a --- /dev/null +++ b/src/components/login/loginEmail/index.ts @@ -0,0 +1,3 @@ +import LoginEmail from './LoginEmail'; + +export default LoginEmail; diff --git a/src/components/login/loginEmail/styles.module.less b/src/components/login/loginEmail/styles.module.less new file mode 100644 index 0000000..4a3d141 --- /dev/null +++ b/src/components/login/loginEmail/styles.module.less @@ -0,0 +1,19 @@ +.loginMobile{ + .title{ + margin-bottom: 12px; + font-size: 22px; + } + .fromItem{ + display: flex; + align-items: center; + :global{ + .semi-form-field-error-message{ + position: absolute; + bottom: -8px; + } + } + } + .fromBtnItem{ + margin-top: 12px; + } +} \ No newline at end of file diff --git a/src/components/login/loginMobile/LoginMobile.tsx b/src/components/login/loginMobile/LoginMobile.tsx new file mode 100644 index 0000000..5a39197 --- /dev/null +++ b/src/components/login/loginMobile/LoginMobile.tsx @@ -0,0 +1,176 @@ +import styles from './login-mobile.module.less'; +import React, { useEffect, useState, useRef } from 'react'; +import { Form, Input, Button, Row, Col, Divider, Toast } from '@douyinfe/semi-ui'; +import { userService } from '@server/index'; +import { pubsub } from '@utils/index'; +import { config } from '@config/index'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; +function LoginMobile({ setShow }: any) { + const [captcha, setCaptcha] = useState({ + key: '', + code: '', + }); + const formRef = useRef(); + const formApiRef = useRef(); + const timer = useRef(); + const [time, setTime] = useState(60); + + const onFinish = async (values: any) => { + // 1、登录成功后自动设置x-token + // const res = await userService.login({ ...values, captchaKey: captcha.key }); + const [res, err] = await userService.login({ + mobile: values.telphone, + code: values.phoneCode, + type: 'mobile_code', + }); + + if (res) { + Toast.success(language.val('login_success')); + } else { + Toast.error(err); + } + if (err) { + // 切换验证码 + getImageKey(); + return; + } + // 2、获取用户详情,设置x-user-info + const [userRes, userError] = await userService.getUserDetail(); + if (userRes) { + (window as any).RouterHistory.push(config.loginSuccessLink); + pubsub.publish('showLoginModal', false); + if (stores.editor.onLoginSuccess) { + userRes.token = res.token; + stores.editor.onLoginSuccess(userRes); + } + } + }; + useEffect(() => { + getImageKey(); + }, []); + + const getImageKey = async () => { + const [res, err] = await userService.getCaptcha(); + console.log(res); + if (res) { + setCaptcha({ + code: res.captcha_code, + key: res.captcha_key, + }); + } + }; + + const getFormApi = formApi => { + formApiRef.current = formApi; + }; + + // 发送手机验证码 + const sendSMS = async () => { + console.log('formApiRef.current', formApiRef.current); + const { telphone, captchaCode } = formApiRef.current.getValues(); + console.log('formApiRef.current', formApiRef.current.getValues()); + if (!/^1\d{10}$/.test(telphone)) { + Toast.error(language.val('login_phone_format_error')); + return; + } + if (!captchaCode) { + Toast.error(language.val('login_captcha_error')); + return; + } + // 发送验证码 + const [res, err] = await userService.getLoginSMS({ + mobile: telphone, + captchaCode: captchaCode, + captchaKey: captcha.key, + }); + if (res) { + Toast.success(language.val('login_phone_code_send_tip')); + } else { + Toast.error(err); + } + + let t = 60; + timer.current = setInterval(() => { + if (t - 1 === 0) { + clearInterval(timer.current); + setTime(60); + return; + } + t--; + setTime(t); + }, 1000); + }; + + useEffect(() => { + return () => { + if (timer.current) { + clearInterval(timer.current); + timer.current = null; + } + }; + }, []); + + return ( +
+

+ {language.val('login_phone_login')} +

+
+ +
+ + + + + + + {/* */} + + + + + + + + + + + + + + + + + + + + + ); +} + +export default LoginMobile; diff --git a/src/components/login/loginMobile/index.ts b/src/components/login/loginMobile/index.ts new file mode 100644 index 0000000..0b40236 --- /dev/null +++ b/src/components/login/loginMobile/index.ts @@ -0,0 +1,3 @@ +import LoginMobile from './LoginMobile'; + +export default LoginMobile; \ No newline at end of file diff --git a/src/components/login/loginMobile/login-mobile.module.less b/src/components/login/loginMobile/login-mobile.module.less new file mode 100644 index 0000000..4a3d141 --- /dev/null +++ b/src/components/login/loginMobile/login-mobile.module.less @@ -0,0 +1,19 @@ +.loginMobile{ + .title{ + margin-bottom: 12px; + font-size: 22px; + } + .fromItem{ + display: flex; + align-items: center; + :global{ + .semi-form-field-error-message{ + position: absolute; + bottom: -8px; + } + } + } + .fromBtnItem{ + margin-top: 12px; + } +} \ No newline at end of file diff --git a/src/components/login/loginQrcode/LoginQrcode.tsx b/src/components/login/loginQrcode/LoginQrcode.tsx new file mode 100644 index 0000000..f1dce1a --- /dev/null +++ b/src/components/login/loginQrcode/LoginQrcode.tsx @@ -0,0 +1,86 @@ +import styles from './login-qrcode.module.less'; +import React, { Component } from 'react'; +import { userService } from '@server/index'; +import { pubsub } from '@utils/index'; +import { config } from '@config/index'; +import { Wechat, Phone } from '@icon-park/react'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; + +interface IProps {} +interface IState { + url: string; + sn: string; +} + +class LoginQrcode extends Component { + timer: any; + + constructor(props: any) { + super(props); + this.state = { + url: '', + sn: '', + }; + } + + // 轮询监测登录状态 + seekLogin = async (sn: string) => { + this.timer = setTimeout(async () => { + const [res] = await userService.seekWxLogin(sn); + if (!res) { + this.seekLogin(sn); + } else { + clearTimeout(this.timer); + // 获取到token了 + userService._setRqHeaderToken(res.token); + // 2、获取用户详情,设置x-user-info + const [ress] = await userService.getUserDetail(); + if (ress) { + // 登录成功回调 + pubsub.publish('showLoginModal', false); + ress.token = res.token; + stores.editor.onLoginSuccess?.(ress); + // location.reload(); + // (window as any).RouterHistory.push(config.loginSuccessLink); + } + } + }, 3000); + }; + + doQrcode = async () => { + const [res] = await userService.getWxQrcode(); + this.setState({ + url: res.url, + sn: res.sn, + }); + + // 轮询登录 + this.seekLogin(res.sn); + }; + + componentDidMount() { + this.doQrcode(); + } + + componentWillUnmount() { + if (this.timer) { + clearTimeout(this.timer); + } + } + + render() { + const { url } = this.state; + return ( +
+

+ + {language.val('login_wechat_login')} +

+ +
+ ); + } +} + +export default LoginQrcode; diff --git a/src/components/login/loginQrcode/index.ts b/src/components/login/loginQrcode/index.ts new file mode 100644 index 0000000..3e7fce0 --- /dev/null +++ b/src/components/login/loginQrcode/index.ts @@ -0,0 +1,3 @@ +import LoginQrcode from './LoginQrcode'; + +export default LoginQrcode; \ No newline at end of file diff --git a/src/components/login/loginQrcode/login-qrcode.module.less b/src/components/login/loginQrcode/login-qrcode.module.less new file mode 100644 index 0000000..8c0b515 --- /dev/null +++ b/src/components/login/loginQrcode/login-qrcode.module.less @@ -0,0 +1,15 @@ +.loginQrcode { + text-align: center; + padding: 20px; + + .title { + display: flex; + align-items: center; + justify-content: center; + margin: 30px; + font-size: 18px; + .text{ + margin-left: 5px; + } + } + } \ No newline at end of file diff --git a/src/components/login/loginRegisterBox/LoginRegisterBox.tsx b/src/components/login/loginRegisterBox/LoginRegisterBox.tsx new file mode 100644 index 0000000..db33f04 --- /dev/null +++ b/src/components/login/loginRegisterBox/LoginRegisterBox.tsx @@ -0,0 +1,124 @@ +import styles from './login-register-box.module.less'; +import React, { useState, useEffect, useRef } from 'react'; +import { config } from '@config/index'; +import { Divider, Toast } from '@douyinfe/semi-ui'; +import LoginQrcode from '../loginQrcode'; +import LoginMobile from '../loginMobile'; +import LoginEmail from '../loginEmail'; + +import { userService } from '@server/index'; +import { Wechat, Phone, Check, MailPackage } from '@icon-park/react'; +import { language } from '@language/language'; +import classNames from 'classnames'; + +function LoginRegisterBox() { + const [show, setShow] = useState(language.getLanguage() === 'zh-CN' ? 'loginQrcode' : 'loginEmail'); + + // const showOAuthWindow = () => { + // let url = `${config.apiHost}/account/login/provider/qq?type=login`; + // window.open(url, '', 'width=500,height=500,channelmode=yes'); + // }; + + const handlePostMessage = async (evt: any) => { + if (evt.data.msgType !== 'oauth-login') { + return; + } + const { provider, code } = evt.data; + if (provider) { + const hide = Toast.info(language.val('login_loading')); + await userService.oauthLogin(code); + Toast.close(hide); + (window as any).RouterHistory.push(location.pathname); + } + }; + + useEffect(() => { + window.addEventListener('message', handlePostMessage); + return () => { + window.removeEventListener('message', handlePostMessage); + }; + }); + + return ( +
+
+

{language.val('common_name')}

+

+ + {language.val('login_switch_lens')} +

+

+ + {language.val('login_ai_subtitle')} +

+

+ + {language.val('login_ai_animation')} +

+

+ + {language.val('login_export_4k')} +

+

+ + {language.val('login_lut_filter')} +

+ {/*

+ + {language.val('login_free_material')} +

*/} +

+ + {language.val('login_exclusive_plugin')} +

+

+ + {language.val('login_no_download')} +

+

+ + {language.val('login_cloud_storage')} +

+
+
+
+ {show === 'loginQrcode' && } + {show === 'loginMobile' && } + {show === 'loginEmail' && } +
+ {language.val('login_other_login')} + +
+
+ ); +} + +export default LoginRegisterBox; diff --git a/src/components/login/loginRegisterBox/index.ts b/src/components/login/loginRegisterBox/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/login/loginRegisterBox/login-register-box.module.less b/src/components/login/loginRegisterBox/login-register-box.module.less new file mode 100644 index 0000000..4436e4b --- /dev/null +++ b/src/components/login/loginRegisterBox/login-register-box.module.less @@ -0,0 +1,83 @@ +.loginRegisterBox { + display: flex; + // padding-bottom: 20px; + + .loginRegisterInfo { + width: 406px; + padding: 40px 60px; + background: linear-gradient(315deg, #7454ff 0%, #1261ff 100%); + img { + width: 100%; + } + h1 { + color: #ffff; + font-weight: bolder; + margin-bottom: 40px; + } + + & > p { + color: #ffff; + background-color: rgba(255, 255, 255, 0.2); + margin-bottom: 10px; + padding: 10px; + border-radius: 100px; + font-size: 15px; + display: flex; + align-items: center; + :global { + .i-icon { + margin-right: 10px; + } + } + } + } + + .loginRegisterForm { + width: 430px; + display: flex; + justify-content: center; + flex-direction: column; + } + + .loginRegisterTabs { + margin: 0 50px 40px 50px; + + .loginRegisterTitle { + font-size: 24px; + padding-top: 40px; + padding-bottom: 30px; + } + } + + .loginRegisterActions { + text-align: center; + display: flex; + justify-content: center; + margin-top: 40px; + + .item { + margin: 0 20px; + color: var(--theme-color1); + } + + .active { + color: var(--theme-main); + path{ + stroke: var(--theme-main); + } + } + + .webfont { + font-size: 24px; + } + + span { + display: block; + font-size: 12px; + } + } + + .loginFooter { + padding-top: 20px; + } +} diff --git a/src/components/login/loginTelphone/AccountLogin.tsx b/src/components/login/loginTelphone/AccountLogin.tsx new file mode 100644 index 0000000..2dfb29a --- /dev/null +++ b/src/components/login/loginTelphone/AccountLogin.tsx @@ -0,0 +1,117 @@ +import styles from './styles.module.less'; +import { Form, Toast, Button } from '@douyinfe/semi-ui'; +import { userService } from '@server/user.service'; +import { useState, useEffect } from 'react'; +import { pubsub, storage, crypto } from '@utils/index'; +import { language } from '@language/language'; + +export interface IProps {} + +export default function AccountLogin(props: IProps) { + const [captcha, setCaptcha] = useState({ + key: '', + code: '', + }); + + const handleSubmit = async values => { + console.log(values); + const [res, err] = await userService.login({ + account: values.account, + password: values.password, + captchaCode: values.code, + captchaKey: captcha.key, + }); + + if (values.rememberPassword) { + storage.local.set('account', crypto.encrypt(values.account)); + storage.local.set('password', crypto.encrypt(values.password)); + } else { + storage.local.remove('account'); + storage.local.remove('password'); + } + + if (res) { + Toast.success(language.val('login_success')); + } else { + Toast.error(err); + } + if (err) { + // 切换验证码 + getImageKey(); + return; + } + // 2、获取用户详情,设置x-user-info + const [userRes, userError] = await userService.getUserDetail(); + if (userRes) { + (window as any).RouterHistory.push('/workspace/draft'); + pubsub.publish('showLoginModal', false); + } + }; + + useEffect(() => { + getImageKey(); + }, []); + + const getImageKey = async () => { + const [res, err] = await userService.getCaptcha(); + if (res) { + setCaptcha({ + code: res.captcha_code, + key: res.captcha_key, + }); + } + }; + + return ( +
+
handleSubmit(values)} + style={{ width: '100%' }} + > + {({ formState, values, formApi }) => ( + <> + + +
+ + +
+
+ + {language.val('login_remember_password')} + +
+ + + )} + +
+ ); +} diff --git a/src/components/login/loginTelphone/index.ts b/src/components/login/loginTelphone/index.ts new file mode 100644 index 0000000..34d36d3 --- /dev/null +++ b/src/components/login/loginTelphone/index.ts @@ -0,0 +1,3 @@ +import AccountLogin from './AccountLogin'; + +export default AccountLogin; diff --git a/src/components/login/loginTelphone/styles.module.less b/src/components/login/loginTelphone/styles.module.less new file mode 100644 index 0000000..6b0e40a --- /dev/null +++ b/src/components/login/loginTelphone/styles.module.less @@ -0,0 +1,16 @@ +.forms { + font-size: 14px; +} + +.formSpaceItem { + display: flex; + justify-content: space-between; + align-items: center; +} + +.captcha { + height: 30px; + position: relative; + top: 12px; + cursor: pointer; +} diff --git a/src/components/not-found/NotFound.tsx b/src/components/not-found/NotFound.tsx new file mode 100644 index 0000000..147e19a --- /dev/null +++ b/src/components/not-found/NotFound.tsx @@ -0,0 +1,25 @@ +import styles from './not-found.module.less'; + +import React, { Component } from 'react'; + +export default class NotFound extends Component { + + toHome = () => { + location.href = '/'; + } + + render() { + return ( +
+
404----
+
Page Not Found
+
+

对不起,没有找到您所需要的页面,可能是URL不确定,或者页面已被移除。

+ + Back Home + +
+
+ ); + } +} diff --git a/src/components/not-found/index.ts b/src/components/not-found/index.ts new file mode 100644 index 0000000..2d0c485 --- /dev/null +++ b/src/components/not-found/index.ts @@ -0,0 +1,3 @@ +import NotFound from './NotFound'; + +export default NotFound; diff --git a/src/components/not-found/not-found.module.less b/src/components/not-found/not-found.module.less new file mode 100644 index 0000000..28c47c9 --- /dev/null +++ b/src/components/not-found/not-found.module.less @@ -0,0 +1,29 @@ +.not-found { + .not-found-title { + padding-top: 100px; + font-size: 40px; + font-weight: 700; + text-align: center; + line-height: 64px; + color: #838fa1; + } + + .not-found-info { + line-height: 30px; + font-size: 21px; + padding-top: 20px; + text-align: center; + color: #dce2ec; + } + + .not-found-content { + padding: 20px 0; + font-size: 16px; + text-align: center; + color: #96a2b4; + + p { + padding-bottom: 30px; + } + } +} diff --git a/src/components/page-loading/PageLoading.tsx b/src/components/page-loading/PageLoading.tsx new file mode 100644 index 0000000..77f03d9 --- /dev/null +++ b/src/components/page-loading/PageLoading.tsx @@ -0,0 +1,92 @@ +import styles from './style.module.less'; +import React, { useEffect, useRef, useReducer } from 'react'; +import { pubsub } from '@utils/pubsub'; +import { Progress } from '@douyinfe/semi-ui'; + +export interface ProgressData { + progress: number; // 手动传入进度:?: number | undefined + start: boolean; // 开始 ?: boolen + end: boolean; // 结束 ?:boolen + time: number; // 默认加载时间间隔 +} + +/** + * 用法: + * pubsub.publish('pageLoading', { + start: true + }); + pubsub.publish('pageLoading', { + end: true + }); + */ +export default function PageLoading() { + const [, forceUpdate] = useReducer(x => x + 1, 0); + const val = useRef(null); + const reRender = useRef(0); + const timer = useRef(); + + const autoLoading = (time = 50) => { + timer.current = setTimeout(() => { + val.current = val.current + (90 - val.current) / 10; + forceUpdate(); + autoLoading(); + }, time); + }; + + useEffect(() => { + /** + * data: { + * progress: undefined, // 手动传入进度:?: number | undefined + * start, // 开始 ?: boolen + * end, // 结束 ?:boolen + * time: 1000 // 默认加载时间间隔 + * } + */ + pubsub.subscribe('pageLoading', (_eventName, data: ProgressData) => { + console.log('data--->', data); + if (timer.current) { + reRender.current++; + clearTimeout(timer.current); + timer.current = null; + } + + if (data.progress !== undefined) { + val.current = data.progress; + forceUpdate(); + } else if (data.start) { + val.current = 0; + forceUpdate(); + autoLoading(data.time); + } else if (data.end) { + val.current = 100; + forceUpdate(); + timer.current = setTimeout(() => { + val.current = null; + forceUpdate(); + }, 400); + } + }); + return () => { + clearTimeout(timer.current); + pubsub.unsubscribe('pageLoading'); + }; + }, []); + + if (val.current === null) { + return null; + } + + return ( +
+ +
+ ); +} diff --git a/src/components/page-loading/index.ts b/src/components/page-loading/index.ts new file mode 100644 index 0000000..67bcc11 --- /dev/null +++ b/src/components/page-loading/index.ts @@ -0,0 +1,3 @@ +import PageLoading from './PageLoading'; + +export default PageLoading; diff --git a/src/components/page-loading/style.module.less b/src/components/page-loading/style.module.less new file mode 100644 index 0000000..2865ed7 --- /dev/null +++ b/src/components/page-loading/style.module.less @@ -0,0 +1,10 @@ +.loading { + position: fixed; + top: -1px; + width: 100%; + z-index: 9999; + line-height: 0; + :global(.ant-progress){ + line-height: 0; + } +} diff --git a/src/components/sub-header/SubHeader.tsx b/src/components/sub-header/SubHeader.tsx new file mode 100644 index 0000000..da60d89 --- /dev/null +++ b/src/components/sub-header/SubHeader.tsx @@ -0,0 +1,17 @@ +import styles from './styles.module.less'; + +export interface IProps { + title: string; + desc: string; +} + +export default function SubHeader(props: IProps) { + return ( +
+ +

{props.title}

+

{props.desc}

+
+
+ ); +} diff --git a/src/components/sub-header/index.ts b/src/components/sub-header/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/sub-header/styles.module.less b/src/components/sub-header/styles.module.less new file mode 100644 index 0000000..a269df2 --- /dev/null +++ b/src/components/sub-header/styles.module.less @@ -0,0 +1,16 @@ +.bg { + height: 240px; + margin-top: 60px; + background-image: url('/assets/images/userbg.png'); + background-repeat: no-repeat; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + color: #fff; + h2 { + font-weight: bolder; + margin-bottom: 20px; + font-size: 38px; + } +} diff --git a/src/components/water-full/WaterFull.tsx b/src/components/water-full/WaterFull.tsx new file mode 100644 index 0000000..c48f4cb --- /dev/null +++ b/src/components/water-full/WaterFull.tsx @@ -0,0 +1,95 @@ +// import { util } from '@utils/index'; +// import { useEffect, useState } from 'react'; +import { useResizeDetector } from 'react-resize-detector'; +import styles from './waterfull.module.less'; +import IconSpin from '@douyinfe/semi-icons/lib/es/icons/IconSpin'; +import classNames from 'classnames'; + +export interface IProps { + list?: any[]; + itemWidth?: number; + style?: Record; + item?: any; + sType?: string; + columns?: number; + itemClassName?: string; + itemHeight?: boolean; // 固定高度 +} + +// const defaultList = new Array(40).fill(1).map((d, i) => { +// return { +// width: util.randomNum(300, 500), +// height: util.randomNum(100, 600), +// }; +// }); + +export default function WaterFall(props: IProps) { + const { width = 0, ref } = useResizeDetector(); + const list = props.list; + const minHeight = 60; + + return ( +
+ {!list && } + {list && + (() => { + // 每个item的宽度,间隙默认是10px,反向计算出宽度 + let itemWidth = props.itemWidth || 120; + const gap = 5; + let columns = props.columns ? props.columns : ~~(width / (itemWidth + gap)); + if (!columns) { + columns = 1; + } + itemWidth = ~~((width - (columns - 1) * gap) / columns); + + // 瀑布流算法,自动计算高度和坐标 + const columItems: any[][] = []; + const totalHeight = new Array(columns).fill(0); + if (columns === 1) { + columItems.push(list); + } else { + list.forEach(elem => { + const min = Math.min(...totalHeight); + const index = totalHeight.findIndex(a => a === min); + // 最大高度不能超过宽度的2倍 + let itemHeight = Math.min(itemWidth * (elem.height / elem.width), itemWidth * 2); + itemHeight = Math.max(itemHeight, minHeight); + + totalHeight[index] += itemHeight + gap; + if (!columItems[index]) { + columItems[index] = []; + } + columItems[index].push(elem); + }); + } + + return columItems.map((items, i) => { + return ( +
+ {items.map(d => { + let hei = Math.min(~~(itemWidth * (d.height / d.width)), itemWidth * 2); + return ( +
+ {props.item ? props.item(d) : null} +
+ ); + })} +
+ ); + }); + })()} +
+ ); +} diff --git a/src/components/water-full/index.ts b/src/components/water-full/index.ts new file mode 100644 index 0000000..c437302 --- /dev/null +++ b/src/components/water-full/index.ts @@ -0,0 +1,3 @@ +import WaterFull from './WaterFull'; + +export default WaterFull; diff --git a/src/components/water-full/waterfull.module.less b/src/components/water-full/waterfull.module.less new file mode 100644 index 0000000..09c672b --- /dev/null +++ b/src/components/water-full/waterfull.module.less @@ -0,0 +1,15 @@ +.list { + margin: 0 10px 0 20px; + overflow-x: hidden; + + .colums { + vertical-align: top; + display: inline-block; + } + + .itemWrap { + background-color: var(--theme-wateritem); + border-radius: 3px; + overflow: hidden; + } +} diff --git a/src/config/Logo.tsx b/src/config/Logo.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/config/index.ts b/src/config/index.ts new file mode 100644 index 0000000..4a69d94 --- /dev/null +++ b/src/config/index.ts @@ -0,0 +1,25 @@ +// 配置 +const config = { + secretKey: 'x&S#acLCx', // + apiHost: '/api/v1', + editorHost: 'https://localhost:3002/editor', + prefix: 'video', // 项目前缀,用于设置localStroage的名称 + // resourcesHost: 'https://cdn.h5ds.com', // CDN资源路径 + loginSuccessLink: '/workspace/draft', // 登录成功后跳转地址 + resourcesHost: 'https://cdn.h5ds.com', // CDN资源路径 + basename: '', // history路由前缀 + env: 'dev', + EModuleEffectSourcePath: 'https://cdn.h5ds.com/assets/effectcanvas/', + workerPath: '/assets/worker', + host: 'https://video.h5ds.com', // 二维码扫描有用到 +}; + +// 生产环境参数 +if (import.meta.env.PROD) { + config.editorHost = '/editor'; + config.env = 'prod'; + // config.resourcesHost = 'https://videomix.h5ds.com'; + // config.apiHost = (window as any).apiHost || ''; +} + +export { config }; diff --git a/src/config/initData.ts b/src/config/initData.ts new file mode 100644 index 0000000..6ec9dd6 --- /dev/null +++ b/src/config/initData.ts @@ -0,0 +1,26 @@ +export function getInitData() { + return { + source_id: '', //来源Id + category_id: 0, //分类Id + name: '未命名', //名称 + description: '未命名', //描述 + duration: 0, //时长(毫秒) + width: 1920, //宽度 + height: 1080, //高度 + thumb: '', //封面图url + data: { + title: '未命名', + createTime: 0, + updateTime: 0, + poster: '', + width: 1920, + height: 1080, + background: {}, + transitions: [], + cameras: [], + captions: [], + elements: [], + resouces: [], + }, //数据 + }; +} diff --git a/src/config/sdk.d.ts b/src/config/sdk.d.ts new file mode 100644 index 0000000..da07b49 --- /dev/null +++ b/src/config/sdk.d.ts @@ -0,0 +1,373 @@ +import { MovieData, PluginConfig } from 'video-core-sdk'; + +// 图&文生成视频 +export interface AiVideoParams { + task_type: 'huoshan_video'; + params: { + model: string; // "model": "doubao-seedance-1-0-pro-250528", + content: { + type: 'text'; + text: string; + }[]; + generate_audio?: boolean; // doubao-seedance-1-5-pro-251215 模型才有音频 + // 是否生成音频,默认是false + ratio: string; // 9:16 16:9 1:1 3:4 4:3,21:9 默认是adaptive + duration: number; // 时长 + fps: number; // 帧率,默认是30fps + resolution: string; // 分辨率,默认是 720p + seed: number; // 默认是-1 + }; +} + +export interface AiChatParams { + provider?: 'deepseek' | undefined; + model: string; // "model": "doubao-seed-1-6-251015", 默认使用:"deepseek-v4-pro" + messages: { + role: 'user' | 'system'; + content: string; + }[]; +} + +// 图+视频 生成 新的视频 +export interface AiVideo2VideoParams { + task_type: 'huoshan_cv_video'; + params: { + image_url: string; + driving_video_info: { + store_type: number; // 默认是0 + video_url: string; + }; + }; +} + +// 图片生成 +export interface AiImageParams { + task_type: 'huoshan_image'; + params: { + model: string; // "model": "doubao-seedream-4-5-251128", + prompt: string; + size: '2K' | '1K' | '4K'; + watermark: false; + }; +} + +export interface VideoEditorSDKParams { + target: HTMLDivElement; + appid?: string; + token?: string; + // 水印配置 + watermark?: IWatermark; + userInfo?: UserInfo; + movieData?: MovieData; // 选填二选一,工程数据,工程数据和作品ID必须传入一个,会优先读取工程数据,如果没有传入工程数据,会通过appid去api server 去获取工程数据 + workerPath?: string; // worker资源地址: decode.worker.js gif.worker.js + apiServer?: APIServer; + plugins?: PluginConfig[]; + resourcesHost?: string; + sides?: SideItem[] | null; // 侧边栏 + saveAppCallback?: (res: any) => void; // 保存的回调 + exConfig?: { + mobileUpload?: boolean; // 是否移动端上传 + // 最大媒体轨道数量 + maxMediaTrackNum: number; + // 支持多语言 + supportLanguage: boolean; + // 显示项目按钮 + showProjectButton: boolean; + logoLink?: string; + // 自定义logo链接 + logoOnClick?: () => void; // 如果填写了,logoLink失效 + // 自定义logo + logo: (themeType: 'light' | 'dark') => string; + }; + loginButtonConfig?: { + id: string; // 容器的ID + className: string; // 容器的类名 + Component?: React.FC; // 登录组件 + }; + exportButtonConfig?: { + id: string; // 容器的ID + className: string; // 容器的类名 + Component?: React.FC; // 导出组件 + }; +} + +export interface UserInfo { + id: string; + name: string; + avatar: string; + logout: () => void; // 退出登录 +} + +export interface SideItem { + type: string; + name: string; + enName: string; + icon: React.ReactNode; + simple?: boolean; // 是否简单模式展示 + panel?: React.ReactNode; +} + +export interface PageParams { + page: number; + page_size: number; +} + +// 素材参数 +export interface MaterialParams extends PageParams { + type: string; + tag?: string; + pid?: string; + category_id?: string | number; + convert_status?: number; // 转码任务状态(-1-不处理 0-待处理1-处理中 2-处理成功3-处理失败) + keyword?: string; +} + +export interface TemplateParams extends PageParams { + category_id?: string | number; + keyword?: string; +} + +export interface CreateAppParams { + source_id: string; //来源Id + category_id: string | number; //分类Id + name: string; //名称 + description: string; //描述 + duration: number; //时长(毫秒)// editor.movie.getTotalTime() + width: number; //宽度 + height: number; //高度 + thumb: string; //封面图url + data: MovieData; // JSON数据 +} + +export interface UpdateAppParams extends Partial { + id: string; +} + +export interface UserMaterialParams extends PageParams { + app_id?: string; + keyword: string; + category_id: string; + type?: string; + pid?: string; +} + +export interface CreateUserMaterialParams { + app_id: string; + type?: string; + name: string; + from?: string; // 来源 'user' | 'system' + category_id?: string; + urls: { url: string; thumb?: string }; + attrs: Record; + size?: number; +} + +export interface CreateTTSParams { + version: string; // 版本号 + emotion: string; // 情绪 + text: string; // 内容 + config: { + speaker: string; // 发音人 + audio_params: { + format: 'mp3' | 'wav'; + sample_rate: number; // 采样率 24000 + }; + additions: { + silence_duration?: number; //默认是0, 静音时长 1000 设置该参数可在句尾增加静音时长,范围0~30000ms。(注:增加的句尾静音主要针对传入文本最后的句尾,而非每句话的句尾) + enable_language_detector?: boolean; // 自动识别语种 + disable_markdown_filter?: boolean; // 是否开启markdown解析过滤,为true时,解析并过滤markdown语法,例如,**你好**,会读为“你好”,为false时,不解析不过滤,例如,**你好**,会读为“星星‘你好’星星” + disable_emoji_filter?: boolean; // 开启emoji表情在文本中不过滤显示,默认为false,建议搭配时间戳参数一起使用。 + mute_cut_remain_ms?: string; // 该参数需配合mute_cut_threshold参数一起使用,其中:"mute_cut_threshold": "400", // 静音判断的阈值(音量小于该值时判定为静音) + max_length_to_filter_parenthesis?: number; //是否过滤括号内的部分,0为不过滤,100为过滤 + explicit_language?: string; // 仅读指定语种的文本 zh-cn、不给定参数,正常中英混crosslingual 启用多语种前端(包含zh/en/ja/es-mx/id/pt-br)zh-cn 中文为主,支持中英混en 仅英文ja 仅日文es-mx 仅墨西id 仅印尼pt-br 仅巴葡 + explicit_dialect?: string; // dongbei(东北话)shaanxi(陕西话)sichuan(四川话) + /** + * 语音合成的辅助信息,用于模型对话式合成,能更好的体现语音情感; + 可以探索,比如常见示例有以下几种: + + 语速调整 + 比如:context_texts: ["你可以说慢一点吗?"] + 情绪/语气调整 + 比如:context_texts=["你可以用特别特别痛心的语气说话吗?"] + 比如:context_texts=["嗯,你的语气再欢乐一点"] + 音量调整 + 比如:context_texts=["你嗓门再小点。"] + 音感调整 + 比如:context_texts=["你能用骄傲的语气来说话吗?"] + */ + context_texts?: string[]; // 上下文文本,用于生成上下文相关的语音 + /** + * 是否开启cot解析能力。cot能力可以辅助当前语音合成,对语速、情感等进行调整。 + 注意: + + 音色支持范围:仅限声音复刻2.0复刻的音色 + 文本长度:单句的text字符长度最好小于64(cot标签也计算在内) + cot能力生效的范围是单句 + 示例: + 支持单组和多组cot标签:工作占据了生活的绝大部分,只有去做自己认为伟大的工作,才能获得满足感。不管生活再苦再累,都绝不放弃寻找。 + */ + use_tag_parser?: boolean; + }; + mix_speaker?: Record; + // voice_type: string; // 音色 + // speed_ratio?: number; // 语速 //语速,[0.8~2],默认为 1,通常保留一位小数即可 + }; + // options: Record; +} + +export interface UpdateUserMaterialParams extends Partial { + id: string; +} + +export interface UserMaterialTypeParams extends PageParams { + type: string; // material +} + +// 获取收藏列表的参数 +export interface CollectParams extends PageParams { + type: string; + category_id?: string | number; + keyword?: string; +} + +export interface UploadBase64Params { + content: string; + name: string; + file_type?: string; +} + +export interface AppDetailRes {} + +export interface TemplateItemRes {} + +export interface MaterialItemRes { + id: string; + name: string; + size: number; + updatedAt: string; + createdAt: string; + type: string; + attrs: { + duration?: number; + wave?: string; + frames?: string; + videoWidth?: number; + videoHeight?: number; + naturalWidth?: number; + naturalHeight?: number; + width?: number; + height?: number; + }; + urls: { + url: string; + thumb: string; + filename: string; + }; +} + +export type Err = string | null; + +export interface APIServer { + // 获取appData数据 + getAppData: (appid: string) => Promise<[{ url: string }, Err]>; + // 创建新的作品 + createApp: (params: CreateAppParams) => Promise<[{ id: string }, Err]>; + // 云合成 + createTask: (data: { + source: 'user_app'; + source_id: string; + params: { + fps: number; + resolution: string; + jsonUrl: string; + }; + }) => Promise<[{ url: string }, Err]>; + + // 获取AI视频生成任务列表 + getAiTaskList: (params: PageParams) => Promise<[any, Err]>; + // 删除AI视频生成任务 + deleteAiTask: (ids: string[]) => Promise<[string, Err]>; + // 创建AI视频生成任务 + createAiTask: (params: st.AiVideoParams | st.AiImageParams) => Promise<[any, Err]>; + // 轮训AI视频生成任务状态 + seekAiTaskStatus: (ids: string[]) => Promise<[any, Err]>; + + // 轮训上传状态 + seekVideoReplayStatus: (ids: string[]) => Promise<[any, Err]>; + + // 服务端执行视频&资源的倒放业务 + videoReplay: (id: string, from: 'user' | 'system' | 'other' | 'admin') => Promise<[any, Err]>; + + // 更新作品 + updateApp: (params: UpdateAppParams) => Promise<[string, Err]>; + // 删除作品 + deleteApp?: (id: string) => Promise<[string, Err]>; + // 获取模版的分类信息 + getTemplateTypes: () => Promise<[{ name: string; id: string }[], Err]>; + // 获取模版列表 + getTemplates: (params: TemplateParams) => Promise<[{ name: string; id: string }[], Err]>; + // 获取用户信息 + getUserInfo: (token: string) => Promise<[{ name: string; id: string }[], Err]>; + // 获取素材的分类 + getMaterialTypes: (type: string) => Promise<[{ name: string; id: string }[], Err]>; + // 获取素材 + getMaterials: (params: MaterialParams) => Promise< + [ + { + data: { id: string; name: string; urls: { url: string; thumb: string } }[]; + current_page: number; + total: number; + }, + Err, + ] + >; + // 收藏元素 + collect: (params: { source_id: string; type: string }) => Promise<[string, Err]>; + // 取消收藏 + cancelCollect: (sourceIds: string[], type: string) => Promise<[string, Err]>; + // 收藏列表 + getCollects: (params: CollectParams) => Promise<[{ id: string; name: string }[], Err]>; + // 上传base64图片 + uploadBase64: (params: UploadBase64Params) => Promise<[{ storage_path: string }, Err]>; + // 表单上传 + formUpdate: (params: FormData) => Promise<[{ storage_path: string }, Err]>; + // 获取用户素材 + getUserMaterial: (params: MaterialParams) => Promise<[{ data: MaterialItemRes[]; total: number }, Err]>; + // 获取用户的素材分类 + getUserMaterialType: ( + params: UserMaterialTypeParams, + ) => Promise<[{ data: { id: string; name: string }[]; total: number }, Err]>; + // 删除用户素材 + deleteUserMaterial: (ids: string[]) => Promise<[string, Err]>; + // 新增用户素材 + createUserMaterial: (params: CreateUserMaterialParams) => Promise<[MaterialItemRes, Err]>; + //tts + createTTS: (params: CreateTTSParams) => Promise<[{ storage_path: string }, Err]>; + //ai字幕,传入音频的url,返回taskId,轮训taskId查询转换结果 + createCaption: (url: string) => Promise<[{ TaskId: string }, Err]>; + // 轮训 + seekCaptionTask: (taskId: string) => Promise<[any, Err]>; + // 修改用户素材 + updateUserMaterial: (params: UpdateUserMaterialParams) => Promise<[MaterialItemRes, Err]>; + + // ai 对话(SSE 流式返回) + openAiChatSSE: (params: AiChatParams) => Promise<[any, Err]>; + // ai 对话(一次性返回) + openAiChat: (params: AiChatParams) => Promise<[any, Err]>; + // 查询 AI 任务详情 + aiTaskInfo: (id: string) => Promise<[any, Err]>; + + // ========== VIP / 积分 ========== + // 积分套餐列表 + getCreditPackages: () => Promise<[any, Err]>; + // 创建积分订单 + createCreditOrder: (packageId: string | number) => Promise<[any, Err]>; + // 积分订单状态 + getCreditOrderStatus: (id: string | number) => Promise<[any, Err]>; + // VIP 套餐列表 + getVipPackages: () => Promise<[any, Err]>; + // 创建 VIP 订单 + createVipOrder: (packageId: string | number, vipLevel?: number) => Promise<[any, Err]>; + // VIP 订单状态 + getVipOrderStatus: (id: string | number) => Promise<[any, Err]>; +} diff --git a/src/config/sdk.ts b/src/config/sdk.ts new file mode 100644 index 0000000..0a871bf --- /dev/null +++ b/src/config/sdk.ts @@ -0,0 +1 @@ +export type { SideItem } from './sdk.d'; diff --git a/src/config/types.ts b/src/config/types.ts new file mode 100644 index 0000000..eacffc3 --- /dev/null +++ b/src/config/types.ts @@ -0,0 +1,22 @@ +// 布局名称 +export type LayoutName = 'sources' | 'timeline' | 'options' | 'canvas' | 'header'; + +// 资源面板类型 +export type SourceType = + | 'my' + | 'template' + | 'image' + | 'video' + | 'audio' + | 'text' + | 'caption' + | 'filter' + | 'effect' + | 'transition' + | 'lottie' + | 'background' + | 'more' + | string; + +// 设置面板类型 +export type ElementOptionType = 'basic' | 'audio' | 'speed' | 'animation' | 'colour' | 'caption' | 'mask'; diff --git a/src/database/localDB.ts b/src/database/localDB.ts new file mode 100644 index 0000000..8710403 --- /dev/null +++ b/src/database/localDB.ts @@ -0,0 +1,100 @@ +import Dexie, { type Table } from 'dexie'; + +/** 素材元数据 */ +export interface MaterialRecord { + id: string; + appId: string; // appid 分类 + name: string; + type: 'video' | 'image' | 'audio' | string; // 素材类型type + fileName: string; // 本地存储的文件名 + relativePath: string; // 相对路径,如 "materials/appId/video/xxx.mp4" + thumbFileName?: string; // 封面图本地文件名 + thumbRelativePath?: string; // 封面图相对路径 + framesFileName?: string; // 帧预览图本地文件名 + framesRelativePath?: string; // 帧预览图相对路径 + waveFileName?: string; // 音波图本地文件名 + waveRelativePath?: string; // 音波图相对路径 + size: number; // 文件大小(字节) + attrs: { + width?: number; + height?: number; + duration?: number; + naturalWidth?: number; + naturalHeight?: number; + videoWidth?: number; + videoHeight?: number; + frames?: string; + wave?: string; + delayFrame?: number; + totalFrame?: number; + delays?: number[]; + rotate?: boolean; + noAudioTracks?: boolean; + frameScale?: number; + rotation?: number; + [key: string]: any; + }; + from?: 'user' | 'system'; + tag?: string; + createdAt: number; // 时间戳 + updatedAt: number; +} + +/** 文件夹句柄记录 */ +export interface FolderHandleRecord { + id: string; // 固定 key,如 'root' + handle: FileSystemDirectoryHandle; +} + +/** 项目 JSON 数据 */ +export interface ProjectRecord { + id: string; // appId + name: string; // 项目名称 + categoryId?: string; // 分类ID + thumb?: string; // 封面图 + description?: string; // 描述 + data: any; // MovieData JSON + createdAt: number; // 创建时间 + updatedAt: number; +} + +/** 分类/文件夹记录 */ +export interface CategoryRecord { + id: string; // 分类ID,如 'local_cat_xxx' + name: string; + type: 'project' | 'material'; // 分类类型 + createdAt: number; + updatedAt: number; +} + +/** 上传文件记录 (uploadBase64 / formUpdate) */ +export interface UploadRecord { + id: string; + content: string; // base64 data URL 或文本内容 + name: string; + file_type?: string; + blobType?: string; // blob MIME type + storage_path: string; // 生成的伪 storage_path,供调用方使用 + createdAt: number; +} + +class LocalDB extends Dexie { + materials!: Table; + folderHandles!: Table; + projects!: Table; + categories!: Table; + uploads!: Table; + + constructor() { + super('H5VideoLocalDB'); + this.version(5).stores({ + materials: 'id, appId, type, createdAt', + folderHandles: 'id', + projects: 'id, categoryId, updatedAt', + categories: 'id, type', + uploads: 'id, createdAt', + }); + } +} + +export const localDB = new LocalDB(); diff --git a/src/hooks/useLocalStorage.ts b/src/hooks/useLocalStorage.ts new file mode 100644 index 0000000..c30eb10 --- /dev/null +++ b/src/hooks/useLocalStorage.ts @@ -0,0 +1,163 @@ +import { useState, useEffect, useCallback, useRef } from 'react'; +import type { MaterialRecord } from '@database/localDB'; +import { + initLocalFolder, + getRootHandle, + resetLocalFolder, + addMaterial, + getMaterials, + deleteMaterial, + getMaterialFileUrl, + saveProject, + getProject, + deleteProject, + isFSApiSupported, +} from '@services/localStorageService'; + +interface UseLocalStorageReturn { + /** API 是否可用 */ + supported: boolean; + /** 文件夹是否已就绪 */ + ready: boolean; + /** 初始化中 */ + loading: boolean; + /** 素材列表 */ + materials: MaterialRecord[]; + /** 初始化本地文件夹 */ + initFolder: () => Promise; + /** 重新选择文件夹 */ + reSelectFolder: () => Promise; + /** 添加素材 */ + addMaterialItem: (params: { + name: string; + type: string; + file: File; + thumbFile?: File | Blob; + attrs?: Record; + from?: 'user' | 'system'; + tag?: string; + }) => Promise; + /** 删除素材 */ + removeMaterial: (id: string) => Promise; + /** 获取素材文件 URL */ + getFileUrl: (relativePath: string) => Promise; + /** 刷新素材列表 */ + refreshMaterials: () => Promise; + /** 保存项目 */ + saveProjectData: (data: any) => Promise; + /** 获取项目 */ + getProjectData: () => Promise; + /** 删除项目 */ + removeProject: () => Promise; +} + +export function useLocalStorage(appId: string): UseLocalStorageReturn { + const supported = isFSApiSupported(); + const [ready, setReady] = useState(false); + const [loading, setLoading] = useState(false); + const [materials, setMaterials] = useState([]); + const initializedRef = useRef(false); + + const refreshMaterials = useCallback(async () => { + const list = await getMaterials(appId); + setMaterials(list); + }, [appId]); + + const initFolder = useCallback(async () => { + if (initializedRef.current) return true; + setLoading(true); + try { + const handle = await initLocalFolder(); + if (handle) { + setReady(true); + initializedRef.current = true; + await refreshMaterials(); + return true; + } + return false; + } finally { + setLoading(false); + } + }, [refreshMaterials]); + + const reSelectFolder = useCallback(async () => { + await resetLocalFolder(); + initializedRef.current = false; + return initFolder(); + }, [initFolder]); + + const addMaterialItem = useCallback( + async (params: { + name: string; + type: string; + file: File; + thumbFile?: File | Blob; + attrs?: Record; + from?: 'user' | 'system'; + tag?: string; + }) => { + const record = await addMaterial({ ...params, appId }); + if (record) { + await refreshMaterials(); + } + return record; + }, + [appId, refreshMaterials], + ); + + const removeMaterial = useCallback( + async (id: string) => { + await deleteMaterial(id); + await refreshMaterials(); + }, + [refreshMaterials], + ); + + const getFileUrl = useCallback(async (relativePath: string) => { + return getMaterialFileUrl(relativePath); + }, []); + + const saveProjectData = useCallback( + async (data: any) => { + await saveProject(appId, data); + }, + [appId], + ); + + const getProjectData = useCallback(async () => { + return getProject(appId); + }, [appId]); + + const removeProject = useCallback(async () => { + await deleteProject(appId); + }, [appId]); + + // 首次挂载自动尝试初始化 + useEffect(() => { + if (supported) { + getRootHandle().then(handle => { + if (handle) { + setReady(true); + initializedRef.current = true; + refreshMaterials(); + } + }); + } + }, [supported, refreshMaterials]); + + return { + supported, + ready, + loading, + materials, + initFolder, + reSelectFolder, + addMaterialItem, + removeMaterial, + getFileUrl, + refreshMaterials, + saveProjectData, + getProjectData, + removeProject, + }; +} diff --git a/src/language/Intl.tsx b/src/language/Intl.tsx new file mode 100644 index 0000000..b4cc29b --- /dev/null +++ b/src/language/Intl.tsx @@ -0,0 +1,39 @@ +import React from 'react'; + +import { locals } from './language'; +import { storage } from '@utils/storage'; + +interface IProps { + name: string; + data?: any; + type?: string; +} + +/** + * + * @param {string} name 字段名称 + * @param {object} data 模板参数:默认是undefined + * @param {string} type 语言类型,默认是undefined + */ +function Intl(props: IProps): JSX.Element { + const { name, data, type } = props; + const _window = window as any; + + if (!_window.language) { + _window.language = storage.local.get('language') || 'zh-CN'; + } + if (!locals[_window.language][name]) { + console.error('name', name); + console.error('locals[window.language]', locals[_window.language]); + } + let str = locals[type || _window.language][name] || 'not found'; + if (data) { + for (const key in data) { + str = str.replaceAll(`{{${key}}}`, data[key]); + } + } + + return <>{str}; +} + +export default Intl; diff --git a/src/language/README.md b/src/language/README.md new file mode 100644 index 0000000..7e50df8 --- /dev/null +++ b/src/language/README.md @@ -0,0 +1,33 @@ +# 国际化处理 + +### React + +```javascript + + + +``` + +### Javascript API + +```javascript + +实例对象:language + +/** + * 获取对应的国际化内容 + * @param {string} name 字段名称 + * @param {object} data 模板参数:默认是undefined + * @param {string} type 语言类型,默认是undefined + */ +language.val('home_hello', {name: 'Mark'}); + +// str: `hello world! {{name}}` + +// 获取当前国际化类型 +language.getLanguage(); + +// 切换国际化 +language.setLanguage('zh-CN'); + +``` diff --git a/src/language/enUS.ts b/src/language/enUS.ts new file mode 100644 index 0000000..55165d6 --- /dev/null +++ b/src/language/enUS.ts @@ -0,0 +1,658 @@ +export const enUS = { + user_workspace: 'Workspace', + user_center: 'User Center', + user_theme: 'Theme', + user_logout: 'Logout', + user_language: '中文/EN', + user_userid: 'User ID', + + // 侧边栏菜单 + sidemenu_template: 'Template', + sidemenu_my: 'My', + sidemenu_caption: 'Caption', + sidemenu_image: 'Image', + sidemenu_video: 'Video', + sidemenu_audio: 'Audio', + sidemenu_text: 'Text', + sidemenu_filter: 'Filter', + sidemenu_sticker: 'Sticker', + sidemenu_effect: 'Effect', + sidemenu_transition: 'Transition', + sidemenu_more: 'More', + + // 公共 + common_name: 'X-Clip', + common_search: 'Search', + common_loading: 'Loading...', + common_uploading: 'Uploading...', + common_upload_success: 'Upload successful!', + common_save_success: 'Save successful!', + common_toast_error: 'Operation failed!', + common_toast_success: 'Operation successful!', + common_toast_replace_success: 'Replacement successful!', + common_toast_transition_limit: 'Please select image & video elements to add transitions', + common_toast_video_replace_limit: `Please use videos with duration greater than or equal to {{duration}} seconds`, + common_toast_collect_success: 'Collection successful!', + common_toast_collect_cancel_success: 'Cancel collection successful!', + common_toast_poster_success: 'Cover image set successfully!', + common_toast_login_error: 'Please log in to the system first', + common_toast_no_update: 'No changes detected, no update needed', + + // header + header_project_no_name: 'Untitled Project', + header_pro: 'Pro', + header_simple: 'Simple', + header_export: 'Export', + header_login: 'Login/Register', + + header_project_file: 'Project File', + header_project_title: 'Project File Import/Export', + header_project_upload_tip1: 'Click to upload project file or drag and drop here', + header_project_upload_tip2: 'Supports JSON format project files', + header_project_confirm_title: 'System Notification', + header_project_confirm_content: 'Importing a new project will overwrite the current project. Continue?', + header_project_export: 'Export Project File', + header_project_toast: 'Invalid data format', + header_project_poster: 'Capture Video Cover', + + // 导出弹窗 + export_poster: 'Video Cover', + export_title: 'Video Name', + export_title_placeholder: 'Please enter video name', + export_size: 'Resolution', + export_fps: 'Frame Rate', + export_speed: 'Speed', + export_gif_width: 'Canvas Width', + export_format: 'Export Format', + export_button: 'Local Rendering', + export_cloud_button: 'Cloud Rendering', + export_success_info: 'Export task submitted to the cloud. Exiting the page in 3 seconds.', + + // 我的 + my_upload: 'Upload', + my_upload_mobile_link: 'Upload Mobile', + my_upload_refresh: 'Refresh List', + my_tab_material: 'Current Materials', + my_tab_all_material: 'All Materials', + my_tab_no_material: 'No materials in this project. Please upload first.', + my_select_root: 'Root Directory', + + my_nologin_tip: 'You are not logged in. Please', + my_login: 'Login', + + // 字幕 + caption_add: 'Add Subtitle', + caption_ai: 'AI Subtitle', + caption_ai_confirm_title: 'System Notification', + caption_ai_confirm_desc: 'AI subtitle recognition will overwrite current subtitles. Continue?', + caption_null: 'No subtitles', + caption_default: 'Subtitle content', + + // 更多 + more_plus: 'More Plugins', + + // 快捷键 + shortcut_key: 'Shortcut Keys', + shortcut_key_split: 'Split', + shortcut_key_copy: 'Copy', + shortcut_key_paste: 'Paste', + shortcut_key_cut: 'Cut', + shortcut_key_delete: 'Delete', + shortcut_key_undo: 'Undo', + shortcut_key_redo: 'Redo', + shortcut_key_play: 'Play/Pause', + shortcut_key_right: 'Nudge Right', + shortcut_key_left: 'Nudge Left', + shortcut_key_up: 'Nudge Up', + shortcut_key_down: 'Nudge Down', + shortcut_key_timeline_zoomin: 'Timeline Zoom In', + shortcut_key_timeline_zoomout: 'Timeline Zoom Out', + shortcut_key_save: 'Save', + shortcut_key_space: 'Space', + + // 时间轴 + timeline_top_redo: 'Undo', + timeline_top_undo: 'Redo', + timeline_top_split: 'Split', + timeline_top_delete: 'Delete', + timeline_top_flip: 'Flip', + timeline_top_copy: 'Copy', + timeline_top_paste: 'Paste', + timeline_top_separate: 'Audio-Video Separation', + timeline_top_clip: 'Crop', + timeline_top_clip_time: 'Crop Time', + timeline_top_background_color: 'Background Color', + timeline_top_ai_smear: 'AI Smear Erase', + timeline_top_ai_separation: 'AI Matting', + timeline_top_ai_segmentation: 'AI Portrait Segmentation', + timeline_top_add_frame: 'Add Keyframe', + timeline_top_delete_frame: 'Delete Keyframe', + timeline_top_copy_frame: 'Copy Keyframe', + timeline_top_paste_frame: 'Paste Keyframe', + timeline_top_freeze: 'Freeze', + timeline_lock: 'Lock', + timeline_hide: 'Hide', + timeline_show: 'Show', + timeline_top_forbidden_audio: 'Mute/Unmute', + timeline_top_copy_success: 'Copy successful!', + timeline_top_cut_success: 'Element cut', + timeline_top_copy_error: 'Please copy element first', + timeline_top_paste_type_error: 'Unsupported paste element type', + timeline_top_ai_removebg: 'AI Remove Background', + timeline_top_ai_removebg_error: 'Please select image', + + timeline_top_notfound_error: 'Resource not found', + timeline_top_please_select_element: 'Please select element first', + timeline_top_please_select_range: 'Please drag cursor to selected element range', + + timeline_top_no_frame_data: 'No frame data', + timeline_top_paste_success: 'Paste successful!', + timeline_top_please_select_track: 'Please select track first', + timeline_top_split_tips: 'Please move timeline to element middle for splitting', + timeline_top_please_select_image: 'Please click image to get selection area', + timeline_top_please_upgrade_browser: 'Please upgrade to Chrome version 113 or above to use this feature', + timeline_top_ai_matting_tips: + '1. Click the element to be matted; 2. Click confirm after selection area appears to start automatic matting', + timeline_top_ai_matting_confirm: 'Confirm', + timeline_top_ai_matting_please_select_video: 'Please select video element first', + timeline_top_ai_matting_no_modify: 'No modifications made', + timeline_top_ai_matting_unmarked: 'Unmarked', + timeline_cameraTrack: 'Camera Track', + timeline_captionTrack: 'Caption Track', + + // 设置区域 + option_tab_base: 'Basic', + option_tab_animation: 'Animation', + option_tab_text_animation: 'Text Animation', + option_tab_filter: 'Filter', + option_tab_mask: 'Mask', + option_tab_audio: 'Audio', + option_tab_effect: 'Effect', + option_tab_effects: 'Effects', + option_tab_transition: 'Transition', + option_tab_sticker: 'Sticker', + option_speed: 'Speed', + option_strength: 'Strength', + option_mask_shape: 'Mask Shape', + + // 元素设置 + option_template_scene_index: 'Scene Number', + option_template_replaceable: 'Template Replaceable', + option_template_info: 'Template Description', + option_export_data: 'Export Data', + option_align: 'Alignment', + option_align_left: 'Left Align', + option_align_center: 'Horizontal Center', + option_align_horizontal_space: 'Horizontal Distribution', + option_align_vertical_space: 'Vertical Distribution', + option_align_right: 'Right Align', + option_align_top: 'Top Align', + option_align_vertical: 'Vertical Center', + option_align_bottom: 'Bottom Align', + option_position: 'Position', + option_position_x: 'Adjust X', + option_position_y: 'Adjust Y', + option_size: 'Size', + option_size_reset: 'Reset', + option_adaptive: 'Adaptive', + option_zoom: 'Scale', + option_opacity: 'Opacity', + option_rotation: 'Rotation', + option_screen: 'Green Screen', + option_overlay: 'Blend Mode', + option_template: 'Template Replaceable', + option_set_template: 'Set as Template', + option_text: 'Text', + option_color: 'Color', + option_name: 'Name', + option_no_select: 'No element selected', + option_search_font: 'Search Font', + option_font: 'Font', + option_chart_config: 'Chart Configuration', + option_tab_group: 'Group', + + // demo + option_demo: 'Sample Video', + option_demo_button: 'Set as Sample', + + // 文本设置 + option_text_color_single: 'Solid Color', + option_text_color_gradient: 'Gradient Color', + option_text_shadow: 'Shadow', + option_text_stroke: 'Stroke', + option_text_backgroundcolor: 'Background Color', + option_text_radius: 'Border Radius', + option_text_padding: 'Padding', + option_text_fill: 'Fill', + option_text_scale: 'Scale', + + // 音频设置 + option_audio_volume: 'Volume', + option_audio_fadein: 'Fade In', + option_audio_fadeout: 'Fade Out', + option_audio_mute: 'Mute', + + // 贴纸设置 + option_lottie_speed: 'Playback Speed', + option_lottie_startTime: 'Start Time', + + // 滤镜设置 + option_filter_strength: 'Strength', + + // 转场设置 + option_transition_name: 'Transition Name', + option_transition_duration: 'Duration', + + // 动画设置 + option_animation: 'Animation', + option_animation_in: 'In', + option_animation_process: 'Process', + option_animation_out: 'Out', + option_animation_duration: 'Animation Duration', + option_animation_ease: 'Easing Function', + option_animation_start_time: 'Start Time', + option_animation_insert_animation: 'No time gap between out animation and in animation to insert new animation', + option_animation_process_start_time: 'Please modify process animation start time first', + option_animation_process_duration: 'Please modify process animation duration first', + option_animation_out_start_time: 'Please modify out animation start time first', + + // 滤镜设置 + option_filter_hue: 'Hue', + option_filter_exposure: 'Exposure', + option_filter_highlight: 'Highlights', + option_filter_sharpen: 'Sharpen', + option_filter_clearness: 'Clarity', + option_filter_smooth: 'Smooth', + option_filter_noise: 'Noise', + + // 遮罩设置 + option_mask_feathering: 'Feathering', + option_no_mask: 'None', + option_custom_mask: 'Custom', + option_blur: 'Blur', + + toast_please_login: 'Please log in first', + toast_save_success: 'Save successful!', + + // 绿幕抠像 + option_green_screen: 'Color Keying', + option_green_screen_type: 'Keying Type', + option_green_screen_type_color: 'Color', + option_green_screen_type_gray: 'Grayscale', + option_green_screen_type_blur: 'Blur', + option_green_screen_type_dots: 'Dotted', + option_green_screen_type_mix: 'Mixed', + option_green_screen_type_solid: 'Solid', + option_green_screen_color: 'Key Color', + option_green_screen_feathering_radius: 'Feathering Radius', + option_green_screen_grid_size: 'Grid Density', + option_green_screen_light_level: 'Lightness Level', + + option_blend_mode: 'Blend Mode', + + source_caption_system_tips: 'System Tips', + source_caption_ai_tips: 'AI subtitle recognition will overwrite current subtitles. Continue?', + source_caption_ai_button: 'AI Subtitles', + source_favorite: 'My Favorites', + source_add_caption: 'Add Subtitles', + source_transition_add: 'Please select the element to add transition after', + source_transition_add_error: 'Transition not supported after selected element', + source_transition_replace_success: 'Replacement successful!', + source_transition_add_success: 'Add successful!', + source_transition_add_template_error: 'Only data dragging allowed in template editing mode', + source_add_success: 'Add successful!', + source_transition_add_transtion_error: + 'No eligible elements found for transition insertion. Transitions can only be inserted between two consecutive videos or images', + source_caption_ai_error: 'Conversion error!', + source_caption_ai_no_audio: 'No audio detected', + source_caption_ai_feature_not_supported: 'Feature under development, coming soon!', + source_delete_confirm: 'Are you sure you want to delete these materials?', + source_delete_confirm_tips: 'Deleted materials cannot be recovered. Please proceed with caution', + source_delete_success: 'Deletion successful!', + source_delete_button: 'Delete', + source_cancel_button: 'Cancel', + source_record: 'Online Recording', + source_upload_mobile: 'Upload on Mobile', + source_tts: 'Text-to-Speech', + source_root_dir: 'Root Directory', + source_tts_please_select: 'Please select voice first', + source_tts_success: 'Conversion successful!', + source_record_success: 'Recording successful!', + source_encode_failed: 'Encoding failed', + source_encoding: 'Encoding...', + + export_data_parse_error: 'Data parsing error', + export_loading_progress: 'Resource loading progress', + export_encoder_video_progress: 'Video encoding progress', + export_loading_source: 'Loading resources', + export_video_synthesis_success: 'Video has been synthesized to the specified directory. This window can be closed!', + export_again_download: 'Download again', + export_video_synthesis_process: 'Video synthesizing...', + export_select_save_dir: 'Select save directory', + export_export_process_tips: 'Do not close this window during export', + option_tab_ai_read: 'AI Read', + source_tts_start: 'Start Conversion', + + login_email_error: 'Please enter the correct email address', + login_captcha_error: 'Please enter the captcha', + login_email_code_success: 'Verification code sent to email, please check', + login_email_login: 'Email Login', + login_email_required: 'Please enter email address', + login_email_code_required: 'Please enter email code', + login_code_send: 'Send Code', + login_code_tip: 'Please enter verification code', + login_code_send_tip: 's', + login_login: 'Login', + login_success: 'Login Success!', + login_phone_code_required: 'Please enter phone code', + login_phone_code: 'Phone Code', + login_phone_required: 'Please enter phone number', + login_phone_login: 'Phone Login', + login_phone_code_send_tip: 'Code sent to phone, please check', + login_phone_format_error: 'Please enter correct phone number', + login_wechat_login: 'WeChat Login', + login_account: 'Account', + login_password: 'Password', + login_account_tip: 'Please enter account', + login_password_tip: 'Please enter password', + login_remember_password: 'Remember Password', + login_login0: 'Login', + login_loading: 'Logging in, please wait', + login_switch_lens: 'Support quick switch lens', + login_ai_subtitle: 'Support AI subtitle generation', + login_ai_animation: 'Support key frame animation', + login_export_4k: 'Support export 4K high-definition video', + login_lut_filter: 'Massive LUT professional movie filters one-click use', + login_free_material: 'Provide massive free materials', + login_exclusive_plugin: 'Exclusive plugin features, video play new style', + login_no_download: 'No need to download, just open the browser', + login_cloud_storage: 'Cloud storage, resources secure and reliable', + login_other_login: 'Login methods', + + cm_top_one: 'Top One', + cm_bottom_one: 'Bottom One', + cm_up: 'Up One', + cm_down: 'Down One', + cm_copy: 'Copy', + cm_paste: 'Paste', + cm_delete: 'Delete', + cm_ai_matting: 'AI Matting', + cm_erase: 'AI Smear Erase', + + ai_rubber_title: 'AI Smear Erase', + ai_rubber_desc: 'Smear erase unwanted elements from the image', + ai_rubber_confirm_tip: 'Confirm clear canvas?', + ai_rubber_confirm_content: 'After clearing, the canvas cannot be recovered. Please proceed with caution?', + ai_rubber_clear: 'Clear', + ai_rubber_eraser: 'Eraser', + ai_rubber_pen: 'Smear Pen', + ai_rubber_execute: 'Execute AI', + ai_rubber_draw: 'Draw', + ai_rubber_no_change: 'No changes made', + ar_rubber_no_mark: 'No mark', + ai_download_tip: 'Confirm', + + ai_title: 'AI Features', + ai_portrait: 'Separation', + ai_clear: 'Resolution', + ai_matte: 'Matte', + ai_erase: 'Erase', + ai_portrait_failed: 'Portrait separation failed', + + no_more_data: 'No more data~', + + // === language2 merged fields === + user_profile: 'User Profile', + common_create_video: 'Create Video', + common_tech_docs: 'Docs', + common_about_us: 'About Us', + common_tools: 'Tools', + common_home: 'Home', + common_navigation: 'Navigation', + common_about_us_info: + 'X-Clip is a cloud-based video editing tool that does not require download or installation. You can use it directly after logging in. It supports a large number of cloud materials and effects, as well as multi-person collaborative editing.', + common_support: 'Support', + common_help_center: 'Help Center', + common_privacy_policy: 'Privacy Policy', + common_service_agreement: 'Service Agreement', + common_disclaimer: 'Disclaimer', + common_contact_us: 'Contact Us', + common_private_deployment_saas_consultation: 'Private Deployment/SAAS Consultation', + common_phone: 'Phone', + common_copyright: + 'Copyright©2019-2020. All right reserved. Powered by Sichuan H5 Technology Co., Ltd.. 蜀ICP备18034069号-2', + home_title: 'X-Clip', + home_sub_title: 'Free online use, private deployment support, source code provided, custom development support', + home_used: 'Get Started', + home_lut: 'LUT Filter', + home_sass_private: 'Private Deployment/SAAS', + home_sass_private_info: + 'Support SAAS integration with third-party systems or private deployment, providing more choices for enterprise customers.', + home_custom_plugin: 'Supports plugin extension', + home_custom_plugin_info: 'Custom plugins can meet various user customization needs', + home_contact_us: 'Contact Us', + common_company: 'Sichuan H5 Technology Co., Ltd.', + common_all: 'All', + common_create_success: 'Create Success!', + common_move: 'Move', + common_cancel: 'Cancel', + common_confirm: 'Confirm', + common_edit: 'Edit', + common_material: 'My Material', + common_draft: 'My Draft', + common_personal_space: 'Personal Space', + common_account_settings: 'Account Settings', + common_not_set: 'Not Set', + common_bound: 'Bound', + about_us: 'About Us', + draft_start: 'Start Your Creation', + draft_create_video: 'Create Video', + draft_name_input: 'Click to modify the name', + draft_name_success: 'Modify success!', + draft_upload_material: 'Upload Material', + draft_create_folder: 'Create Folder', + draft_batch_manage: 'Batch Manage', + draft_folder: 'Folder', + draft_has_selected: 'Has selected {{num}} items', + draft_batch_modal_title: 'Are you sure you want to delete the selected items?', + draft_batch_modal_content: 'Deleted items cannot be recovered. Are you sure?', + user_unbind_confirm: 'Are you sure you want to unbind?', + user_unbind_content: 'Unbinding will disable login and password recovery via phone number. Are you sure?', + user_unbind_success: 'Unbinding success!', + user_unbind: 'Unbind', + user_bind_success: 'Binding success!', + user_email_unbind_confirm: 'Are you sure you want to unbind?', + user_email_unbind_content: 'Unbinding will disable login and password recovery via email. Are you sure?', + user_weixin: 'WeChat', + user_weixin_bind_confirm: 'Are you sure you want to bind WeChat?', + user_weixin_unbind_content: 'Unbinding will disable login via WeChat. Are you sure?', + user_mobile: 'Mobile Number', + user_mobile_tip: 'Phone number cannot be empty', + user_mobile_format_tip: 'Please enter the correct phone number', + user_password: 'Password', + user_password_set: 'Set', + user_nickname: 'Nickname', + user_bind: 'Bind', + user_bind_mobile: 'Bind Mobile', + user_get_code: 'Get Code', + user_input_code: 'Input Code', + user_code: 'Code', + user_code_tip: 'Please input the code', + user_captcha: 'Captcha', + user_captcha_tip: 'Please input the captcha', + user_get_code_tip: 'Get Code', + user_submit: 'Submit', + user_message_all: 'All', + user_message_platform: 'Platform Announcement', + user_message_activity: 'Activity Notification', + user_message_private: 'Private Message', + user_message_back: 'Back', + user_message_read: 'Read', + user_message_new: 'NEW', + user_bind_email: 'Bind Email', + user_email_code_tip: 'Verification code sent to email', + user_email: 'Email Address', + user_email_tip: 'Please enter email address', + user_email_empty_tip: 'Email cannot be empty', + user_email_format_tip: 'Please enter the correct email address', + user_email_send_code_tip: 'Send Email Code', + user_email_code: 'Email Code', + user_email_code_tip2: 'Please enter email code', + user_bind_wechat: 'Bind WeChat', + user_bind_wechat_tip: 'Please use WeChat to scan the QR code to log in', + user_new_password: 'New Password', + user_password_set_tip: 'Set Password', + user_old_password: 'Old Password', + user_old_password_tip: 'Old password cannot be empty', + user_password_set_format_tip: 'Password must be at least 8 characters long and contain letters and numbers', + user_empty_tip: 'Cannot be empty', + user_password_set_diff_tip: 'Passwords do not match', + user_password_set_repassword_tip: 'Repeat Password', + user_set: 'Account Settings', + user_message: 'Message Center', + tools_title: 'Online Tools', + tools_desc: 'X-Clip provides a large number of video tools to help you complete your work quickly', + ai_matting: 'AI Matting', + ai_matting_desc: 'Click on the element you want to remove, and it will be removed quickly', + ai_upload_tip: 'Click to upload image file or drag file here', + ai_upload_sub_tip: 'Support {{format}} type files', + ai_matting_click_tip: 'Please click the image to get the selection area', + ai_matting_google_browser_tip: 'Please upgrade to Google Chrome version 113 or above to use this feature', + ai_matting_usage_tip: + '1、Upload the element; 2、Click on the element you want to remove; 3、Click Download after the selection area appears', + ai_matting_download_tip: 'Download Image', + ai_super_resolution_title: 'AI Super Resolution', + ai_super_resolution_desc: 'Modify the clarity of the original image, up to X4', + ai_super_resolution_resolution_tip: 'Image size multiple:', + ai_super_resolution_img_size_tip: 'Image size', + ai_super_resolution_switch_tip: 'Switch to new image', + ai_super_resolution_switch_old_tip: 'Switch to old image', + ai_portrait_title: 'AI Portrait Segmentation', + ai_portrait_desc: 'Support PNG,JPEG,GIF format', + ai_removebg_title: 'AI Remove Background', + ai_removebg_desc: 'Support PNG,JPEG,GIF format', + ai_removebg_upload_tip: 'Click to upload video file or drag file here', + ai_removebg_accuracy_tip: 'Set Accuracy:', + ai_removebg_accuracy_set: 'Set Accuracy', + ai_removebg_download_tip: 'Download Result', + mp4_upload_tip: 'Click to upload {{format}} file or drag and drop file here', + mp4_upload_sub_tip: 'Support {{format}} type files', + mp4_download: 'Download MP4', + mp4_compress_title: 'MP4 Video Compression', + mp4_compress_desc: 'Compression only supports H264 encoded MP4 videos', + mov2mp4_title: 'MOV to MP4 Converter', + mov2mp4_desc: 'Format conversion, retaining H265 encoding', + mp4_null_tip: 'No video set', + capture_frame_title: 'Capture Frame', + capture_frame_desc: 'Capture a specified frame as PNG format', + download_snapshot: 'Download Snapshot', + json2mp4_format_error: 'JSON data format exception', + json2mp4_title: 'JSON to MP4 Converter', + json2mp4_desc: 'JSON file of video project', + json2mp4_placeholder: 'Please input JSON file content', + json2mp4_stop_destroy: 'Stop & Destroy', + json2mp4_download_mp4: 'Download MP4', + custom_size: 'Custom', + custom_size_tip: 'Custom video size', + custom_size_width: 'Width', + custom_size_height: 'Height', + custom_size_tip_err: 'Please enter a positive integer', + product_title: 'Cloud Render', + product_preparing: 'Preparing...', + product_composing: 'Composing {{progress}}%', + product_completed: 'Completed', + product_failed: 'Failed', + product_download: 'Download', + product_fps: 'FPS', + product_resolution: 'Resolution', + product_duration: 'Duration', + img2txt_title: 'Extract Text from Image', + img2txt_support_format: 'Support JPG, JPEG, PNG format images', + tool_disabled: 'Function development is in progress, please stay tuned...', + webm2mp4_title: 'WEBM to MP4 Converter', + webm2mp4_desc: 'Format conversion, retaining H264 encoding', + mp42mp3_title: 'MP4 to MP3 Converter', + mp42mp3_desc: 'Format conversion, retaining AAC encoding', + aac2mp3_title: 'AAC/M4A/WAV to MP3 Converter', + aac2mp3_desc: 'Format conversion, retaining AAC encoding', + loading_more: 'Loading...', + material: 'Material', + project: 'Project', + userAccount: 'User Account', + messageCenter: 'Message Center', + agreement: 'User Agreement', + logout: 'Logout', + create_project: 'Create Project', + create_project_desc: 'Click here to create a video mixing project', + generate_script: 'Generate Script', + generate_script_desc: 'Generate video script automatically by AI.', + select_material: 'Select Material', + select_material_desc: 'Select the materials to mix in', + generate_video: 'Generate Video', + generate_video_desc: 'Preview and select the video generated by AI', + cloud_composition: 'Cloud Composition', + cloud_composition_desc: 'The video after mixing is composed in the cloud', + decode_error: 'Transcoding failed', + back: 'Back', + selected_material: 'Selected Material', + selected_material_tips: 'Please select material', + generate_script_tips: 'Please generate script first', + upload_complete: 'Upload complete', + upload_ready: 'Upload ready', + upload_tips: 'Please upload video first', + one_duration: 'One video duration', + num: 'Number of videos', + size: 'Video size', + generate_script_info: 'Please input video requirements...', + custom_title: 'Custom Script', + custom_title_placeholder: 'Each line represents a caption', + selected_material_tips_before: 'Please import material first', + network_error: 'Network error, please try again later', + prev_step: 'Previous Step', + select_all: 'Select All', + selected_count: 'Selected', + selected_material_tips2: 'Please select video to mix', + encoder_audios: 'Batch Composition Audio', + encoder_audios_tips: 'Please select video to mix', + encoder_audios_tips2: 'Please add audio to the selected video first', + title: 'Title', + audio: 'Audio', + encoder_audio_start: 'Select Audio', + confirm_delete: 'Are you sure to delete?', + confirm: 'Confirm', + delete: 'Delete', + preview: 'Preview', + edit: 'Edit', + export: 'Export', + select_audio: 'Select Audio', + status_pending: 'Pending', + status_processing: 'Processing', + status_success: 'Success', + status_failed: 'Failed', + task_id: 'Task ID', + project_id: 'Project ID', + project_name: 'Project Name', + progress: 'Progress', + status: 'Status', + created_at: 'Created At', + action: 'Action', + download: 'Download', + delete_success: 'Delete Success', + encoding_failed: 'Encoding Failed', + common_back: 'Back', + selected_selected: 'Selected Material', + common_confirm_import: 'Confirm Import', + common_success: 'Operation Success', + common_import: 'Import Material', + common_fps: 'FPS', + common_size: 'Size', + common_videomix_docs: 'Video Mix Tools', + common_no_source: 'No Source', + common_no_source_desc: 'No uploaded source', + common_update_log: 'Update Log', + common_update_log_desc: 'View the update log of X-Clip', + common_delete: 'Delete', + common_delete_success: 'Delete Success!', + common_email: 'Email', + draft_cancel: 'Cancel', +}; diff --git a/src/language/index.ts b/src/language/index.ts new file mode 100644 index 0000000..75be6cd --- /dev/null +++ b/src/language/index.ts @@ -0,0 +1,4 @@ +import Intl from './Intl'; +import { language, locals } from './language'; + +export { locals, Intl, language }; diff --git a/src/language/language.ts b/src/language/language.ts new file mode 100644 index 0000000..2224066 --- /dev/null +++ b/src/language/language.ts @@ -0,0 +1,88 @@ +import { enUS } from './enUS'; +import { storage, pubsub } from '@utils/index'; +import { zhCN } from './zhCN'; + +export type ValueType = 'zh-CN' | 'en-US'; + +export const locals: any = { + 'zh-CN': zhCN, + 'en-US': enUS, +}; + +const _window = window as any; +/** + * 国际化处理 + */ +class Language { + constructor() { + _window.language = storage.local.get('language') || 'zh-CN'; + storage.local.set('language', _window.language); + } + + // get pubsub() { + // return this.pubsub; + // } + + // set pubsub(p) { + // this.pubsub = p; + // } + + /** + * 国际化语言 + * @param {string} name 字段名称 + * @param {object} data 模板参数:默认是undefined + * @param {string} type 语言类型,默认是undefined + */ + val(name: string, data?: any, type?: ValueType) { + if (!_window.language) { + _window.language = this.getLanguage(); + } + let str = locals[type || _window.language][name] || '--'; + if (data) { + for (const key in data) { + str = str.replaceAll(`{{${key}}}`, data[key]); + } + } + return str; + } + + /** + * 反向查找语言 + * @param {string} value 当前的值 + * @param {string} type 当前的值属于那个语言类型 + */ + findVal(value: string, valueType = 'zh-CN') { + if (!_window.language) { + _window.language = storage.local.get('language') || 'zh-CN'; + } + for (const key in locals[valueType]) { + if (locals[valueType][key] === value) { + return locals[_window.language][key]; + } + } + return 'Unknow'; + } + + getLanguage(): ValueType { + return _window.language || storage.local.get('language') || 'zh-CN'; + } + + setLanguage(type: ValueType) { + storage.local.set('language', type); + _window.language = type; + location.reload(); + // if (pubsub) { + // // 更新视图 + // pubsub.publish('setLanguage', type); + // } + } + + // // 扩展数据 + // extendData(data: any, languageType: ValueType) { + // for (const key in data) { + // locals[languageType][key] = data[key]; + // } + // } +} + +export const language = new Language(); diff --git a/src/language/zhCN.ts b/src/language/zhCN.ts new file mode 100644 index 0000000..d666404 --- /dev/null +++ b/src/language/zhCN.ts @@ -0,0 +1,653 @@ +export const zhCN = { + user_workspace: '工作台', + user_center: '个人中心', + user_theme: '主题', + user_logout: '退出', + user_language: '中文/EN', + user_userid: '用户ID', + + // 侧边栏菜单 + sidemenu_template: '模板', + sidemenu_my: '我的', + sidemenu_caption: '字幕', + sidemenu_image: '图片', + sidemenu_video: '视频', + sidemenu_audio: '音频', + sidemenu_text: '文本', + sidemenu_filter: '滤镜', + sidemenu_sticker: '贴纸', + sidemenu_effect: '特效', + sidemenu_transition: '转场', + sidemenu_more: '更多', + + // 公共 + common_name: '无界云剪', + common_search: '搜索', + common_loading: '加载中...', + common_uploading: '上传中...', + common_upload_success: '上传成功!', + common_save_success: '保存成功!', + common_toast_error: '操作失败!', + common_toast_success: '操作成功!', + common_toast_replace_success: '替换成功!', + common_toast_transition_limit: '请选择图片&视频元素进行转场添加', + common_toast_video_replace_limit: `请使用时长大于或者等于{{duration}}秒的视频`, + common_toast_collect_success: '收藏成功!', + common_toast_collect_cancel_success: '取消收藏成功!', + common_toast_poster_success: '设置封面成功!', + common_toast_login_error: '请先登录系统', + common_toast_no_update: '数据未变,不用更新', + + // header + header_project_no_name: '项目未命名', + header_pro: '专业版', + header_simple: '简化版', + header_export: '导出', + header_login: '登录/注册', + + header_project_file: '工程文件', + header_project_title: '工程文件导入/导出', + header_project_upload_tip1: '点击上传工程文件或拖拽工程文件到这里', + header_project_upload_tip2: '支持任JSON格式的工程文件', + header_project_confirm_title: '系统提示', + header_project_confirm_content: '导入新的项目会覆盖当前的项目,是否继续?', + header_project_export: '导出工程文件', + header_project_toast: '数据格式不合法', + header_project_poster: '截取视频封面', + + // 导出弹窗 + export_poster: '视频封面', + export_title: '视频名称', + export_title_placeholder: '请输入视频名称', + export_size: '分辨率', + export_fps: '帧率', + export_speed: '速度', + export_gif_width: '画布宽度', + export_format: '导出格式', + export_data_parse_error: '数据解析异常', + export_loading_progress: '资源加载进度', + export_encoder_video_progress: '视频编码进度', + export_loading_source: '加载资源', + export_video_synthesis_success: '视频已合成到指定目录,该窗口可关闭了!', + export_again_download: '再次下载', + export_video_synthesis_process: '视频合成中...', + export_select_save_dir: '选择保存目录', + export_export_process_tips: '导出过程中请勿关闭此窗口', + export_cloud_button: '云合成', + export_button: '本地合成', + export_success_info: '合成任务已提交至云端,3秒后退出该页面', + option_tab_ai_read: 'Ai朗读', + source_tts_start: '开始朗读', + + // 我的 + my_upload: '上传素材', + my_upload_mobile_link: '手机上传', + my_upload_refresh: '刷新列表', + my_tab_material: '当前素材', + my_tab_all_material: '全部素材', + my_tab_no_material: '该项目暂无素材,请先上传', + my_select_root: '根目录', + + my_nologin_tip: '您还未登录,请先', + my_login: '登录系统', + + // 字幕 + caption_add: '添加字幕', + caption_ai: 'AI字幕', + caption_ai_confirm_title: '系统提示', + caption_ai_confirm_desc: 'AI字幕识别,且会覆盖当前的字幕,是否继续?', + caption_null: '没有字幕', + caption_default: '字幕内容', + + // 更多 + more_plus: '更多插件', + + // 快捷键 + shortcut_key: '快捷键', + shortcut_key_split: '分割', + shortcut_key_copy: '复制', + shortcut_key_paste: '粘贴', + shortcut_key_cut: '剪切', + shortcut_key_delete: '删除', + shortcut_key_undo: '撤销', + shortcut_key_redo: '回退', + shortcut_key_play: '播放/暂停', + shortcut_key_right: '右微调', + shortcut_key_left: '左微调', + shortcut_key_up: '上微调', + shortcut_key_down: '下微调', + shortcut_key_timeline_zoomin: '时间轴放大', + shortcut_key_timeline_zoomout: '时间轴缩小', + shortcut_key_save: '保存', + shortcut_key_space: '空格', + + // 时间轴 + timeline_top_redo: '撤销', + timeline_top_undo: '重做', + timeline_top_split: '分割', + timeline_top_delete: '删除', + timeline_top_flip: '翻转', + timeline_top_copy: '复制', + timeline_top_paste: '粘贴', + timeline_top_separate: '音视频分离', + timeline_top_clip: '尺寸裁剪', + timeline_top_clip_time: '裁剪时间', + timeline_top_background_color: '背景颜色', + timeline_top_ai_smear: 'Ai涂抹擦除', + timeline_top_ai_separation: 'Ai抠图', + timeline_top_ai_segmentation: 'Ai人像分离', + timeline_top_add_frame: '插入关键帧', + timeline_top_delete_frame: '删除关键帧', + timeline_top_ai_removebg: 'Ai去背景', + timeline_top_ai_removebg_error: '请选择图片', + timeline_top_copy_frame: '复制关键帧', + timeline_top_paste_frame: '粘贴关键帧', + timeline_top_freeze: '定格', + timeline_lock: '锁定', + timeline_hide: '隐藏', + timeline_show: '可见', + timeline_top_forbidden_audio: '启用/禁音', + timeline_top_copy_success: '复制成功!', + timeline_top_paste_type_error: '不同元素类型不支持粘贴', + + timeline_top_cut_success: '已剪切元素', + timeline_top_copy_error: '请先复制元素', + + timeline_top_notfound_error: '未找到资源', + timeline_top_please_select_element: '请先选中元素', + timeline_top_please_select_range: '请将游标拖到选中元素范围内', + + timeline_top_no_frame_data: '无帧数据', + timeline_top_paste_success: '粘贴成功!', + timeline_top_please_select_track: '请先选中轨道', + timeline_top_split_tips: '请移动时间线到元素中间进行分割', + timeline_top_please_select_image: '请先点击图片获取选区', + timeline_top_please_upgrade_browser: '请升级到谷歌浏览器版本113以上才可以使用该功能', + timeline_top_ai_matting_tips: '1、鼠标点击要扣的元素;2、出现选区后点击确认即可自动抠图', + timeline_top_ai_matting_confirm: '确认', + timeline_top_ai_matting_please_select_video: '请先选择视频元素', + timeline_top_ai_matting_no_modify: '未做任何修改', + timeline_top_ai_matting_unmarked: '未标记', + timeline_cameraTrack: '镜头轨道', + timeline_captionTrack: '字幕轨道', + + // 设置区域 + option_tab_base: '基础', + option_tab_animation: '动画', + option_tab_text_animation: '文字动画', + option_tab_filter: '滤镜', + option_tab_mask: '遮罩', + option_tab_audio: '音频', + option_tab_effect: '特效', + option_tab_sticker: '贴纸', + option_tab_transition: '转场', + option_tab_effects: '特效', + option_speed: '速度', + option_strength: '强度', + option_mask_shape: '遮罩图形', + // 元素设置 + option_template_scene_index: '场景编号', + option_template_replaceable: '模版可替换', + option_template_info: '模版描述', + option_export_data: '导出数据', + option_align: '对齐方式', + option_align_left: '左对齐', + option_align_center: '水平对齐', + option_align_horizontal_space: '水平间距分布', + option_align_vertical_space: '垂直间距分布', + option_align_right: '右对齐', + option_align_top: '顶对齐', + option_align_vertical: '垂直对齐', + option_align_bottom: '底对齐', + option_position: '位置', + option_position_x: '修改X', + option_position_y: '修改Y', + option_size: '大小', + option_size_reset: '恢复', + option_adaptive: '自适应', + option_zoom: '缩放', + option_opacity: '透明度', + option_rotation: '旋转', + option_effects: '特效', + option_start_frame_number: '起始帧', + option_screen: '绿幕', + option_overlay: '叠加模式', + option_template: '模版可替换', + option_set_template: '设为模版', + option_text: '文本', + option_color: '颜色', + option_name: '名称', + option_no_select: '未选中任何元素', + option_search_font: '搜索字体', + option_font: '字体', + option_chart_config: '图表配置', + option_tab_group: '组合', + + // demo + option_demo: '示例视频', + option_demo_button: '设为示例', + + // 文本设置 + option_text_color_single: '单色', + option_text_color_gradient: '渐变色', + option_text_shadow: '阴影', + option_text_stroke: '描边', + option_text_backgroundcolor: '背景色', + option_text_radius: '圆角', + option_text_padding: '边距', + option_text_fill: '撑满', + option_text_scale: '缩放', + + // 音频设置 + option_audio_volume: '音量', + option_audio_fadein: '淡入', + option_audio_fadeout: '淡出', + option_audio_mute: '静音', + + // 贴纸设置 + option_lottie_speed: '播放速度', + option_lottie_startTime: '开始时间', + + // 滤镜设置 + option_filter_strength: '强度', + + // 转场设置 + option_transition_name: '转场名称', + option_transition_duration: '持续时长', + + // 动画设置 + option_animation: '动画', + option_animation_in: '进入', + option_animation_process: '过程', + option_animation_out: '离开', + option_animation_duration: '动画时长', + option_animation_ease: '缓动函数', + option_animation_start_time: '开始时间', + option_animation_insert_animation: '离开动画和进入动画之间无时间间隙可插入动画', + option_animation_process_start_time: '请先修改过程动画的开始时间', + option_animation_process_duration: '请先修改过程动画的时间', + option_animation_out_start_time: '请先修改离开动画的开始时间', + + // 滤镜设置 + option_filter_hue: '色调', + option_filter_exposure: '曝光', + option_filter_highlight: '高光', + option_filter_sharpen: '锐化', + option_filter_clearness: '清晰', + option_filter_smooth: '光滑', + option_filter_noise: '噪点', + + // 遮罩设置 + option_mask_feathering: '羽化', + option_no_mask: '无', + option_custom_mask: '自定义', + option_blur: '羽化', + + toast_please_login: '请先登录', + toast_save_success: '保存成功!', + + // 绿幕抠像 + option_green_screen: '颜色抠像', + option_green_screen_type: '绿幕类型', + option_green_screen_type_color: '绿色', + option_green_screen_type_gray: '灰阶', + option_green_screen_type_blur: '模糊', + option_green_screen_type_dots: '网点', + option_green_screen_type_mix: '混合', + option_green_screen_type_solid: '纯色', + option_green_screen_color: '扣除颜色', + option_green_screen_feathering_radius: '羽化半径', + option_green_screen_grid_size: '网点数量', + option_green_screen_light_level: '明暗度', + + option_blend_mode: '叠加模式', + + source_caption_system_tips: '系统提示', + source_caption_ai_tips: 'AI字幕识别,且会覆盖当前的字幕,是否继续?', + source_caption_ai_button: 'AI字幕', + source_favorite: '我的收藏', + source_add_caption: '添加字幕', + source_transition_add: '请先选中要在其后添加转场的元素', + source_transition_add_error: '选中的元素后面不支持添加转场', + source_transition_replace_success: '替换成功!', + source_transition_add_success: '添加成功!', + source_transition_add_template_error: '模版编辑模式下只能拖入数据', + source_add_success: '添加成功!', + source_transition_add_transtion_error: '未找到可插入转场的元素,转场只能插入到两个连续的视频或者图片之间', + source_caption_ai_error: '转换异常!', + source_caption_ai_no_audio: '没有音频', + source_caption_ai_feature_not_supported: '功能开发中,敬请期待!', + source_delete_confirm: '确定要删除这些素材吗?', + source_delete_confirm_tips: '删除后无法恢复,请谨慎操作', + source_delete_success: '删除成功!', + source_delete_button: '删除', + source_cancel_button: '取消', + source_record: '在线录音', + source_tts: '文字转语音', + source_upload_mobile: '移动端上传', + source_root_dir: '根目录', + source_tts_please_select: '请先选择语音', + source_tts_success: '转换成功!', + source_record_success: '录音成功!', + source_encode_failed: '编码失败', + source_encoding: '编码中...', + + login_email_error: '请输入正确的邮箱地址', + login_captcha_error: '请输入图形验证码', + login_email_code_success: '验证码已发送至邮箱,注意查收', + login_email_login: '邮箱登录', + login_email_required: '请输入邮箱地址', + login_email_code_required: '请输入邮箱验证码', + login_code_send: '发送验证码', + login_code_tip: '请输入验证码', + login_code_send_tip: '秒后重试', + login_login: '立即登录', + login_success: '登录成功!', + login_phone_code_required: '请输入手机验证码', + login_phone_code: '手机验证码', + login_phone_required: '请输入手机号', + login_phone_login: '手机登录', + login_phone_code_send_tip: '验证码已发送,注意查收', + login_phone_format_error: '请输入正确的手机号', + login_wechat_login: '微信登录', + login_account: '账号', + login_password: '密码', + login_account_tip: '请输入账号', + login_password_tip: '请输入密码', + login_remember_password: '记住密码', + login_login0: '登录', + login_loading: '登录中,请稍后', + login_switch_lens: '支持快速切换镜头', + login_ai_subtitle: '支持AI字幕生成', + login_ai_animation: '支持关键帧动画', + login_export_4k: '支持导出超4K高清视频', + login_lut_filter: '海量LUT专业影视级滤镜一键使用', + login_free_material: '提供海量素材免费使用', + login_exclusive_plugin: '独家插件功能,视频玩出新花样', + login_no_download: '无需下载,打开浏览器即可使用', + login_cloud_storage: '云存储,资源安全可靠', + login_other_login: '其他登录方式', + + cm_top_one: '置顶', + cm_bottom_one: '置底', + cm_up: '上移一层', + cm_down: '下移一层', + cm_copy: '复制', + cm_paste: '粘贴', + cm_delete: '删除', + cm_ai_matting: 'AI抠像', + cm_erase: 'AI擦除', + + ai_rubber_title: 'AI涂抹擦除', + ai_rubber_desc: '涂抹去掉图片中不要的元素', + ai_rubber_confirm_tip: '确认清除画布?', + ai_rubber_confirm_content: '清除后无法恢复,请谨慎操作?', + ai_rubber_clear: '清除', + ai_rubber_eraser: '橡皮擦', + ai_rubber_pen: '涂抹笔', + ai_rubber_execute: '执行AI', + ai_rubber_draw: '画笔', + ai_rubber_no_change: '未做任何修改', + ar_rubber_no_mark: '未标记', + ai_download_tip: '确定', + + ai_title: 'AI功能', + ai_portrait: '人像分离', + ai_clear: '变清晰', + ai_matte: '抠图', + ai_erase: '擦除', + ai_portrait_failed: '人像分离失败', + + no_more_data: '到底了~', + + // === language2 合并字段 === + user_profile: '用户中心', + common_create_video: '创建视频', + common_tech_docs: '技术文档', + common_about_us: '关于我们', + common_tools: '快捷工具', + common_home: '首页', + common_navigation: '导航', + common_about_us_info: + '无界云剪是一款在线的B/S视频剪辑工具,无需下载安装,直接登录即可使用,支持大量的云素材和特效,也支持多人协同剪辑。', + common_support: '支持', + common_help_center: '帮助中心', + common_privacy_policy: '隐私协议', + common_service_agreement: '服务协议', + common_disclaimer: '免责声明', + common_contact_us: '联系我们', + common_private_deployment_saas_consultation: '私有化部署/SAAS接入相关咨询', + common_phone: '电话', + common_copyright: 'Copyright©2019-2020. All right reserved. Powered by 四川爱趣五科技有限公司. 蜀ICP备18034069号-2', + home_title: '云剪无界,创意无限', + home_sub_title: '免费在线使用、支持私有化部署、提供源码、支持定制开发', + home_used: '立即使用', + home_lut: 'LUT滤镜', + home_sass_private: 'SAAS接入/私有化部署', + home_sass_private_info: '支持SAAS接入第三方系统或私有化部署,面向企业客户提供更多选择', + home_custom_plugin: '无限可能源于扩展', + home_custom_plugin_info: '可自定义插件,满足用户各种定制化需求', + home_contact_us: '联系我们', + common_company: '四川爱趣五科技有限公司', + common_all: '全部', + common_create_success: '创建成功!', + common_move: '移动', + common_cancel: '取消', + common_confirm: '确定', + common_edit: '编辑', + common_material: '我的素材', + common_draft: '我的草稿', + common_personal_space: '个人空间', + common_account_settings: '账号设置', + common_not_set: '未设置', + common_bound: '已绑定', + about_us: '关于我们', + draft_start: '开始您的创作', + draft_create_video: '创建视频', + draft_name_input: '点击修改名称', + draft_name_success: '修改成功!', + draft_upload_material: '上传素材', + draft_create_folder: '创建文件夹', + draft_batch_manage: '批量管理', + draft_folder: '文件夹', + draft_has_selected: '已选{{num}}个元素', + draft_batch_modal_title: '是否要删除选中的内容?', + draft_batch_modal_content: '删除后无法恢复,请谨慎操作?', + user_unbind_confirm: '是否要解除绑定?', + user_unbind_content: '解除绑定后将无法通过手机号登录以及找回密码', + user_unbind_success: '解除绑定成功!', + user_unbind: '解除绑定', + user_bind_success: '绑定成功!', + user_email_unbind_confirm: '是否要解除绑定?', + user_email_unbind_content: '解除绑定后将无法通过邮箱登录以及找回密码', + user_weixin: '微信', + user_weixin_bind_confirm: '微信绑定?', + user_weixin_unbind_content: '解除微信绑定后将无法使用微信登录', + user_password: '密码', + user_password_set: '已设置', + user_nickname: '昵称', + user_bind: '绑定', + user_bind_mobile: '绑定手机号', + user_get_code: '获取验证码', + user_input_code: '输入验证码', + user_code_tip: '短信已发送!请注意查收', + user_mobile: '手机号', + user_mobile_tip: '电话号码不能为空', + user_mobile_format_tip: '请输出正确的手机号', + user_captcha: '图形验证码', + user_captcha_tip: '请输入图形验证码', + user_get_code_tip: '获取短信验证码', + user_code: '短信验证码', + user_bind_email: '绑定邮箱', + user_email_code_tip: '验证码已发送至邮箱', + user_email: '邮箱地址', + user_email_tip: '请输入邮箱地址', + user_email_empty_tip: '邮箱不能为空', + user_email_format_tip: '请输入正确的邮箱地址', + user_email_send_code_tip: '发送邮箱验证码', + user_email_code: '邮箱验证码', + user_email_code_tip2: '请输入邮箱验证码', + user_submit: '提交', + user_bind_wechat: '绑定微信', + user_bind_wechat_tip: '请使用微信扫描二维码登录', + user_new_password: '新密码', + user_password_set_tip: '设置密码', + user_old_password: '旧密码', + user_old_password_tip: '旧密码不能为空', + user_password_set_format_tip: '密码不能少于8位数且必须包含字母+数字', + user_empty_tip: '不能为空', + user_password_set_diff_tip: '两次密码不一样', + user_password_set_repassword_tip: '重复密码', + user_set: '账号设置', + user_message: '消息中心', + user_message_all: '全部', + user_message_platform: '平台公告', + user_message_activity: '活动通知', + user_message_private: '私信', + user_message_back: '返回列表', + user_message_read: '已读', + user_message_new: 'NEW', + tools_title: '在线工具', + tools_desc: '无界云剪提供了大量的视频工具帮助你快速完成工作', + ai_matting: 'AI抠图', + ai_matting_desc: '点击要扣取的元素,可以快速扣出图片中的任何元素', + ai_upload_tip: '点击上传图片文件或拖拽文件到这里', + ai_upload_sub_tip: '支持{{format}}类型文件', + ai_matting_click_tip: '请先点击图片获取选区', + ai_matting_google_browser_tip: '请升级到谷歌浏览器版本113以上才可以使用该功能', + ai_matting_usage_tip: '1、上传元素; 2、鼠标点击要扣的元素;3、出现选区后点击下载即可', + ai_matting_download_tip: '下载图片', + ai_download: '下载图片', + ai_super_resolution_title: 'AI分辨率变清晰', + ai_super_resolution_desc: '修改原图的清晰度,最大X4', + ai_super_resolution_resolution_tip: '图片大小倍数:', + ai_super_resolution_img_size_tip: '图片大小', + ai_super_resolution_switch_tip: '切换新图', + ai_super_resolution_switch_old_tip: '切换旧图', + ai_portrait_title: 'AI人像分离', + ai_portrait_desc: '支持PNG,JPEG,GIF格式', + ai_removebg_title: 'AI人物抠像', + ai_removebg_desc: '支持PNG,JPEG,GIF格式', + ai_removebg_upload_tip: '点击上传视频文件或拖拽文件到这里', + ai_removebg_accuracy_tip: '设置精度:', + ai_removebg_accuracy_set: '设置精度', + ai_removebg_download_tip: '下载成品', + mp4_upload_tip: '点击上传{{format}}文件或拖拽文件到这里', + mp4_upload_sub_tip: '支持{{format}}类型文件', + mp4_download: '下载成品', + mp4_compress_title: 'MP4视频压缩', + mp4_compress_desc: '压缩只支持H264编码的MP4视频', + mov2mp4_title: 'MOV转MP4', + mov2mp4_desc: '格式转换,保留H265编码', + mp4_null_tip: '未设置视频', + capture_frame_title: '视频截帧', + capture_frame_desc: '截取指定帧图为PNG格式', + download_snapshot: '下载截图', + json2mp4_format_error: '工程JSON数据格式异常', + json2mp4_title: 'JSON转MP4', + json2mp4_desc: '视频的工程JSON文件', + json2mp4_placeholder: '请输入JSON文件内容', + json2mp4_stop_destroy: '终止&销毁', + json2mp4_download_mp4: '下载MP4', + custom_size: '自定义', + custom_size_tip: '自定义视频尺寸', + custom_size_width: '宽度', + custom_size_height: '高度', + custom_size_tip_err: '请输入正整数', + product_title: '云端合成', + product_preparing: '准备中...', + product_composing: '合成进度 {{progress}}%', + product_completed: '已完成', + product_failed: '合成失败', + product_download: '下载MP4', + product_fps: '帧率', + product_resolution: '分辨率', + product_duration: '时长', + img2txt_title: '从图片提取文字', + img2txt_support_format: '支持JPG、JPEG、PNG格式的图片', + tool_disabled: '功能开发中,静候佳音...', + webm2mp4_title: 'WEBM转MP4', + webm2mp4_desc: '格式转换,保留H264编码', + mp42mp3_title: 'MP4转MP3', + mp42mp3_desc: '格式转换,保留AAC编码', + aac2mp3_title: 'AAC/M4A/WAV转MP3', + aac2mp3_desc: '格式转换,保留AAC编码', + loading_more: '加载中...', + material: '素材', + project: '项目', + userAccount: '用户账号', + messageCenter: '消息中心', + agreement: '用户协议', + logout: '退出登录', + create_project: '创建项目', + create_project_desc: '点击这里创建一个视频混剪项目', + generate_script: '生成脚本', + generate_script_desc: '通过AI自动生成视频脚本', + select_material: '选择素材', + select_material_desc: '选择要使用的素材', + generate_video: '生成视频', + generate_video_desc: '对AI生成的视频进行预览和选择', + cloud_composition: '云合成', + cloud_composition_desc: '混剪后的视频在云端进行合成', + decode_error: '转码失败', + back: '返回', + selected_material: '已选择素材', + selected_material_tips: '请选择素材', + generate_script_tips: '请先生成脚本', + upload_complete: '上传完成', + upload_ready: '上传准备', + upload_tips: '请先通过AI生成脚本', + one_duration: '单条时长', + num: '生成数量', + generate_script_info: '请输入视频要求...', + custom_title: '自定义脚本', + custom_title_placeholder: '每行代表一个字幕', + selected_material_tips_before: '请先导入素材', + network_error: '网络异常,请重新试', + prev_step: '上一步', + select_all: '全选', + selected_count: '已选中', + selected_material_tips2: '请选择要合成的视频', + encoder_audios: '批量合成音频', + encoder_audios_tips: '请选择要合成的视频', + encoder_audios_tips2: '请先为选中的视频添加音频', + title: '标题', + audio: '音频', + encoder_audio_start: '合成音频', + confirm_delete: '确认删除吗?', + confirm: '确认', + delete: '删除', + preview: '预览', + edit: '编辑', + export: '本地导出', + select_audio: '选择音频', + status_pending: '待处理', + status_processing: '处理中', + status_success: '成功', + status_failed: '失败', + task_id: '任务ID', + project_id: '项目ID', + project_name: '项目名称', + progress: '进度', + status: '状态', + created_at: '创建时间', + action: '操作', + download: '下载', + encoding_failed: '转码失败', + common_back: '返回', + selected_selected: '已选择素材', + common_confirm_import: '确认导入', + common_success: '操作成功', + common_import: '导入素材', + common_fps: '帧率', + common_size: '视频尺寸', + common_videomix_docs: '混剪工具', + common_no_source: '暂无素材', + common_no_source_desc: '暂无上传任何素材', + common_update_log: '更新日志', + common_update_log_desc: '查看无界云剪的更新日志', + common_delete: '删除', + common_email: '邮箱', + common_delete_success: '删除成功!', + draft_cancel: '取消', +}; diff --git a/src/layout/agreement-layout/AgreementLayout.tsx b/src/layout/agreement-layout/AgreementLayout.tsx new file mode 100644 index 0000000..ff8fa4a --- /dev/null +++ b/src/layout/agreement-layout/AgreementLayout.tsx @@ -0,0 +1,28 @@ +import React, { useEffect } from "react"; +import { renderRoutes } from "react-router-config"; +import styles from "./agreementLayout.module.less"; +import Sidebar from "./sidebar"; +import Footer from "@components/footer"; +import ColorBg from "../workspace-layout/ColorBg"; +import Header from "@components/header"; + +function AgreementLayout({ route }) { + useEffect(() => { + window.scrollTo(0, 0); + }, [location.pathname]); + + return ( + <> +
+
+
+ +
{renderRoutes(route.routes)}
+ +
+
+ + ); +} + +export default AgreementLayout; diff --git a/src/layout/agreement-layout/agreementLayout.module.less b/src/layout/agreement-layout/agreementLayout.module.less new file mode 100644 index 0000000..cdad9c0 --- /dev/null +++ b/src/layout/agreement-layout/agreementLayout.module.less @@ -0,0 +1,22 @@ +.agreementLayout { + display: flex; + justify-content: center; + min-height: 100vh; + background: var(--theme-bg); + color: var(--theme-text); + position: relative; +} + +.content { + padding: 30px; + overflow: auto; + max-width: 1200px; + flex: 1; +} + +.bg { + height: 240px; + margin-top: 60px; + background-image: url('/assets/images/userbg.png'); + background-repeat: no-repeat; +} diff --git a/src/layout/agreement-layout/index.ts b/src/layout/agreement-layout/index.ts new file mode 100644 index 0000000..2a7fee3 --- /dev/null +++ b/src/layout/agreement-layout/index.ts @@ -0,0 +1,3 @@ +import AgreementLayout from './AgreementLayout'; + +export default AgreementLayout; diff --git a/src/layout/agreement-layout/sidebar/Sidebar.tsx b/src/layout/agreement-layout/sidebar/Sidebar.tsx new file mode 100644 index 0000000..2bf09b3 --- /dev/null +++ b/src/layout/agreement-layout/sidebar/Sidebar.tsx @@ -0,0 +1,40 @@ +import React from "react"; +import { NavLink } from "react-router-dom"; +import styles from "./sidebar.module.less"; + +const Sidebar = () => { + const navList = [ + { + name: "用户协议", + path: "/user/agreement", + }, + { + name: "隐私政策", + path: "/user/privacy", + }, + { + name: "会员服务协议", + path: "/user/vipService", + }, + ]; + + return ( +
+
+ {navList.map((item) => ( + +
+ {item.name} +
+
+ ))} +
+
+ ); +}; + +export default Sidebar; diff --git a/src/layout/agreement-layout/sidebar/index.ts b/src/layout/agreement-layout/sidebar/index.ts new file mode 100644 index 0000000..006af70 --- /dev/null +++ b/src/layout/agreement-layout/sidebar/index.ts @@ -0,0 +1,3 @@ +import Sidebar from './Sidebar'; + +export default Sidebar; diff --git a/src/layout/agreement-layout/sidebar/sidebar.module.less b/src/layout/agreement-layout/sidebar/sidebar.module.less new file mode 100644 index 0000000..7966b62 --- /dev/null +++ b/src/layout/agreement-layout/sidebar/sidebar.module.less @@ -0,0 +1,41 @@ +.sidebar { + width: 240px; + flex-shrink: 0; + padding: 20px 12px; + background: var(--theme-bg-light); + border-right: 1px solid var(--theme-border); + color: var(--theme-text); + position: sticky; + top: 60px; + height: fit-content; + max-height: calc(100vh - 80px); + overflow-y: auto; + + .navList { + .navItem { + display: flex; + align-items: center; + height: 40px; + margin-bottom: 10px; + padding-left: 28px; + border-radius: 6px; + cursor: pointer; + transition: background-color 0.3s ease; + + .text { + font-size: 14px; + color: var(--theme-text); + } + + &:hover { + background: var(--theme-input); + } + } + + .active { + .navItem { + background: var(--theme-input); + } + } + } +} diff --git a/src/layout/home-layout/HomeLayout.tsx b/src/layout/home-layout/HomeLayout.tsx new file mode 100644 index 0000000..f93238b --- /dev/null +++ b/src/layout/home-layout/HomeLayout.tsx @@ -0,0 +1,32 @@ +// import styles from './index-layout.module.less'; + +import React, { useEffect } from 'react'; +import { renderRoutes } from 'react-router-config'; +import { checkAuth } from '@utils/checkAuth'; +import { userService } from '@server/index'; +import PageLoading from '@components/page-loading'; +import { inject, observer } from 'mobx-react'; +import { Spin } from '@douyinfe/semi-ui'; +import { user } from '@stores/user'; +import Sidebar from '@layout/workspace-layout/sidebar'; + +function HomeLayout({ route }: any) { + useEffect(() => { + if (user.token && !user.info) { + userService.getUserDetail(); + } + }, []); + + if (checkAuth() && !user.info) { + return ; + } + + return ( + <> + {/* */} + + {renderRoutes(route.routes)} + + ); +} +export default observer(HomeLayout); diff --git a/src/layout/home-layout/home-layout.module.less b/src/layout/home-layout/home-layout.module.less new file mode 100644 index 0000000..dc264ec --- /dev/null +++ b/src/layout/home-layout/home-layout.module.less @@ -0,0 +1,13 @@ +@import '../../less/variable.less'; + +.index-layout { + width: 100%; + height: 100vh; + + .index-layout-header { + height: @headerHeight; + background: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + z-index: 1000; + } +} diff --git a/src/layout/home-layout/index.ts b/src/layout/home-layout/index.ts new file mode 100644 index 0000000..7d7f97f --- /dev/null +++ b/src/layout/home-layout/index.ts @@ -0,0 +1,3 @@ +import HomeLayout from './HomeLayout'; + +export default HomeLayout; diff --git a/src/layout/index-layout/IndexLayout.tsx b/src/layout/index-layout/IndexLayout.tsx new file mode 100644 index 0000000..03a0c47 --- /dev/null +++ b/src/layout/index-layout/IndexLayout.tsx @@ -0,0 +1,42 @@ +// import styles from './index-layout.module.less'; + +import React, { useEffect, useReducer } from 'react'; +import { renderRoutes } from 'react-router-config'; +import { checkAuth } from '@utils/checkAuth'; +import { userService } from '@server/index'; +import PageLoading from '@components/page-loading'; +import { inject, observer } from 'mobx-react'; +import { Spin } from '@douyinfe/semi-ui'; +import { user } from '@stores/user'; +import { stores } from '@stores/index'; +import FolderGuard from '@components/folder-guard/FolderGuard'; +// import Footer from '@components/footer'; + +function IndexLayout({ route }: any) { + const { user } = stores; + const [, forceUpdate] = useReducer(x => x + 1, 0); + useEffect(() => { + if (checkAuth() && !user.info) { + userService.getUserDetail(); + forceUpdate(); + return; + } + }, []); + + if (checkAuth() && !user.info) { + return ; + } + + if (!user.info) { + return
没有访问权限
; + } + + return ( + + + {renderRoutes(route.routes)} + {/*
*/} + + ); +} +export default observer(IndexLayout); diff --git a/src/layout/index-layout/index-layout.module.less b/src/layout/index-layout/index-layout.module.less new file mode 100644 index 0000000..dc264ec --- /dev/null +++ b/src/layout/index-layout/index-layout.module.less @@ -0,0 +1,13 @@ +@import '../../less/variable.less'; + +.index-layout { + width: 100%; + height: 100vh; + + .index-layout-header { + height: @headerHeight; + background: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + z-index: 1000; + } +} diff --git a/src/layout/index-layout/index.ts b/src/layout/index-layout/index.ts new file mode 100644 index 0000000..696a8ae --- /dev/null +++ b/src/layout/index-layout/index.ts @@ -0,0 +1,3 @@ +import IndexLayout from './IndexLayout'; + +export default IndexLayout; diff --git a/src/layout/user-layout/UserLayout.tsx b/src/layout/user-layout/UserLayout.tsx new file mode 100644 index 0000000..0c49433 --- /dev/null +++ b/src/layout/user-layout/UserLayout.tsx @@ -0,0 +1,41 @@ +import React, { useEffect } from "react"; +import { renderRoutes } from "react-router-config"; +import { checkAuth } from "@utils/checkAuth"; +import { userService } from "@server/index"; +import PageLoading from "../../components/page-loading"; +import { inject, observer } from "mobx-react"; +import { Spin } from "@douyinfe/semi-ui"; +import Header from "@components/header"; +import styles from "./userLayout.module.less"; +import Sidebar from "./sidebar"; +import ColorBg from "../workspace-layout/ColorBg"; +import { user } from "@stores/user"; +import Footer from "@components/footer"; +import FolderGuard from "@components/folder-guard/FolderGuard"; + +function UserLayout({ route }) { + useEffect(() => { + if (checkAuth() && !user.info) { + userService.getUserDetail(); + } + }, []); + + if (checkAuth() && !user.info) { + return ; + } + + return ( + + +
+
+
+ +
{renderRoutes(route.routes)}
+ +
+
+ + ); +} +export default observer(UserLayout); diff --git a/src/layout/user-layout/index.ts b/src/layout/user-layout/index.ts new file mode 100644 index 0000000..ee57778 --- /dev/null +++ b/src/layout/user-layout/index.ts @@ -0,0 +1,3 @@ +import UserLayout from './UserLayout'; + +export default UserLayout; diff --git a/src/layout/user-layout/sidebar/Sidebar.tsx b/src/layout/user-layout/sidebar/Sidebar.tsx new file mode 100644 index 0000000..1e004e5 --- /dev/null +++ b/src/layout/user-layout/sidebar/Sidebar.tsx @@ -0,0 +1,72 @@ +import React, { useState, useEffect } from 'react'; +import { NavLink } from 'react-router-dom'; + +import styles from './sidebar.module.less'; +import { Box, AllApplication, VipOne } from '@icon-park/react'; +import { layout } from '@stores/layout'; +import { Avatar } from '@douyinfe/semi-ui'; +import { observer } from 'mobx-react'; +import { user } from '@stores/user'; +import CropUpload from './cropUpload'; +import { language } from '@language/language'; + +const Sidebar = props => { + let pathname = location.pathname.split(''); + const userNavList = [ + { + name: language.val('user_set'), + path: `/user/account`, + icon: , + }, + { + name: language.val('user_message'), + path: `/user/message`, + icon: , + }, + // { + // name: '订单记录', + // path: `/user/order`, + // icon: , + // }, + ]; + + useEffect(() => { + layout.cancelSelected(); + }, [pathname]); + + return ( +
+
+
+ + + {/* */} +
+ {user.info.name} + ID: {user.info.id} +
+
+ {/*

个人中心

*/} +
+ {userNavList.map((d, index) => { + return ( + +
+ {d.icon} + {d.name} +
+
+ ); + })} +
+
+
+ ); +}; + +export default observer(Sidebar); diff --git a/src/layout/user-layout/sidebar/cropUpload/CropUpload.tsx b/src/layout/user-layout/sidebar/cropUpload/CropUpload.tsx new file mode 100644 index 0000000..6c49c57 --- /dev/null +++ b/src/layout/user-layout/sidebar/cropUpload/CropUpload.tsx @@ -0,0 +1,159 @@ +import styles from './cropUpload.module.less'; +import React, { useEffect, useState } from 'react'; +import { Avatar, Upload, Toast, Modal, Slider } from '@douyinfe/semi-ui'; +import { user } from '@stores/user'; +import { getUrl } from '@utils/getUrl'; +import server from './server'; +import Cropper from 'react-easy-crop'; +import type { Point, Area } from 'react-easy-crop/types'; +import { util } from '@utils/index'; + +const CropUpload = () => { + const [selectedImage, setSelectedImage] = useState(null); + const [crop, setCrop] = useState({ x: 0, y: 0 }); + const [zoom, setZoom] = useState(1); + const [boxScale, setBoxScale] = useState(1); + const [cropArea, setCropArea] = useState(); + const boxSize = { width: 550, height: 400 }; + + const uploadChange = async file => { + const url = URL.createObjectURL(file.currentFile.fileInstance); + const _img = await util.imgLazy(url); + const scale = Math.max(_img.naturalWidth / boxSize.width, _img.naturalHeight / boxSize.height, 1); + console.log('ssssssss', _img.naturalWidth, _img.naturalHeight); + setBoxScale(scale); + setSelectedImage(url); + }; + + const beforeUpload = ({ file }) => { + const { fileInstance } = file; + const isJpgOrPng = + fileInstance.type === 'image/jpeg' || fileInstance.type === 'image/png' || fileInstance.type === 'image/jpg'; + if (!isJpgOrPng) { + Toast.error('只能上传png/jpeg/jpg格式'); + } + return isJpgOrPng; + }; + + const getBase64 = () => { + return new Promise(resolve => { + const image = new Image(); + image.src = selectedImage; + image.onload = () => { + // 图片最大宽度高度不能超过200px + const maxSize = 200; + const canvas = document.createElement('canvas'); + canvas.width = Math.min(cropArea.width, maxSize); + canvas.height = Math.min(cropArea.height, maxSize); + const ctx = canvas.getContext('2d'); + + // 设置背景颜色为白色 + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, canvas.width, canvas.height); + + ctx.drawImage( + image, + cropArea.x, + cropArea.y, + cropArea.width, + cropArea.height, + 0, + 0, + canvas.width, + canvas.height, + ); + const base64Image = canvas.toDataURL('image/png'); + resolve(base64Image); + }; + }); + }; + + const uploadCropImage = async () => { + const croppedImage = await getBase64(); + const [uploadRes, uploadErr] = await server.uploadBase64({ content: croppedImage }); + + if (uploadErr) { + Toast.success('头像上传失败'); + return; + } + + const [updateRes, updateErr] = await server.accountUpdate({ + avatar: uploadRes.storage_path, + }); + + if (updateErr) { + Toast.success('头像更新失败'); + return; + } + + user.info.avatar = uploadRes.storage_path; + Toast.success('头像修改成功'); + setSelectedImage(null); + }; + + return ( +
+ {}} + headers={{ + Authorization: user.token, + }} + onChange={uploadChange} + showUploadList={false} + beforeUpload={beforeUpload} + accept=".png,.jpg,.jpeg,.gif,.svg" + > +
+ +
+
+ setSelectedImage(null)} + onOk={uploadCropImage} + > +
+
+ { + //croppedArea百分比单位 croppedAreaPixels像素为单位 + setCropArea(croppedAreaPixels); + }} + onZoomChange={setZoom} + /> +
+
+
+
+ ); +}; + +export default CropUpload; diff --git a/src/layout/user-layout/sidebar/cropUpload/cropUpload.module.less b/src/layout/user-layout/sidebar/cropUpload/cropUpload.module.less new file mode 100644 index 0000000..1baaa6d --- /dev/null +++ b/src/layout/user-layout/sidebar/cropUpload/cropUpload.module.less @@ -0,0 +1,6 @@ +.cropBox { + height: 400px; + width: 550px; + position: relative; + transform-origin: 0 0; +} diff --git a/src/layout/user-layout/sidebar/cropUpload/index.ts b/src/layout/user-layout/sidebar/cropUpload/index.ts new file mode 100644 index 0000000..392f6de --- /dev/null +++ b/src/layout/user-layout/sidebar/cropUpload/index.ts @@ -0,0 +1,3 @@ +import CropUpload from './CropUpload'; + + export default CropUpload; \ No newline at end of file diff --git a/src/layout/user-layout/sidebar/cropUpload/server.ts b/src/layout/user-layout/sidebar/cropUpload/server.ts new file mode 100644 index 0000000..ee3ba13 --- /dev/null +++ b/src/layout/user-layout/sidebar/cropUpload/server.ts @@ -0,0 +1,16 @@ +import BasicService from '@server/BasicService'; +class Server extends BasicService { + + // base64 上传 + uploadBase64 = async data => { + return await this.post(`/common/upload/base64`, data); + }; + + //更新账户信息 + accountUpdate = async data => { + return this.post('/account/update', data); + }; +} +const server = new Server(); + +export default server; diff --git a/src/layout/user-layout/sidebar/index.ts b/src/layout/user-layout/sidebar/index.ts new file mode 100644 index 0000000..0f9e103 --- /dev/null +++ b/src/layout/user-layout/sidebar/index.ts @@ -0,0 +1,2 @@ +import Sidebar from './Sidebar'; +export default Sidebar; diff --git a/src/layout/user-layout/sidebar/sidebar.module.less b/src/layout/user-layout/sidebar/sidebar.module.less new file mode 100644 index 0000000..9b26f57 --- /dev/null +++ b/src/layout/user-layout/sidebar/sidebar.module.less @@ -0,0 +1,72 @@ +.sidebar { + width: 240px; + // overflow: auto; + color: var(--theme-text); + position: relative; + + .vip { + position: absolute; + top: 0; + right: 0; + z-index: 100; + } + + .avatar { + position: absolute; + top: -70px; + left: 35px; + text-align: center; + .nickName { + display: block; + font-size: 14px; + color: var(--theme-text); + // opacity: 1; + font-weight: bolder; + margin-top: 5px; + } + .uid { + font-size: 12px; + color: var(--theme-text); + opacity: 0.5; + } + } + + .workspace { + padding: 0 12px; + margin-top: 120px; + .title { + margin-bottom: 17px; + padding-left: 28px; + font-size: 12px; + opacity: 0.5; + } + .navList { + .navItem { + display: flex; + align-items: center; + height: 40px; + margin-bottom: 10px; + padding-left: 28px; + border-radius: 6px; + cursor: pointer; + .text { + font-size: 14px; + margin-left: 12px; + color: var(--theme-text); + } + } + :global { + .i-icon { + position: relative; + top: 3px; + } + } + + .active { + .navItem { + background: var(--theme-input); + } + } + } + } +} diff --git a/src/layout/user-layout/userLayout.module.less b/src/layout/user-layout/userLayout.module.less new file mode 100644 index 0000000..ab6286d --- /dev/null +++ b/src/layout/user-layout/userLayout.module.less @@ -0,0 +1,24 @@ +.userLayout { + width: 1000px; + display: flex; + position: relative; + margin: 0 auto; + border-top: var(--theme-border); + background-color: var(--theme-bg4); + color: var(--theme-text); + z-index: 100; + + .content { + border-left: var(--theme-border); + width: calc(100% - 240px); + position: relative; + z-index: 100; + } +} + +.bg { + height: 240px; + margin-top: 60px; + background-image: url('/assets/images/userbg.png'); + background-repeat: no-repeat; +} diff --git a/src/layout/workspace-layout/ColorBg.tsx b/src/layout/workspace-layout/ColorBg.tsx new file mode 100644 index 0000000..bb3ae67 --- /dev/null +++ b/src/layout/workspace-layout/ColorBg.tsx @@ -0,0 +1,19 @@ +import styles from './workspaceLayout.module.less'; + +export interface IProps { + style: { + top?: number; + left?: number; + bottom?: number; + right?: number; + }; +} + +export default function ColorBg(props: IProps) { + return ( +
+ + +
+ ); +} diff --git a/src/layout/workspace-layout/WorkspaceLayout.tsx b/src/layout/workspace-layout/WorkspaceLayout.tsx new file mode 100644 index 0000000..c9f61c3 --- /dev/null +++ b/src/layout/workspace-layout/WorkspaceLayout.tsx @@ -0,0 +1,39 @@ +import styles from './workspaceLayout.module.less'; + +import React, { useEffect } from 'react'; +import { renderRoutes } from 'react-router-config'; +import { checkAuth } from '@utils/checkAuth'; +import { userService } from '@server/index'; +import PageLoading from '@components/page-loading'; +import { inject, observer } from 'mobx-react'; +import { Spin } from '@douyinfe/semi-ui'; +import { user } from '@stores/user'; +import Sidebar from './sidebar'; +import ColorBg from './ColorBg'; +import Header from '@components/header'; +import FolderGuard from '@components/folder-guard/FolderGuard'; + +function WorkspaceLayout({ route }: any) { + useEffect(() => { + if (checkAuth() && !user.info) { + userService.getUserDetail(); + } + }, []); + + if (checkAuth() && !user.info) { + return ; + } + + return ( + +
+ +
+ {/* */} +
{renderRoutes(route.routes)}
+ {/* */} +
+ + ); +} +export default inject('user')(observer(WorkspaceLayout)); diff --git a/src/layout/workspace-layout/index.ts b/src/layout/workspace-layout/index.ts new file mode 100644 index 0000000..d82938f --- /dev/null +++ b/src/layout/workspace-layout/index.ts @@ -0,0 +1,3 @@ +import WorkspaceLayout from './WorkspaceLayout'; + +export default WorkspaceLayout; diff --git a/src/layout/workspace-layout/sidebar/Sidebar.tsx b/src/layout/workspace-layout/sidebar/Sidebar.tsx new file mode 100644 index 0000000..383f937 --- /dev/null +++ b/src/layout/workspace-layout/sidebar/Sidebar.tsx @@ -0,0 +1,170 @@ +import React, { useState, useEffect, useReducer } from 'react'; +import { NavLink, Link, useHistory } from 'react-router-dom'; +import styles from './sidebar.module.less'; +// import avatarImg from "@images/user/avatar.png"; +import { + Box, + AllApplication, + Help, + FolderSuccessOne, + User, + Logout, + Agreement, + Remind, + Theme, + Home, +} from '@icon-park/react'; +import { layout } from '@stores/layout'; +import { observer } from 'mobx-react'; +import { user } from '@stores/user'; +// import { language } from "@language/language"; +import { Avatar, Dropdown, Popover, Space } from '@douyinfe/semi-ui'; +import { language } from '@language/language'; +import { theme, ThemeName } from '@theme'; +import classNames from 'classnames'; + +const Sidebar = props => { + const history = useHistory(); + const [, forceUpdate] = useReducer(x => x + 1, 0); + + const userNavList = [ + { + name: '首页', // 素材 + path: `/home`, + icon: , + }, + { + name: language.val('project'), // 项目 + path: `/workspace/draft`, + icon: , + }, + { + name: language.val('material'), // 素材 + path: `/workspace/material`, + icon: , + }, + // { + // name: 'Ai Words', // 人工智能 + // path: `/workspace/aiword`, + // icon: , + // }, + // { + // name: "成品", + // path: `/workspace/product`, + // icon: ( + // + // ), + // }, + // { + // name: '帮助', + // href: `/workspace/help`, + // icon: , + // }, + ]; + + let pathname = location.pathname.split(''); + + useEffect(() => { + layout.cancelSelected(); + }, [pathname]); + + const info = user.info; + + console.log('pathname>>>>>>>>>>>>', history); + + return ( +
+
+
+ {userNavList.map((d: any, index) => { + if (d.href) { + return ( + + {d.name}}> +
+ {d.icon} + {/* {d.name} */} +
+
+
+ ); + } + return ( + + {d.name}}> +
+ {d.icon} + {/* {d.name} */} +
+
+
+ ); + })} +
+ {/* + + } + onClick={() => history.push('/user/account')} + > + {language.val('userAccount')} + + + } + onClick={() => history.push('/user/message')} + > + {language.val('messageCenter')} + + + } + onClick={() => history.push('/user/agreement')} + > + {language.val('agreement')} + + + } + onClick={() => history.push('/user/logout')} + > + {language.val('logout')} + + + } + > +
+
+ + {info.name.toUpperCase().split('')[0]} + +
+
+
*/} +
+
+ ); +}; + +export default observer(Sidebar); diff --git a/src/layout/workspace-layout/sidebar/index.ts b/src/layout/workspace-layout/sidebar/index.ts new file mode 100644 index 0000000..0f9e103 --- /dev/null +++ b/src/layout/workspace-layout/sidebar/index.ts @@ -0,0 +1,2 @@ +import Sidebar from './Sidebar'; +export default Sidebar; diff --git a/src/layout/workspace-layout/sidebar/sidebar.module.less b/src/layout/workspace-layout/sidebar/sidebar.module.less new file mode 100644 index 0000000..fb2413b --- /dev/null +++ b/src/layout/workspace-layout/sidebar/sidebar.module.less @@ -0,0 +1,105 @@ +.sidebar { + width: 60px; + overflow: auto; + border-right: 1px solid var(--theme-border); + color: var(--theme-text); + background-color: var(--theme-bg); + border-radius: 100px; + padding: 20px 0; + position: fixed; + top: 50%; + left: 10px; + transform: translateY(-50%); + display: flex; + flex-direction: column; + z-index: 100; + + .navContainer { + flex: 1; + overflow-y: auto; + + .navList { + .navItem { + display: flex; + align-items: center; + height: 60px; + border-radius: 100px; + // margin: 0 10px; + padding: 0 20px; + cursor: pointer; + // border-radius: 100px; + transition: background-color 0.3s ease; + + :global { + .i-icon { + height: 19px; + } + } + + .text { + font-size: 14px; + margin-left: 12px; + color: var(--theme-text); + } + } + + .active { + .navItem { + rect, + path { + stroke: var(--theme-main2); + // fill: var(--theme-main); + } + // background-color: var(--theme-input); + // .text { + // color: var(--theme-main); + // } + } + } + + // .navItem:hover { + // // background-color: var(--theme-input); + // } + // .active { + // .navItem:hover { + // // background-color: var(--theme-input); + // } + // } + } + } + + .user { + align-items: center; + padding: 12px 14px; + margin-top: auto; + cursor: pointer; + + .avatar { + position: relative; + margin-right: 12px; + } + + .info { + display: flex; + flex-direction: column; + justify-content: center; + + .name { + font-size: 12px; + font-weight: 500; + color: var(--theme-text); + } + + .id { + opacity: 0.5; + font-size: 11px; + color: var(--theme-text-light); + } + } + } +} + +.popoverContent{ + font-size: 14px; + color: var(--theme-text); +} \ No newline at end of file diff --git a/src/layout/workspace-layout/workspaceLayout.module.less b/src/layout/workspace-layout/workspaceLayout.module.less new file mode 100644 index 0000000..d338c4b --- /dev/null +++ b/src/layout/workspace-layout/workspaceLayout.module.less @@ -0,0 +1,48 @@ +.workspaceLayout { + position: relative; + width: 100%; + margin-top: 80px; + min-height: calc(100vh - 80px); + background-color: var(--theme-bg4); + color: var(--theme-text); + + .content { + margin: 0 160px; + width: calc(100% - 320px); + position: relative; + z-index: 100; + } +} + +.colorbg { + width: 0; + height: 0; + position: fixed; + z-index: 0; + pointer-events: none; + opacity: 0.5; + transform-origin: center; + transform: scale(1.5); + z-index: 0; + + .box1 { + position: absolute; + left: 135.56px; + top: 221.82px; + width: 702.44px; + height: 702.44px; + transform: translate(-50%, -50%); + opacity: 1; + background: radial-gradient(50% 50% at 50% 50%, rgba(189, 0, 255, 0.25) 0%, rgba(173, 0, 255, 0) 100%); + } + .box2 { + position: absolute; + left: 0px; + top: 0px; + width: 702.44px; + height: 702.44px; + opacity: 1; + transform: translate(-50%, -50%); + background: radial-gradient(50% 50% at 50% 50%, rgba(0, 71, 255, 0.25) 0%, rgba(0, 102, 255, 0) 100%); + } +} diff --git a/src/less/initialize.less b/src/less/initialize.less new file mode 100644 index 0000000..e80cc40 --- /dev/null +++ b/src/less/initialize.less @@ -0,0 +1,233 @@ +@font-face { + font-family: 'zhanKu'; + src: url('/assets/zhanKu.woff'); +} +@font-face { + font-family: 'JamMono'; + src: url('/assets/JamMono.ttf'); +} + +// JamMono + +body { + margin: 0; + background: var(--theme-bg4); + + dl, + dt, + dd, + ul, + ol, + li, + h1, + h2, + h3, + h4, + h5, + h6, + pre, + form, + fieldset, + input, + textarea, + p, + blockquote, + th, + td { + padding: 0; + margin: 0; + color: inherit; + } + + a { + text-decoration: none; + cursor: pointer; + outline: none; + } + + table { + border-spacing: 0; + } + + fieldset, + img { + border: 0; + } + + address, + caption, + cite, + code, + dfn, + em, + strong, + th, + var { + font-weight: normal; + font-style: normal; + } + + strong { + font-weight: bold; + } + + ol, + ul, + li { + list-style: none; + } + + caption, + th { + text-align: left; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + font-weight: normal; + margin: 0; + padding: 0; + } + + q:before, + q:after { + content: ''; + } + + abbr, + acronym { + border: 0; + } + + textarea, + input { + outline: none; + } + + button { + border: none; + outline: none; + } + + hr { + border-color: #e8e8e8; + border-width: 1px; + border-top: none; + } + + -webkit-text-size-adjust: none; + + * { + box-sizing: border-box; + } + + div:focus { + outline: none; + } +} + +#root { + // width: 100vw; + height: 100vh; + // overflow: hidden; +} + +.noscroll::-webkit-scrollbar { + display: none; +} + +.scroll{ + overflow: auto; + scrollbar-width: thin; + scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.0); +} +.scroll::-webkit-scrollbar { + --scroll: rgba(255, 255, 255, 0.8); + --scrollbar-top-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.102 16.981c-1.074 0-1.648-1.265-.941-2.073l5.522-6.311a1.75 1.75 0 0 1 2.634 0l5.522 6.311c.707.808.133 2.073-.941 2.073H6.102z' fill='rgb(0 0 0 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-right-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 17.898c0 1.074 1.265 1.648 2.073.941l6.311-5.522a1.75 1.75 0 0 0 0-2.634l-6.311-5.522C10.265 4.454 9 5.028 9 6.102v11.796z' fill='rgb(0 0 0 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-bottom-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.102 8c-1.074 0-1.648 1.265-.941 2.073l5.522 6.311a1.75 1.75 0 0 0 2.634 0l5.522-6.311c.707-.808.133-2.073-.941-2.073H6.102z' fill='rgb(0 0 0 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-left-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15 17.898c0 1.074-1.265 1.648-2.073.941l-6.311-5.522a1.75 1.75 0 0 1 0-2.634l6.311-5.522c.808-.707 2.073-.133 2.073.941v11.796z' fill='rgb(0 0 0 / 50%)'/%3E%3C/svg%3E"); + width: 14px; + height: 14px; + border-radius: 7px; +} + +.scroll::-webkit-scrollbar:vertical:hover { + background: var(--scrollbar-bottom-btn) 0% calc(100% - 3px) / contain no-repeat, + var(--scrollbar-top-btn) 0% calc(0% + 3px) / contain no-repeat, var(--scroll); +} + +.scroll::-webkit-scrollbar:horizontal:hover { + background: var(--scrollbar-right-btn) calc(100% - 3px) 0% / contain no-repeat, + var(--scrollbar-left-btn) calc(0% + 3px) 0% / contain no-repeat, var(--scroll); +} + +.scroll::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.5); + background-clip: padding-box; + border: 6px solid transparent; + border-radius: 14px; +} + +.scroll::-webkit-scrollbar-thumb:hover { + border: 4px solid transparent; +} + +.scroll::-webkit-scrollbar-button:single-button { + height: 14px; +} + +.scroll:hover::-webkit-scrollbar-thumb { + display: block; +} + +body[theme-mode='dark'] .scroll::-webkit-scrollbar, +.scrollDark::-webkit-scrollbar { + --scroll: rgba(44, 44, 44, 0.25); + --scrollbar-top-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.102 16.981c-1.074 0-1.648-1.265-.941-2.073l5.522-6.311a1.75 1.75 0 0 1 2.634 0l5.522 6.311c.707.808.133 2.073-.941 2.073H6.102z' fill='rgb(255 255 255 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-right-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 17.898c0 1.074 1.265 1.648 2.073.941l6.311-5.522a1.75 1.75 0 0 0 0-2.634l-6.311-5.522C10.265 4.454 9 5.028 9 6.102v11.796z' fill='rgb(255 255 255 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-bottom-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.102 8c-1.074 0-1.648 1.265-.941 2.073l5.522 6.311a1.75 1.75 0 0 0 2.634 0l5.522-6.311c.707-.808.133-2.073-.941-2.073H6.102z' fill='rgb(255 255 255 / 50%)'/%3E%3C/svg%3E"); + --scrollbar-left-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15 17.898c0 1.074-1.265 1.648-2.073.941l-6.311-5.522a1.75 1.75 0 0 1 0-2.634l6.311-5.522c.808-.707 2.073-.133 2.073.941v11.796z' fill='rgb(255 255 255 / 50%)'/%3E%3C/svg%3E"); +} + +body[theme-mode='dark'] .scroll::-webkit-scrollbar-thumb, +.scrollDark::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.5); + background-clip: padding-box; +} + +body[theme-mode='light'] .scroll{ + overflow: auto; + scrollbar-width: thin; + scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.0); +} + +body { + .semi-popover-wrapper { + border-radius: 4px; + background-color: var(--theme-bg); + } +} + +.downChrome { + padding: 100px; + text-align: center; + h1 { + margin: 20px 0; + } + a { + display: inline-block; + margin-top: 40px; + background-color: #1967d2; + border-radius: 100px; + font-size: 1rem; + line-height: 1.5rem; + color: #fff; + font-weight: 500; + padding: 10px 20px; + } +} diff --git a/src/less/variable.less b/src/less/variable.less new file mode 100644 index 0000000..1f82a84 --- /dev/null +++ b/src/less/variable.less @@ -0,0 +1,3 @@ +@headerHeight: 60px; +@footerHeight: 120px; +@bodyWidth: 1200px; diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..743451a --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,30 @@ +import * as sdk from 'video-core-sdk'; +import '@less/initialize.less'; +// import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import { Provider } from 'mobx-react'; +import { stores } from './stores'; +import { BrowserRouter } from 'react-router-dom'; // 路由 +import { routes } from './routes.config'; +import { LocaleProvider } from '@douyinfe/semi-ui'; +import { language } from '@language/language'; +import zh_CN from '@douyinfe/semi-ui/lib/es/locale/source/zh_CN'; +import en_US from '@douyinfe/semi-ui/lib/es/locale/source/en_US'; + +console.log('xxxxxxxxxxx',sdk); + +const locale = { + 'zh-CN': zh_CN, + 'en-US': en_US, +}[language.getLanguage()]; + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + + + , +); + +export { routes }; diff --git a/src/pages/aboutus/AboutUs.tsx b/src/pages/aboutus/AboutUs.tsx new file mode 100644 index 0000000..4f65b2c --- /dev/null +++ b/src/pages/aboutus/AboutUs.tsx @@ -0,0 +1,74 @@ +import styles from './styles.module.less'; +// import { Link } from 'react-router-dom'; +// import { Space } from '@douyinfe/semi-ui'; +import { useEffect, useRef } from 'react'; +import { observer } from 'mobx-react'; +import { layout } from '@stores/layout'; +import Links from './Links'; +import SubHeader from '@components/sub-header/SubHeader'; +import { language } from '@language/language'; + +const win = window as any; + +interface IProps { + ssrRes?: any; // 服务器渲染加载的数据 + location: { pathname: string; search: string; hash: string; state: any }; + history: History; + match: { path: string; url: string; isExact: boolean; params: any }; + staticContext: { path: string; url: string; isExact: boolean; params: any }; + route: { path: string; ssr: boolean; exact: boolean; component: JSX.Element }; +} + +function AboutUs(props: IProps) { + const ref = useRef(); + + return ( +
+ + {language.getLanguage() === 'zh-CN' ? ( +
+

+ “四川爱趣五科技”是一家专注研发可视化内容生产工具的公司目前自主研发的产品包括:
+ 无界云剪,希尔桌面,H5DS编辑器,图片设计工具,720全景图工具, + 3D云展厅 +
+ 主要为客户提供私有化部署以及源码授权,降低开发成本,提升效率。 +

+

+ 咨询电话(董经理): + + 13551301693 + +

+

地址:成都市高新区天府五街美年广场C-808

+
+ ) : ( +
+

+ "Sichuan Aiqu Wu Technology" is a company focusing on the R&D of visual content production tools. Currently, + its independently developed products include:
+ Unbounded Cloud Editor, Hill Desktop, H5DS Editor, Image Design Tool,{' '} + 720° Panorama Tool,3D Cloud Exhibition Hall +
+ We mainly provide customers with private deployment and source code authorization to reduce development + costs and improve efficiency. +

+

+ Consultation Email (Manager Dong): + + 676015863@qq.com + +

+

Address: Room C-808, Meinian Plaza, Tianfu 5th Street, High-Tech Zone, Chengdu

+
+ )} + + {/*
*/} +
+ ); +} + +export default observer(AboutUs); diff --git a/src/pages/aboutus/Links.tsx b/src/pages/aboutus/Links.tsx new file mode 100644 index 0000000..d5dfb34 --- /dev/null +++ b/src/pages/aboutus/Links.tsx @@ -0,0 +1,68 @@ +import { Row, Col } from '@douyinfe/semi-ui'; +import React, { useEffect, useRef, useState } from 'react'; +import styles from './links.module.less'; +import { Swiper, SwiperSlide } from 'swiper/react'; +import { Autoplay } from 'swiper/modules'; +import 'swiper/css'; +// link-logo +import logo_1 from '@images/logo_1.png'; +import logo_2 from '@images/logo_2.png'; +import logo_3 from '@images/logo_3.png'; +import logo_4 from '@images/logo_4.png'; +import logo_5 from '@images/logo_5.png'; +import logo_6 from '@images/logo_6.png'; +import logo_7 from '@images/logo_7.png'; +import logo_8 from '@images/logo_8.png'; +import logo_9 from '@images/logo_9.png'; +import logo_10 from '@images/logo_10.png'; +import logo_11 from '@images/logo_11.png'; +import logo_12 from '@images/logo_12.png'; +import logo_13 from '@images/logo_13.png'; +import logo_14 from '@images/logo_14.png'; +import { useResizeDetector } from 'react-resize-detector'; +export interface ILinksProps {} + +export default function Links(props: ILinksProps) { + const { width, ref } = useResizeDetector(); + return ( + +
+
+ 1200 ? 10 : 3} + className={styles.reviewswiper} + > + {[ + logo_1, + logo_2, + logo_3, + logo_4, + logo_5, + logo_6, + logo_7, + logo_8, + logo_9, + logo_10, + logo_11, + logo_12, + logo_13, + logo_14, + ].map((d, i) => { + return ( + +
+ +
+
+ ); + })} +
+
+ + + ); +} diff --git a/src/pages/aboutus/index.ts b/src/pages/aboutus/index.ts new file mode 100644 index 0000000..8cf3293 --- /dev/null +++ b/src/pages/aboutus/index.ts @@ -0,0 +1,11 @@ +import AboutUs from './AboutUs'; + +const routes = [ + { + path: '/article/about', + exact: true, + component: AboutUs, + }, +]; + +export { routes }; diff --git a/src/pages/aboutus/links.module.less b/src/pages/aboutus/links.module.less new file mode 100644 index 0000000..6210d3e --- /dev/null +++ b/src/pages/aboutus/links.module.less @@ -0,0 +1,24 @@ +.links { + // background-color: rgb(255, 255, 255); + position: relative; + bottom: -20px; + .linksSwiper { + overflow: hidden; + } + .linkitem { + filter: grayscale(1); + opacity: 0.5; + // transition: 0.5s; + img { + filter: var(--theme-linkicon-filter); + } + &:hover { + background-color: rgb(255, 255, 255); + filter: grayscale(0); + opacity: 1; + img { + filter: invert(0); + } + } + } +} diff --git a/src/pages/aboutus/styles.module.less b/src/pages/aboutus/styles.module.less new file mode 100644 index 0000000..120c624 --- /dev/null +++ b/src/pages/aboutus/styles.module.less @@ -0,0 +1,43 @@ +.about { + background-color: var(--theme-bg4); + color: var(--theme-text); + min-height: 100vh; + padding-top: 60px; + .content { + max-width: 1000px; + margin: 40px auto; + color: var(--theme-text); + text-align: center; + + h1 { + margin: 40px 0; + font-size: 24px; + font-weight: bolder; + } + + p { + line-height: 40px; + a { + display: inline-block; + background-color: var(--theme-bg3); + color: var(--theme-main); + font-size: 14px; + padding: 0 10px; + border-radius: 100px; + } + + .phone { + color: var(--theme-main); + padding: 0; + background-color: transparent; + font-size: 16px; + } + } + } + .map { + height: 300px; + position: relative; + bottom: -20px; + // pointer-events: none; + } +} diff --git a/src/pages/agreement/agree/index.tsx b/src/pages/agreement/agree/index.tsx new file mode 100644 index 0000000..8eb19e3 --- /dev/null +++ b/src/pages/agreement/agree/index.tsx @@ -0,0 +1,215 @@ +import styles from "./styles.module.less"; +import React from "react"; + +const Agree = () => { + return ( +
+
+
+
用户服务协议
+
+
更新日期:2025年1月30日
+
生效日期:2025年1月30日
+
+
+ +
+
+
导言
+

欢迎您使用本视频混剪工具!

+

+ 本用户协议(以下简称"本协议")是您与本视频混剪工具运营方之间关于您注册、登录及使用本服务所订立的协议。请您在注册账号或使用本服务前仔细阅读本协议的全部内容,特别是以粗体标注的条款。 + + 如您不同意本协议的任意内容,请勿注册或使用本服务。您点击"同意"或实际使用本服务的行为,即视为您已充分理解并同意接受本协议的全部内容。 + +

+

+ 本服务是一款基于网页端的智能视频混剪工具。本服务仅提供网页版,不包含移动应用、小程序等其他版本。 +

+
+ +
+
一、服务说明
+

+ 本服务是一款基于人工智能技术的智能视频混剪工具,主要功能包括但不限于: +
+ (1)视频上传与识别:用户可上传视频文件,系统对视频内容进行智能识别; +
+ (2)智能混剪:基于视频识别结果,系统可自动或根据用户指令进行视频片段的智能剪辑与拼接; +
+ (3)视频导出:用户可将混剪完成的视频导出下载; +
+ (4)其他与本服务相关的功能。 +

+

+ 1.2 + 本服务通过人工智能技术实现视频识别与智能处理功能。您理解并同意,视频识别与混剪的具体效果取决于技术能力,我们不对识别或混剪的准确性、完整性、时效性作出任何明示或暗示的保证。 +

+

+ 1.3 + 本服务仅提供网页版,用户可通过浏览器访问使用。我们不提供移动应用(APP)、小程序或其他平台版本。 +

+

+ 1.4 + 本服务的部分功能可能需要付费使用,具体收费标准以页面公示为准。您在使用付费功能前,请仔细阅读相关说明。 +

+ +
二、账户注册与管理
+

+ 2.1 + 您知悉并承诺,您具有完全民事权利能力,或具备与注册账户和使用本服务相适应的年龄、智力要求。若您不具备前述相适应的民事行为能力即进行账号注册的,您及您的法定监护人应依照法律规定承担因此而导致的一切后果。 +

+

+ 2.2 + 您进行账户注册时,应遵循诚实信用、合法善意的原则,按照注册页面的提示填写注册信息。您使用、填写的账户资料必须真实、准确、合法、有效。 + + 如您提供虚假、不实、失效的信息,我们有权暂停或终止您的服务,且无需承担任何责任。 + +

+

+ 2.3 + 您应对您的账户安全负责,妥善保管账户密码及验证码等信息。因您保管不善导致的账户被盗、密码泄露等损失,我们不承担任何责任。 +

+

+ 2.4 + + 未经我们书面同意,您不得将账户转让、出售、出租、出借或分享给他人使用,否则因此产生的一切后果由您自行承担,我们有权不经通知而限制、冻结、注销您的账户。 + +

+

+ 2.5 + 如您发现账户存在安全漏洞或被盗用情况,请立即通知我们。我们将采取合理措施协助您,但对采取措施前已产生的损失不承担责任。 +

+ +
三、用户行为规范
+

+ 3.1 + 在使用本服务过程中,您应遵守国家法律法规及本协议约定,不得利用本服务从事任何违法违规或侵害他人合法权益的行为,包括但不限于: +
+ (1)上传、处理含有违法违规内容的视频,包括但不限于危害国家安全、泄露国家秘密、颠覆国家政权、破坏国家统一、宣扬恐怖主义、极端主义、煽动民族仇恨、民族歧视、传播淫秽色情、暴力、赌博、诈骗等内容的视频; +
+ (2)上传、处理侵犯他人知识产权、肖像权、隐私权等合法权益的视频; +
+ (3)利用本服务制作、传播虚假信息、谣言或误导性内容; +
+ (4)通过技术手段攻击、干扰、破坏本服务的正常运行; +
+ (5)利用本服务进行商业欺诈、非法牟利或其他违法活动。 +

+

+ 3.2 + 您保证上传的视频内容不侵犯任何第三方的合法权益,包括但不限于著作权、商标权、专利权、肖像权、隐私权等。如因您上传的内容侵犯第三方合法权益,您应承担全部法律责任,并赔偿因此给我们造成的损失。 +

+

+ 3.3 + + 我们有权对您上传的视频内容进行审核。如发现内容违反法律法规或本协议约定,我们有权拒绝处理、删除相关内容,并视情节严重程度对您的账户采取限制、暂停或终止服务等措施,且无需承担任何责任。 + +

+

+ 3.4 + 您不得通过爬虫、机器人、脚本等自动化工具批量上传视频或滥用本服务。一经发现,我们有权立即终止为您提供服务。 +

+ +
四、知识产权
+

+ 4.1 + 本服务及相关软件、技术、设计、商标、名称等均归我们或第三方权利人所有,受知识产权法律法规保护。未经我们或权利人书面许可,您不得擅自使用、复制、修改、传播、展示、镜像、上传、下载本服务的内容或技术。 +

+

+ 4.2 + 您上传至本服务的视频内容,其知识产权仍归您或原权利人所有。您上传视频的行为,即视为您授权我们为提供本服务之目的,对视频进行必要的存储、处理、传输等操作。 +

+

+ 4.3 通过本服务生成的混剪视频,其知识产权归属根据以下原则确定: +
+ (1)如您上传的视频内容为您原创,则生成的混剪视频知识产权归您所有; +
+ (2)如您上传的视频内容包含他人享有知识产权的内容,则生成的混剪视频的知识产权归属由您与相关权利人自行约定,因知识产权纠纷产生的一切法律责任由您承担; +
+ (3)我们对混剪视频的生成过程及结果不主张任何知识产权,但保留在服务宣传、展示等合理范围内使用匿名化处理后的示例视频的权利。 +

+ +
五、隐私保护
+

+ 5.1 + 我们高度重视用户隐私保护。关于个人信息的收集、使用、存储、共享等详细规定,请参阅我们的《隐私政策》。 +

+

+ 5.2 + 您上传的视频内容可能包含您的个人信息或他人信息。请您在上传前确保已获得相关权利人的授权。我们仅为您提供视频处理服务,不对视频内容的合法性、合规性负责。 +

+ +
六、免责声明
+

+ 6.1 + 本服务按"现状"和"可用"基础提供,我们不对服务的连续性、及时性、安全性、准确性作出任何明示或暗示的保证。 +

+

+ 6.2 因以下原因导致服务中断、延迟或无法使用的,我们不承担责任: +
+ (1)系统维护、升级、检修; +
+ (2)网络故障、电力故障、电信设备故障等不可抗力因素; +
+ (3)计算机病毒、木马、黑客攻击等网络安全事件; +
+ (4)其他非因我们过错导致的情况。 +

+

+ 6.3 + 视频识别与混剪功能依赖于人工智能技术。我们不对识别或混剪结果的准确性、完整性、适用性作出保证。您应自行判断并承担使用混剪视频产生的后果。 +

+

+ 6.4 + 您使用本服务产生的任何纠纷,包括但不限于与第三方的知识产权纠纷、肖像权纠纷等,由您自行解决并承担全部法律责任。如因此给我们造成损失的,您应予以赔偿。 +

+ +
七、服务变更、中断或终止
+

+ 7.1 + 我们有权根据业务发展需要,对服务内容、功能、收费标准等进行调整。调整内容将通过网站公告等方式通知您,如您不同意调整内容,可停止使用服务。 +

+

+ 7.2 + 如您违反本协议约定,我们有权不经通知而限制、暂停或终止向您提供服务,且无需承担任何责任。 +

+

+ 7.3 您可随时停止使用本服务。如需注销账户,请通过客服渠道联系我们。 +

+ +
八、协议的修改
+

+ 8.1 + 我们有权根据法律法规变化、业务发展需要等原因修改本协议。修改后的协议将通过网站公告等方式公布,自公布之日起生效。 +

+

+ 8.2 + 如您不同意修改后的协议内容,请停止使用本服务。如您继续使用本服务,即视为您同意接受修改后的协议。 +

+ +
九、法律适用与争议解决
+

+ 9.1 本协议的订立、执行、解释及争议解决均适用中华人民共和国法律。 +

+

+ 9.2 + 如您与我们之间发生任何争议,双方应首先友好协商解决;协商不成的,任何一方均可向有管辖权的人民法院提起诉讼。 +

+ +
十、联系我们
+

+ 如对本协议有任何疑问、意见或建议,您可通过以下方式联系我们: +
+ 客服邮箱:[请填写您的客服邮箱] +
+ 客服电话:[请填写您的客服电话] +

+
+
+
+
+ ); +}; + +export default Agree; diff --git a/src/pages/agreement/agree/styles.module.less b/src/pages/agreement/agree/styles.module.less new file mode 100644 index 0000000..1caca96 --- /dev/null +++ b/src/pages/agreement/agree/styles.module.less @@ -0,0 +1,67 @@ +.agree { + color: var(--theme-text); +} + +.contentBox { + background: var(--theme-bg-light); + border-radius: 10px; + max-width: 900px; +} + +.title { + margin-bottom: 30px; + padding-bottom: 20px; + border-bottom: 1px solid var(--theme-border); + + .titleText { + font-size: 24px; + font-weight: bold; + margin-bottom: 15px; + } + + .date { + display: flex; + gap: 20px; + font-size: 14px; + opacity: 0.6; + } +} + +.content { + line-height: 1.8; + + .introduction { + margin-bottom: 30px; + padding: 20px; + background: var(--theme-input); + border-radius: 8px; + } + + .fistTitle { + font-size: 18px; + font-weight: bold; + margin: 30px 0 15px 0; + } + + .twoTitle { + font-size: 16px; + font-weight: bold; + margin: 20px 0 10px 0; + } + + p { + margin-bottom: 15px; + font-size: 14px; + } + + .strong { + font-weight: bold; + } + + dl { + dt { + margin: 10px 0; + font-weight: bold; + } + } +} diff --git a/src/pages/agreement/index.ts b/src/pages/agreement/index.ts new file mode 100644 index 0000000..9f5aa39 --- /dev/null +++ b/src/pages/agreement/index.ts @@ -0,0 +1,11 @@ +import Agree from './agree'; +import Privacy from './privacy'; +import VipService from './vipService'; + +const routes = [ + { path: '/user/agreement', meta: { auth: false }, exact: true, component: Agree }, + { path: '/user/privacy', meta: { auth: false }, exact: true, component: Privacy }, + { path: '/user/vipService', meta: { auth: false }, exact: true, component: VipService }, +]; + +export { routes }; diff --git a/src/pages/agreement/privacy/index.tsx b/src/pages/agreement/privacy/index.tsx new file mode 100644 index 0000000..e261e2b --- /dev/null +++ b/src/pages/agreement/privacy/index.tsx @@ -0,0 +1,261 @@ +import styles from "./styles.module.less"; +import React from "react"; + +const Privacy = () => { + return ( +
+
+
+
隐私政策
+
+
更新日期:2025年1月30日
+
生效日期:2025年1月30日
+
+
+ +
+
+
导言
+

+ 本《隐私政策》(以下简称"本政策")适用于本视频混剪工具(以下简称"本服务"或"我们")通过网页端向用户(以下或称"您")提供的各项产品和服务。 +

+

+ 我们非常重视保护用户的个人信息及隐私。我们将严格按照法律法规要求,采取相应的安全保护措施来保护您的个人信息安全。本政策旨在向您清晰地介绍在使用我们的服务时,我们会如何收集、使用、共享、存储、保护您的个人信息,以及我们为您提供的访问、更正、删除这些信息的方式。 +

+

+ 在使用本服务前,请您务必仔细阅读并透彻理解本政策,特别应重点阅读我们以黑体加粗标识的条款。一旦您使用或继续使用我们的服务,即意味着您同意我们按照本政策处理您的相关信息。 +

+

通过本隐私政策,您主要可以了解如下内容:

+
+
1、我们如何收集和使用您的个人信息
+
2、我们如何使用Cookie及同类技术
+
3、我们如何公开、共享与转让您的个人信息
+
4、我们如何存储、保护您的个人信息
+
5、我们如何保障您的信息权利
+
6、本隐私政策如何变更
+
7、如何联系我们
+
+
+ +
+
+ 一、我们如何收集和使用您的个人信息 +
+
1、收集、使用基本原则
+

+ 我们会遵循合法、正当、必要的原则,出于向您提供相关产品和服务的目的向您收集和处理您的个人信息,并向您披露。我们尽可能全面、完整、及时地向您披露您的个人信息的收集和使用情况。 +

+ +
2、账号注册、登录
+

+ 为保障您的账户使用安全,您需要注册并登录后方可正常使用相关服务。您在注册和登录时需要向我们提供 + 您本人的手机号码并设置 + 登录密码 + ,并且通过输入验证码,以便我们对您的用户身份进行核验。手机号码是履行国家法律法规关于网络实名制要求的必要信息。 +

+ +
3、视频上传与处理
+

+ 在您使用视频上传与混剪功能时,我们将收集您上传的 + 视频文件 + 。为提供视频识别与混剪服务,您的视频内容将通过人工智能技术进行处理。我们会对上述信息进行分析与计算,以便为您提供视频混剪服务。 +

+

+ 为向您提供连续、高质量的服务, + + 在经安全加密技术处理、严格去标识化且无法重新识别特定个人的前提下,我们可能会将服务所收集的视频数据用于模型训练和服务的优化。 + + 同时,我们建议您不要在上传的视频中包含个人敏感信息。如您上传的视频包含他人的个人信息,请您务必在上传前取得他人的合法授权,避免造成他人个人信息的不当泄露。 +

+ +
4、实现产品/服务的安全保障
+

+ 在您使用本服务过程中,为识别账号异常状态、了解产品适配性、向您提供更契合您需求的服务,我们可能会自动收集您的使用情况并存储为网络日志信息,包括: +

+

+ + (1)设备信息:为便于设备识别、进行数据统计和分析,保障网络访问及服务运营的安全和质量,我们会收集您所使用的设备相关信息【包括设备型号、操作系统版本、设备设置、MAC地址、IMEI、IDFA、OAID设备标识符、IP地址等】。 + +
+ (2)服务日志信息: + 当您使用本服务时,我们会自动收集您对我们服务的详细使用情况,作为服务日志保存,包括视频上传记录、混剪操作记录、IP地址、浏览器类型、电信运营商、使用语言、访问日期和时间等。 +

+

+ 请注意,单独的设备信息、服务日志信息无法识别特定自然人身份。如果我们将这类非个人信息与其他信息结合用于识别特定自然人身份,或者将其与个人信息结合使用,则在结合使用期间,这类非个人信息将被视为个人信息,除取得您授权或法律法规另有规定外,我们会将这类信息进行匿名处理。 +

+ +
5、为您提供下单及订单管理功能
+

+ 您在本服务上订购付费功能时,您需要根据所选择的服务类型提供联系人信息(包括但不限于 + 姓名、电话号码、邮箱等 + )。我们会为您生成购买该产品/服务的具体订单,该订单中会载明您所订购的产品/服务信息、具体订单号、订单创建时间、您支付的金额。我们收集这些信息是为了帮助您顺利完成交易、保障您的交易安全、查询订单信息。 +

+ +
6、帮助您完成服务订单支付
+

+ 您在本服务上进行订单支付时,您需要提供第三方支付平台(支付宝、微信支付)账户并选择付款方式,我们会将您脱敏后的用户信息、对应的第三方支付平台账户名、订单支付相关信息、订单安全相关设备信息及其他反洗钱法律要求的必要信息通过在应用程序中嵌入的SDK方式与第三方支付平台共享,以确认您的支付指令并帮助您完成支付。 +

+ +
7、响应您的客服需求
+

+ 当您使用我们的客户服务或其他用户响应功能时,为了您的账号与系统安全,我们可能需要您先行提供账号信息,并与您之前的个人信息相匹配以验证您的用户身份。同时,我们可能还会需要收集您的如下个人信息:联系方式(您与我们联系时使用的 + 电话号码/电子邮箱 + 或您向我们主动提供的其他联系方式)、您与我们的沟通信息(包括文字/图片/音视频/通话记录/通话录音)及与您需求相关联的其他必要信息。我们收集这些信息是为了调查事实与帮助您解决问题,如您拒绝提供可能导致您无法使用我们的客服等用户响应功能。 +

+ +
+ 8、收集和使用个人信息的其他规则 +
+

+ (1)若我们将信息用于本隐私权政策未载明的其他用途,或者将基于特定目的收集而来的信息用于其他目的,会单独征求您的授权同意。 +
+ (2)请您理解并知悉,根据相关法律法规规定,我们在以下情况下收集、使用您的个人信息无需您的授权同意: +
+ ① 为履行法定职责或者法定义务所必需; +
+ ② + 为应对突发公共卫生事件,或者紧急情况下为保护您的生命健康和财产安全所必需; +
+ ③ + 在合理范围内使用个人信息主体自行向社会公众公开或其他已经合法公开的个人信息,但您明确拒绝或对个人权益有重大影响的除外; +
+ ④ 根据个人信息主体要求签订和履行合同所必需的; +
+ ⑤ + 为公共利益实施新闻报道、舆论监督等行为,在合理的范围内处理个人信息; +
⑥ 法律、法规或监管政策规定的其他情形。 +

+ +
+ 二、我们如何使用Cookie及同类技术 +
+

+ 1、Cookie + 是指从网络服务器发送到您的浏览器,并储存到电脑硬盘上的少量数据,通常包括一些特殊标识符、站点名称以及一些号码和字符,是用来记录您的使用者ID。 +
+ 2、为给您提供更便捷的访问体验、更周到的服务,实现您联机体验的需求,使您获得更轻松的访问体验,我们会在您的计算机或移动设备上发送一个或多个名为Cookies的小数据文件或同类技术文件,指定给您的Cookies是唯一的,它只能被将Cookies发布给您的域中的Web服务器读取。我们向您发送Cookies是为了简化您重复登录的步骤、帮助我们记住您的设备和使用服务偏好、帮助判断您的登录状态以及账户或数据安全。 +
+ 3、我们不会将Cookies用于本政策所述目的之外的任何用途。您可根据自己的偏好管理或删除Cookies、清除计算机或移动设备上保存的所有Cookies。大部分网络浏览器会自动接受Cookies,但您通常可根据自己的需要来修改浏览器的设置以拒绝Cookies。 +

+ +
+ 三、我们如何公开、共享与转让您的个人信息 +
+
1、公开
+

+ 我们仅会在以下情况下,公开披露您的个人信息: +
+ (1)已获得用户的明确授权; +
+ (2)根据有关法律、法规的要求或强制性的行政执法或司法机关要求。 +

+ +
2、共享
+

+ 在我们向您提供产品/服务时,我们会采取严格的安全措施,不会与其他任何公司、组织和个人共享您的个人信息。但以下情况除外: +
+ (1)履行法定义务所必需的共享:我们可能会根据法律法规规定、诉讼、争议解决的必要,或按行政、司法机关依法提出的要求,以及其他法定义务履行的必需,共享您的个人信息。 +
+ (2)取得您同意的情况下共享:获得您的明确同意后,我们会与其他方共享您的个人信息。 +
+ (3)为订立、履行您作为一方当事人的合同所必需的情况下的共享:您通过本服务购买产品或服务,我们会根据您的选择,将您的订单信息中与交易有关的必要信息共享给相关产品或服务提供者,以实现您的交易、配送及售后服务需求。 +

+

+ 为您的信息安全,我们仅会出于合法、正当、必要、特定、明确的目的共享您的信息。对我们仅为实现本政策中声明的目的与之共享个人信息的第三方,其只能接触到其履行职责所需信息,且我们会对第三方进行严格的安全检测,并对其约定严格的数据安全保密义务,确保其会严格遵守我们的数据隐私和安全要求。 +

+ +
+ 四、我们如何存储、保护您的个人信息 +
+
1、个人信息的保护
+

+ 我们已采取符合业界标准的安全保护措施保护您提供的个人信息,防止数据遭到未经授权访问、公开披露、使用、修改、损坏或丢失。我们会采取一切合理可行的措施,保护您的个人信息。 +

+ +
2、个人信息的存储
+

+ 我们在中华人民共和国境内收集和产生的个人信息,将存储在中华人民共和国境内。如需跨境传输,我们将会单独征得您的授权同意,并确保您的个人信息得到在中华人民共和国境内足够同等的保护。 +

+ +
五、我们如何保障您的信息权利
+
1、查询、访问您的个人信息
+

+ 您有权查询、访问您的个人信息,法律法规规定的例外情况除外。如果您想行使数据访问权,可以通过以下方式自行访问:登录本服务后,在"个人中心"页面查询您的账户信息。 +

+ +
2、改变您的个人信息授权范围
+

+ 每个业务功能需要一些基本的个人信息才能得以完成。对于额外收集的个人信息的收集和使用,您可以随时给予或收回您的授权同意。您可以通过以下方式自行操作:在设备设置中关闭相关权限。 +

+ +
3、个人信息更新
+

+ 您发现我们处理的关于您的个人信息有错误时,您有权要求我们予以更正。您可以通过以下方式自行更正:登录本服务后,在"个人中心"页面修改您的个人信息。 +

+ +
4、个人信息删除
+

+ 在以下情形中,您可以向我们提出删除个人信息的请求: +
+ (1)如果我们处理个人信息的行为违反法律法规; +
+ (2)如果我们收集、使用您的个人信息,却未征得您的同意; +
+ (3)如果我们处理个人信息的行为违反了与您的约定; +
+ (4)您不再使用我们的产品或服务,或您注销了账号; +
+ (5)我们不再为您提供产品或服务。 +

+ +
5、账户注销
+

+ 您可以通过以下方式申请注销您的账号: +
+ (1)登录本服务,通过"个人中心-账户设置-注销账号"提交账号注销申请; +
+ (2)向我们的客服邮箱发送电子邮件,提交您注销账号的需求,我们会协助您申请注销您的账号。 +

+

+ 在注销账户之后,我们将停止为您提供产品或服务,并依据您的要求,删除您的个人信息或对您的个人信息进行匿名化处理,但法律法规另有规定的除外。 +

+ +
6、响应您的上述请求
+

+ 为保障安全,您可能需要提供书面请求,或以其他方式证明您的身份。我们可能会先要求您验证自己的身份,然后再处理您的请求。我们将在收到您的请求后,在15个工作日内予以回复。 +

+ +
六、本隐私政策如何变更
+

+ 1、基于法律法规、产品功能、服务内容等在未来可能不断变更,我们可能会对隐私政策进行相应更新。未经您明确同意,我们不会削减您按照本《隐私政策》所应享有的权利。 +

+

+ 2、如更新本隐私政策的,我们会通过站内提示或是其他显著方式通知您。若您继续使用我们的服务,即表示同意接受修订后的隐私政策并受之约束。 +

+ +
七、如何联系我们
+

+ 您可以通过以下方式与我们联系,我们将在收到您的需求后,在15个工作日内予以回复: +
+ 1、如对本政策内容有任何疑问、意见或建议,您可通过我们的客服与我们联系; +
+ + 2、如发现个人信息可能被泄露,您可以通过我们的客服进行投诉举报; + +
+ + 客服邮箱:[请填写您的客服邮箱] + +
+ + 客服电话:[请填写您的客服电话] + +

+
+
+
+
+ ); +}; + +export default Privacy; diff --git a/src/pages/agreement/privacy/styles.module.less b/src/pages/agreement/privacy/styles.module.less new file mode 100644 index 0000000..1b5cb9a --- /dev/null +++ b/src/pages/agreement/privacy/styles.module.less @@ -0,0 +1,67 @@ +.privacy { + color: var(--theme-text); +} + +.contentBox { + background: var(--theme-bg-light); + border-radius: 10px; + max-width: 900px; +} + +.title { + margin-bottom: 30px; + padding-bottom: 20px; + border-bottom: 1px solid var(--theme-border); + + .titleText { + font-size: 24px; + font-weight: bold; + margin-bottom: 15px; + } + + .date { + display: flex; + gap: 20px; + font-size: 14px; + opacity: 0.6; + } +} + +.content { + line-height: 1.8; + + .introduction { + margin-bottom: 30px; + padding: 20px; + background: var(--theme-input); + border-radius: 8px; + } + + .fistTitle { + font-size: 18px; + font-weight: bold; + margin: 30px 0 15px 0; + } + + .twoTitle { + font-size: 16px; + font-weight: bold; + margin: 20px 0 10px 0; + } + + p { + margin-bottom: 15px; + font-size: 14px; + } + + .strong { + font-weight: bold; + } + + dl { + dt { + margin: 10px 0; + font-weight: bold; + } + } +} diff --git a/src/pages/agreement/vipService/index.tsx b/src/pages/agreement/vipService/index.tsx new file mode 100644 index 0000000..345e8b9 --- /dev/null +++ b/src/pages/agreement/vipService/index.tsx @@ -0,0 +1,192 @@ +import styles from "./styles.module.less"; +import React from "react"; + +const VipService = () => { + return ( +
+
+
+
会员服务协议
+
+
更新日期:2025年1月30日
+
生效日期:2025年1月30日
+
+
+ +
+
+
导言
+

+ 本《会员服务协议》(以下简称"本协议")是您与本视频混剪工具(以下简称"本服务"或"我们")之间关于您购买和使用本服务会员权益所订立的协议。请您在购买会员服务前仔细阅读本协议的全部内容,特别是以粗体标注的条款。 +

+

+ 如您不同意本协议的任意内容,请勿购买或使用会员服务。您点击"同意"或实际购买、使用会员服务的行为,即视为您已充分理解并同意接受本协议的全部内容。 +

+
+ +
+
一、会员服务说明
+

+ 1.1 + 本服务提供会员服务,用户可根据自身需求选择购买不同类型的会员套餐。会员用户可享受比普通用户更多的功能权益和服务。 +

+

+ 1.2 会员权益包括但不限于: +
+ (1)视频上传次数限制提升或无限制; +
+ (2)视频处理时长限制提升或无限制; +
+ (3)视频导出分辨率提升或无限制; +
+ (4)视频导出次数限制提升或无限制; +
+ (5)优先处理权; +
+ (6)专属客服支持; +
+ (7)其他会员专属功能或权益。 +

+

+ 1.3 + 具体的会员类型、收费标准、权益内容以本服务页面公示为准。我们有权根据业务发展需要调整会员类型、收费标准及权益内容,调整内容将通过网站公告等方式通知您。 +

+

+ 1.4 + 会员服务为付费服务,您需要按照页面公示的收费标准支付相应费用后方可享受会员权益。 +

+ +
二、会员购买与支付
+

+ 2.1 + 您可通过本服务页面选择购买会员服务。购买前请仔细阅读会员类型、收费标准、权益内容等信息,确认无误后再进行支付。 +

+

+ 2.2 + 本服务支持的支付方式包括但不限于:支付宝、微信支付等第三方支付平台。具体支付方式以页面实际显示为准。 +

+

+ 2.3 + 您在支付过程中,应按照页面提示完成支付操作。支付成功后,会员权益将立即生效。 +

+

+ 2.4 + + 您理解并同意,会员费用一经支付,原则上不予退还。但因本服务原因导致您无法正常使用会员权益的除外。 + +

+

+ 2.5 + 如您在支付过程中遇到问题,可通过客服渠道联系我们,我们将协助您处理。 +

+ +
三、会员有效期
+

+ 3.1 + 会员服务的有效期根据您购买的会员类型确定,具体以页面公示或订单信息为准。 +

+

3.2 会员有效期自支付成功之日起计算,至有效期届满之日止。

+

+ 3.3 + 会员有效期届满后,会员权益将自动失效。如需继续享受会员权益,您可重新购买会员服务。 +

+

+ 3.4 + + 会员有效期内,如因本服务原因导致您无法正常使用会员权益,我们将根据实际情况相应延长您的会员有效期。 + +

+ +
四、会员权益使用
+

+ 4.1 + 会员权益仅限您本人使用,不得转让、出售、出租、出借或分享给他人使用。 +

+

+ 4.2 + 您应按照本服务规则及会员权益说明合理使用会员权益。如发现您存在滥用会员权益的行为,我们有权采取限制、暂停或终止会员服务等措施,且无需承担任何责任。 +

+

+ 4.3 滥用会员权益的行为包括但不限于: +
+ (1)通过技术手段批量使用会员权益; +
+ (2)将会员权益用于商业用途(除非会员权益明确允许); +
+ (3)其他违反本协议或服务规则的行为。 +

+ +
五、会员服务变更与终止
+

+ 5.1 + 我们有权根据业务发展需要,对会员类型、收费标准、权益内容等进行调整。调整内容将通过网站公告等方式通知您。 +

+

+ 5.2 + 如您不同意调整内容,可停止使用会员服务。如您继续使用会员服务,即视为您同意接受调整后的内容。 +

+

+ 5.3 + 如您违反本协议约定,我们有权不经通知而限制、暂停或终止您的会员服务,且无需承担任何责任。 +

+

+ 5.4 + 会员服务终止后,您将无法继续享受会员权益,但已使用会员权益产生的结果(如已导出的视频)仍归您所有。 +

+ +
六、免责声明
+

+ 6.1 + 会员服务按"现状"和"可用"基础提供,我们不对会员服务的连续性、及时性、安全性、准确性作出任何明示或暗示的保证。 +

+

+ 6.2 因以下原因导致会员服务中断、延迟或无法使用的,我们不承担责任: +
+ (1)系统维护、升级、检修; +
+ (2)网络故障、电力故障、电信设备故障等不可抗力因素; +
+ (3)计算机病毒、木马、黑客攻击等网络安全事件; +
+ (4)其他非因我们过错导致的情况。 +

+

+ 6.3 + 视频识别与混剪功能依赖于人工智能技术。我们不对识别或混剪结果的准确性、完整性、适用性作出保证,会员权益不包含对识别或混剪结果的保证。 +

+ +
七、协议的修改
+

+ 7.1 + 我们有权根据法律法规变化、业务发展需要等原因修改本协议。修改后的协议将通过网站公告等方式公布,自公布之日起生效。 +

+

+ 7.2 + 如您不同意修改后的协议内容,请停止使用会员服务。如您继续使用会员服务,即视为您同意接受修改后的协议。 +

+ +
八、法律适用与争议解决
+

+ 8.1 本协议的订立、执行、解释及争议解决均适用中华人民共和国法律。 +

+

+ 8.2 + 如您与我们之间发生任何争议,双方应首先友好协商解决;协商不成的,任何一方均可向有管辖权的人民法院提起诉讼。 +

+ +
九、联系我们
+

+ 如对本协议有任何疑问、意见或建议,您可通过以下方式联系我们: +
+ 客服邮箱:[请填写您的客服邮箱] +
+ 客服电话:[请填写您的客服电话] +

+
+
+
+
+ ); +}; + +export default VipService; diff --git a/src/pages/agreement/vipService/styles.module.less b/src/pages/agreement/vipService/styles.module.less new file mode 100644 index 0000000..80a0dc5 --- /dev/null +++ b/src/pages/agreement/vipService/styles.module.less @@ -0,0 +1,67 @@ +.vipService { + color: var(--theme-text); +} + +.contentBox { + background: var(--theme-bg-light); + border-radius: 10px; + max-width: 900px; +} + +.title { + margin-bottom: 30px; + padding-bottom: 20px; + border-bottom: 1px solid var(--theme-border); + + .titleText { + font-size: 24px; + font-weight: bold; + margin-bottom: 15px; + } + + .date { + display: flex; + gap: 20px; + font-size: 14px; + opacity: 0.6; + } +} + +.content { + line-height: 1.8; + + .introduction { + margin-bottom: 30px; + padding: 20px; + background: var(--theme-input); + border-radius: 8px; + } + + .fistTitle { + font-size: 18px; + font-weight: bold; + margin: 30px 0 15px 0; + } + + .twoTitle { + font-size: 16px; + font-weight: bold; + margin: 20px 0 10px 0; + } + + p { + margin-bottom: 15px; + font-size: 14px; + } + + .strong { + font-weight: bold; + } + + dl { + dt { + margin: 10px 0; + font-weight: bold; + } + } +} diff --git a/src/pages/editor/ColorBg.tsx b/src/pages/editor/ColorBg.tsx new file mode 100644 index 0000000..7da6167 --- /dev/null +++ b/src/pages/editor/ColorBg.tsx @@ -0,0 +1,19 @@ +import styles from './editor.module.less'; + +export interface IProps { + style: { + top?: number; + left?: number; + bottom?: number; + right?: number; + }; +} + +export default function ColorBg(props: IProps) { + return ( +
+ + +
+ ); +} diff --git a/src/pages/editor/Custom.tsx b/src/pages/editor/Custom.tsx new file mode 100644 index 0000000..b23b380 --- /dev/null +++ b/src/pages/editor/Custom.tsx @@ -0,0 +1,109 @@ +import { Button, Space } from '@douyinfe/semi-ui'; +import { useHistory } from 'react-router'; +import { util } from '@utils/index'; + +type Props = { + editor: any; +}; + +const Custom = (props: Props) => { + const { editor } = props; + const history = useHistory(); + return ( +
+ + + + + + +
+ ); +}; + +export default Custom; diff --git a/src/pages/editor/Editor.tsx b/src/pages/editor/Editor.tsx new file mode 100644 index 0000000..c391570 --- /dev/null +++ b/src/pages/editor/Editor.tsx @@ -0,0 +1,586 @@ +import { useCallback, useEffect, useState } from 'react'; +import styles from './editor.module.less'; +import { useResizeDetector } from 'react-resize-detector'; +// import { Link } from 'react-router-dom'; +import $ from 'jquery'; +import Canvas from './components/canvas'; +import Header from './components/header'; +import Options from './components/options'; +import Sidebar from './components/sidebar'; +import Sources from './components/sources'; +// import Timeline2 from './components/timeline'; +import Timeline2 from './components/timeline2'; +import ColorBg from './ColorBg'; +import { Left, Right } from '@icon-park/react'; +import { observer } from 'mobx-react'; + +// Mock数据 +import { Editor } from '@stores/editor'; +import { pubsub } from '@utils/pubsub'; +import { Toast } from '@douyinfe/semi-ui'; +import { server } from './server'; +import DragItem from './common/dragitem'; +import type { IWatermark, MovieData, PluginConfig } from 'video-core-sdk'; +import { loadFFmpeg, utils } from 'video-core-sdk'; +import { config } from '@config/index'; +import ReplaceTpl from './components/replace-tpl'; +import { util } from '@utils/index'; +import PreviewSource from './PreviewSource'; +import type { APIServer, SideItem, UserInfo } from '@config/sdk.d'; +import WinLoading from './common/loading'; +import { tdata } from './tdata'; +import AIChat from './components/ai-chat/AIChat'; +import { createLocalUploadBase64 } from '@services/localStorageService'; +// import { tdata } from './tdata2'; +// import { tdata } from '@video/core/src/example/mock/tdata4'; +// import qrcodeConfig from '@plugins/qrcode'; +import { plugins } from '@plugins/index'; +import axios from 'axios'; +import ContextMenus from './components/canvas/ContextMenus'; +import zh_CN from '@douyinfe/semi-ui/lib/es/locale/source/zh_CN'; +import en_US from '@douyinfe/semi-ui/lib/es/locale/source/en_US'; +import { LocaleProvider } from '@douyinfe/semi-ui'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; +// import { sides } from './Sides'; + +// 延迟加载ffmpeg,避免页面阻塞 +setTimeout(() => { + loadFFmpeg(); +}, 1000); + +interface IProps { + match?: { params: { appid: string } }; + appid?: string; + movieData?: MovieData; + token?: string; + userInfo?: UserInfo; + workerPath?: string; + apiServer?: APIServer; + plugins?: PluginConfig[]; + resourcesHost?: string; + useLocalStorage?: boolean; // 是否使用本地存储 + onLoginSuccess?: (userInfo: any) => void; + saveAppCallback?: (res: any) => void; // 保存的回调 + // 水印配置 + watermark?: IWatermark; + sides?: SideItem[]; // 侧边栏配置 + exConfig?: { + // 支持多语言 + supportLanguage: boolean; + // 显示项目按钮 + showProjectButton: boolean; + logoLink?: string; + // 自定义logo链接 + logoOnClick?: () => void; + // 自定义logo + logo: (themeType: 'light' | 'dark') => string; + }; + loginButtonConfig?: { + id: string; // 容器的ID + className: string; // 容器的类名 + Component?: React.FC; // 登录组件 + }; + exportButtonConfig?: { + id: string; // 容器的ID + className: string; // 容器的类名 + Component?: React.FC; // 导出组件 + }; + callback?: (params: { editor: Editor }) => void; +} + +// 导入插件 +function EditorPage(props: IProps) { + const { editor } = stores; + + const appid = props.appid ? props.appid : props.match?.params?.appid; + + if (props.resourcesHost !== undefined) { + config.resourcesHost = props.resourcesHost; + } + if (props.workerPath !== undefined) { + config.workerPath = props.workerPath; + } + if (props.exConfig) { + Object.assign(editor.exConfig, props.exConfig); + } + editor.saveAppCallback = props.saveAppCallback; + editor.watermark = props.watermark; + if (!editor.watermark) { + editor.watermark = { + src: '', + // src: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABQCAMAAABrs8qCAAAC5VBMVEVMaXEyMjLw8PD///8AAAAAAAAAAAD///////8AAAANDQ0AAAAAAAAAAAAAAACqqqrLy8v///8AAAAAAAAbGxv8/Pzm5uYAAADb29sAAACUlJSDg4MAAACYmJgAAAAnJycAAADKysoAAAD4+PgAAAAAAAAAAAAyMjIAAAAAAABnZ2cBAQH4+PgLCwsAAAAAAAD9/f0AAAAAAAAEBAQAAAAAAAD+/v4AAAAAAAAfHx8AAADx8fEAAAAPDw/5+fkAAAD8/PwzMzPa2toAAADY2NgAAAAAAAAAAAAAAAAWFhbz8/MAAACxsbH8/Py3t7cTExPo6OgAAAAAAAAICAjMzMwAAADIyMgAAAAAAAAAAADHx8cAAACsrKwAAAD4+PiAgIAAAADw8PAjIyMqKioAAADu7u5BQUFdXV0AAACampqWlpa0tLQAAAAxMTEDAwOZmZkAAADk5OSCgoIRERHe3t7k5OQAAAAzMzP+/v6MjIwAAACCgoIeHh4AAACpqanj4+NPT09paWnq6uotLS2FhYXs7Ozs7Oyrq6tzc3MAAADNzc0AAAAAAAD6+vqkpKRfX1++vr7y8vIAAACNjY2oqKiTk5NKSkp5eXkAAAAlJSUuLi6Xl5e7u7tiYmLPz88AAAAAAAD29vasrKyrq6v6+vpiYmIAAAD29va8vLwAAAC1tbXT09Px8fG7u7tKSkqZmZnd3d0YGBiOjo6Dg4Ofn5/y8vLHx8fFxcXr6+tmZmZkZGQHBwfu7u65ubng4ODo6Oh5eXnm5uaVlZWmpqZ9fX1sbGzDw8OJiYlGRkacnJxYWFgxMTHf39/W1tYAAADQ0NB2dna0tLShoaEAAAA8PDyhoaE3NzcKCgr19fUcHBzBwcEaGhqdnZ1XV1fX19fR0dGurq6wsLADAwPh4eFmZmZRUVHMzMyAgIAoKCj7+/v+/v6ysrJ0dHTn5+dvb2////+GhobKysqQkJCRkZFSUlLQ0NCHh4fPHMpUAAAA93RSTlMAR3l/QT8BgIFAQTkHJyBgZoIDPUN9cy1tPllTFFoCRTtmBXsdPBpGMw5NQHtBBAZ+ITpACQp/NgtEEXkYQXwmfkdsDWsQKRwxQnk0YX1jQnM4EkFnGWUwNyRlImEMfFMId0RFKnZITBNaWWEVRkBZMnFSQm5yLEZ/VB5TQy9gcEpOdEZUdXZgUCNoFxt8XU1jeRZWXlhKUh9FRVljTGklLnpdXn1NK3tiNWJpeGFJWm1DVlRbeGZldFBNQHdicHRRclhbU09kVUlbTEdvayhoUWBbD0dcRkB6Q2NBWUptaWBfP3BOS2hSRH6AXlB0T4NUZ1dWS2lVk2hv4QAAAAlwSFlzAAALEwAACxMBAJqcGAAADFdJREFUeNrtmnlwVEUexxPozsyPhEBmMgkvxxCSmRCcmhyT+77MTRmSAAmEHFw5JATYICkRsiCIIPd9KeASCZcgIqIcBgEPENRdb1d3VfDedVd317+339n95gy1Vbu1VfP9a7qn33v9ed2/o7ufj49XXnnllVdeeeWVV1555ZVXavnFB8hK0El1xgSlLtrP42WulWCUWuuyTEmBHpRkqk1Qbs/0wI3imc7pTOX+stKX5AhPLi5NV+ri8jOccaQ00stcK720WOxWoBmQR4G+vEPqGdsDNyo36ZQXa+IQKEL69XwnFzJVgOoDHDniQxHbxqVQXCrfPMuM8BAEyLZNfE0Lh3R3QJxJHsCmKmR9y1dU4dhkdCg1IMGEIbhQrgsGLich3n5+ZZnhjK9HFWZaQHiSCfDLM0Z50gf/tKBjAvh6pgdutKoOlcfz7UtK020YPnxl6zBB2YvaANv8/fVgPVopVc1cjcHMDqGoKRhvPznMkyqPWlE+/w6SEJ4RpPUkzeBmwFP42wcifKPS4+2zH1oF/vx0ea+BH0Cc+7NWI0ib9jwWRgzvG5SrTp7CwhDuUY9JLMadGqUDiux6FjR5BBrpJ3ZslNIszWBIpJeQUppy+ZZkNM1HAv9bkEdlF4og01D3XjKAqzbJd9IeeF+YZqu298s1Y9pIzaoRKF1tKNs4vLtoDK+ixc20V3mLxUpZ1+rQQR87EO2BlpbzwzVM6RulMFoCJ1Px+uTRnjT5aCakE0enW4LOfMMP4NM/yHcqyBYHLUbpWj+pyX60HaKKVSAZ/sgaLKji5jk6IPfvOxPMqscCsQ4gj3PcAgrClhQQ4hwujvAsqwWVEjerC0WfPMePkGo2BNnV8MXmlRA1QR1FkjjRYwION9AROUzmodqj1qc4gIzCOJKCsCUFxJikR0MRxPHv11iKeq6NHudE0tAp5ddPgc0umsTnjAwlqgHLcWojG9/F3PJQRqVlAocdCIdPMyBMSQHx0XWtG+lZ+SaxVxswVO8b76hZH1n5ccv9rlcs9y6zoPJoh9Cu0+kC6mHZYgVEu2Y+pKfqGMmBXQUyLzNzEwVhSxSEv/8QJDWdEAWf3wpx1AniBYkqPpXKg2FYdCYOyrDBikpqIgd60Byjs3Yqr1UZEnKSzka2pAK5BxGQ+5qdOfRXVo0t9H2rd4xkK0GjMAp0eoccjH9hXOkLGEw+HkGI2bEemyn9JyCyf0obDAm5JLvhgSt/2jqs8vD9WsUgnYP45aPkLbRTMa+B+T3PIHOLil6iIGyJghh1Q5SfPUj2ruDgzR/LIL95SKvRPnDbNUhA7ZTY2NiyYzBrEX2fIbPB38TXM9qWah8QtRN7qv9AbYQtySDRG0pDh6Yl02qNapDm4zt2HG8eKkhElV7M8nD703SSjLOCQx7I1Sw13qv71R3EaMgyl6lBNGyu4QkkoApJXeYWpNFkYyfnLKHVd9wrCMlIRwQPTWfqUFy0GsRANFSQWj2s2H86kug0db4aw5YHI+3V+dNF1HivkZ0kKG88N2ZIOrECbE0qkIGrLS1XB4YIMkV4i8N5aVgNd5BG7JoK5MWnnrpMQdiSBEJTRq1j0qGWmHOojT0zc1f20EHCDIIY36tJNBSoSsL/04VEXuW1CmJi+mk7tkRHJGxQiGBz6cTNm+Qk4oXc+hyimhzc72DaEEHIJG4LPxseHt7yBNPzoy37B2jp2Rbyf/jq9mT+Umk9oho+uxUAXyGl/Vl6qB7LK3On8mq0/xq/d6yj9lrRsQQ7Y2cCkyeQ6HLJ2HOfoF2pXMH1DqMGE85Jxm6ulVaIffMuMb1uPt836otBhuTSvL4Z1y+ideT28joa/57O2k7sfLGrN/mpQApuFRXdkvkHvvUQEEvqo/R6PcD8NTSKLF6GfVkQDKSJ3lxVRtxvSRRgLvdaHuUYWJBLMO8+RknyruVyZDXaJexsLI+LizOzedzABcxVpathcE3cwjnb7OJI9psVFW/KNhKzci+fohS5DojREyI6kjj87kb6RudZ7ED0ezoiIkoS+ICYmo4g+EtqGdpzD1tJvg94JUPSfzgXUHmCuNcUHV9ig11blQsWjYWqlCSwVFDP2w2HWqON9pF9mC/GvQrIfSTUcX8scp+iBAI+TDkMj2CwA4mQW7aGAnzyJHUF2sd2JwP39rQopCLJW/AR6APl3YH1HH5e8SXa1y+ifOPbKPdHxfO+8z74ZzjmWgTk5QfyKAi+2TdxrsYdCFmXVdymM+tSG7gC0ZUiwkEdnHbSXTLv9uh8csiM232OkgwQEq5MyuMOou4nlb8Sf8FkWyIJwUTFGxe8gXGOA4h2mC83I0jDgJC9BY1bkJQaaJtJ29yucAlC4mfmljQaEO7cJBwmMin8cszQHX6ORormz6x8pBYm70I2j6sUAl+EHu/uZ3cq8v0YEDFwnfTl+uSAJoDsT6RRrc8ZSBeHH7Fb5boACUSW16b/PHrc1Om8pl5+kwPU0CptD0L3lfNTRb04bvKzH4ItVe4czeOIJ0H18T6tDTBemYq82UjQKf6w75cwUb9WcDcflH6Hbd+H8amdcims8yZw6x1A1iHLPGb/5C+uQWLBwq84l+2cKOiLvh27wJwl/NUUBb3fPixq+5VPrCPq5BHZQN5lGuNJeL9sPIIYhz9wAcwl4rp7ObK+K/c2MlLh4AuR++XfO3+qwFDjsAFMLmZXuS/NB5cgKfWCh5q/Rl6oxTwj78p06HFLjKFfUOKdvSQumEUb8RuJrOO0jCfhusRtos7h7DpuqWiES1BwkZMEyU4bj/fAsQQnq9xTW6n9PpHrGsQnJXbaIYzX5jELF+m9k1l/1qBUjwVbY624Vk44BrNDtIwnqUkR59tmJXvQnqhGS3SS3xFB0pzlfUzwuutk5ZfD4e3qVa5rEKKlgDcx1OhtPxkknAWJk/c4SszwWgzjSVBodHxAcU4N4wG0l96HmlR5+HZ3RkbeeEj+7/st++UE/MHXFb9vOKvulKN31AzcdQ9inIOq/6w0/wCD5GRdgpBJ9ILKk1QdKa+J0mPovqzcpp9MuG3SW+V3+7lTcqKhXTSbLu2YpUq4IwjvHe9QE3l1Ntg4NyAB6Uw6k7dWtnWXIAS854By+7y1/MYfn5Tgr6xXaZR8wCLt7uiS/DmAZCU1SyMTRF7ZYfcgxax35AMvHLKBkxSlNkWY8yShpSayphAaAtyDpDYw4NpB4kUvVszqvbD6xvF3JtE97zuzYKF4gTF1JOAVc+UBebQNzIH87sGURj24ByHb8VfZVS7mAmvASdKor0nS2ZsImfFLdG5BMg4Bk8dpn7uyfdOntxfNjDGQJJ3J/Z9uV7Zyib3TAdF82S09IeMIdj8ivHm9SO/48ddgi/BXg8hpPJdjbyITQYmvzkHIZi5wTB7Xn5eoEVy3xjBw6Q4dkrROZSMtQg9tioXMXAH6LgFvDvIwtRKqGO+o0b6SCfVNKhBpYXX2pxH85qPKRAx/F4OCa5CABlh2epKW3RYhBL89cfnG6mcKM9fGsO7viFE6CrTsUACfrEP10VKM+O6pzza6ASHecSU9exCsrlUFIi91f7uXn8asiWi2ngL/VLcg0XHCa+IJhlOCWdXJZIQBz35VQXxsPDSkyAPyqFz98TMYx8rx9nrlxh/cgJQB/oBmgYm/Ej+YQECy7c/Xgv4qdI6YyA6lih++eAqyukDdVpq45xMH5t55Z15nuELApwf6KDNcPK885fvrmIsQL7Acls/Lgn7ORVWt9Pa0TwWOcWQdSv4HPVL69EPyjqPTIfOo/THT5B+D0fJ4vvlu+TB0Rksd3RInI7trh/TH42HVfFvRlcDXj7TPz+z5ihI0lM9p3BDRRE5qNz+unJ9Kh44kR6n4nfzsqRfk1IW/fft02pvp7XJ2xuyjWOpUJ0dHdMRCLVZnh0pkX6tLzx5PI32XYmtxCNjdvEbJ+5IVpUiAZYLigHjBGpr81VfYBLe1R8hLlUemp8qmjJKZPlmTUZVdrtW6HDucHBXHOfsoABam8gGL+WAAzEn0jLi2CjMfDISmyMvDdD0hqC9tjFUIZH9Z5s88GtuWCn9msM+GqA2KCZgdN1jtSHKmOZwcZZjyHQ6VDpal2n3CkWTKYs+6U9bTTziy6GlSa0dHk5pAIWnKoZ99xE6QmjDPzt9TolxnrA1k+pQfWOv0jg4nRz6uD5X+C9/UuHjk/6QzXnnllVdeeeWVV1555ZVXXv0f6d9OjocY8mJEnAAAAABJRU5ErkJggg==', + width: 200, + height: 80, + hide: false, + setPosition: (movieWidth: number, movieHeight: number, scale: number) => { + return { + x: movieWidth - 200 * scale, + y: movieHeight - 80 * scale, + }; + }, + }; + } + // 配置登录成功回调 + if (props.onLoginSuccess) { + editor.onLoginSuccess = props.onLoginSuccess; + } + // 配置用户信息 + if (props.token) { + editor.token = props.token; + } else { + editor.token = stores.user.token; + } + if (props.userInfo) { + editor.userInfo = props.userInfo; + } else { + editor.userInfo = stores.user.info; + } + + editor.sides = props.sides; + // 配置资源host + editor.resourcesHost = config.resourcesHost; + // 配置插件 + editor.pluginsConfig = props.plugins || plugins; + // login按钮容器配置 + editor.loginButtonConfig = props.loginButtonConfig; + // export按钮容器配置 + editor.exportButtonConfig = props.exportButtonConfig; + //@ts-ignore + editor.apiServer = props.apiServer ? props.apiServer : server; + // SDK回调函数 + editor.callback = props.callback; + // 本地存储模式 + editor.useLocalStorage = props.useLocalStorage || false; + + // 本地存储模式:重写 uploadBase64,所有编辑操作中生成的文件直接存本地 + if (editor.useLocalStorage) { + editor.apiServer.uploadBase64 = (params: any) => { + const localUpload = createLocalUploadBase64(`materials/${editor.appid}`); + return localUpload(params); + }; + } + + const { width = window.innerWidth, height = window.innerHeight, ref } = useResizeDetector(); + const HEADER_HEIGHT = 60; + const SIDEBAR_WIDTH = 60; + const [layout, setLayout] = useState({ + sourcesWidth: 310, + optionsWidth: 300, + timelineHeight: 350, + }); + const minAiChatWidth = 340; + const [show, setShow] = useState({ sources: true, options: true }); + const [showAIChat, setShowAIChat] = useState(true); + const [aiChatWidth, setAIChatWidth] = useState(minAiChatWidth); + const [loading, setLoading] = useState(true); + + // 拖动过程中center不要动画 + const [noAnimate, setNoAnimate] = useState(false); + + // sourcesBar 移动 + const sourcesBarDrag = useCallback((e: any) => { + setNoAnimate(true); + const { sourcesWidth, optionsWidth } = layout; + // canvas最小600px + const interval = [310, window.innerWidth - optionsWidth - 600]; + $(document) + .on('mousemove.ievent.sourcesBar', (em: any) => { + const ex = em.pageX - e.pageX; + let sw = sourcesWidth + ex; + if (sw < interval[0]) { + sw = interval[0]; + } else if (sw > interval[1]) { + sw = interval[1]; + } + layout.sourcesWidth = sw; + setLayout({ ...layout }); + }) + .on('mouseup.ievent.sourcesBar', () => { + $(document).off('mousemove.ievent.sourcesBar'); + $(document).off('mousedown.ievent.sourcesBar'); + setNoAnimate(false); + }); + }, []); + + // 设置区域拖动 + const optionsBarDrag = useCallback((e: any) => { + setNoAnimate(true); + const { sourcesWidth, optionsWidth } = layout; + const interval = [300, window.innerWidth - sourcesWidth - 600]; + $(document) + .on('mousemove.ievent.optionsBar', (em: any) => { + const ex = em.pageX - e.pageX; + let sw = optionsWidth - ex; + if (sw < interval[0]) { + sw = interval[0]; + } else if (sw > interval[1]) { + sw = interval[1]; + } + layout.optionsWidth = sw; + setLayout({ ...layout }); + }) + .on('mouseup.ievent.optionsBar', () => { + $(document).off('mousemove.ievent.optionsBar'); + $(document).off('mousedown.ievent.optionsBar'); + setNoAnimate(false); + }); + }, []); + + // AI Chat区域拖动 + const aiChatBarDrag = useCallback((e: any) => { + setNoAnimate(true); + const interval = [minAiChatWidth, window.innerWidth - 400]; + $(document) + .on('mousemove.ievent.aiChatBar', (em: any) => { + const ex = em.pageX - e.pageX; + let sw = aiChatWidth - ex; + if (sw < interval[0]) { + sw = interval[0]; + } else if (sw > interval[1]) { + sw = interval[1]; + } + setAIChatWidth(sw); + }) + .on('mouseup.ievent.aiChatBar', () => { + $(document).off('mousemove.ievent.aiChatBar'); + $(document).off('mousedown.ievent.aiChatBar'); + setNoAnimate(false); + }); + }, [aiChatWidth]); + + // 时间轴拖动 + const timelineBarDrag = useCallback((e: any) => { + setNoAnimate(true); + const { timelineHeight } = layout; + // canvas最小高度200 + const interval = [100, window.innerHeight - HEADER_HEIGHT - 200]; + $(document) + .on('mousemove.ievent.optionsBar', (em: any) => { + const ey = em.pageY - e.pageY; + let sh = timelineHeight - ey; + if (sh < interval[0]) { + sh = interval[0]; + } else if (sh > interval[1]) { + sh = interval[1]; + } + layout.timelineHeight = sh; + setLayout({ ...layout }); + }) + .on('mouseup.ievent.optionsBar', () => { + $(document).off('mousemove.ievent.optionsBar'); + $(document).off('mousedown.ievent.optionsBar'); + setNoAnimate(false); + }); + }, []); + + const showPanel = (type: 'options' | 'sources', v: boolean) => { + setShow({ ...show, [type]: v }); + }; + + useEffect(() => { + pubsub.subscribe('showLayoutPanel', (_msg, params: { type: 'options' | 'sources'; visible: boolean }) => { + setShow({ ...show, [params.type]: params.visible }); + }); + return () => { + pubsub.unsubscribe('showLayoutPanel'); + }; + }, [show]); + + const initAppData = useCallback(async () => { + if (appid) { + editor.appid = appid; + + if (appid === 'test') { + // https://cdn.h5ds.com/video/669770283775954944/apps/837523312766513152.json + const jdata = (await $.get( + 'https://cdn.h5ds.com/video-mix/u/9715/apps/960593364739022848.json?t=' + +new Date(), + // 'https://video.h5ds.com/video/u/728621315758907392/apps/857880744023654400.json?t=' + +new Date(), + )) as string; + editor.data = util.reJSON(jdata) as MovieData; + } else if (appid === 'template') { + const templateId: any = util.getUrlQuery('templateId'); + const adminToken = util.getUrlQuery('adminToken'); + // 通过templateId 获取json + //@ts-ignore + const { data: res } = await axios({ + withCredentials: true, + method: 'get', + url: `/api/v1/admin/templates/info?id=${templateId}`, + headers: { + 'Content-Type': 'application/json;charset=utf-8', + Accept: 'application/json', + Authorization: adminToken, + }, + }); + console.log('res', res); + const jdata = (await $.get(`https://cdn.h5ds.com/${res.data.url}?t=` + +new Date())) as string; + editor.data = util.reJSON(jdata) as MovieData; + } else { + if (!props.movieData) { + const [res, err] = await editor.apiServer.getAppData(appid); + editor.cacheAppDetailRes = res; + if (err) { + Toast.error(err); + } else if (res.data) { + editor.data = res.data as MovieData; + } + } else { + editor.data = props.movieData; + } + } + } + if (!editor.data) { + editor.data = tdata; + } + + // 老数据兼容新数据结构 + console.log('editor.data', editor.data); + + // 清晰数据 + await util.clearData(editor.data); + + editor.lastUpdateAppData = JSON.stringify(editor.data); + + // 如果resouces的类型是image,且url 和 thumb 一样,需要重新设置thumb + const imageResources = editor.data.resouces?.filter(r => r.type === 'image' && r.url && r.thumb === r.url); + if (imageResources?.length) { + console.log('imageResources', imageResources); + for (const resource of imageResources) { + try { + const url = utils.reURL(resource.url, config.resourcesHost); + const thumbBase64 = await util.resizeBase64Image(url, 120); + const [thumbRes] = await editor.apiServer.uploadBase64({ + content: thumbBase64, + name: `${resource.name || 'image'}_thumb.png`, + file_type: 'image', + }); + if (thumbRes) { + resource.thumb = thumbRes.storage_path; + } + } catch (err) { + console.warn('缩略图生成失败', resource.name, err); + } + } + } + + setLoading(false); + }, []); + + // useEffect(() => { + // if (loading === false && props.callback) { + // props.callback({ editor, user }); + // } + // }, [loading]); + + useEffect(() => { + if (config.env === 'dev' && (window as any).Stats) { + //初始化统计对象 + const stats: any = new (window as any).Stats(); + //设置统计模式 + stats.setMode(0); // 0: fps, 1: ms + //统计信息显示在左上角 + stats.domElement.style.position = 'absolute'; + stats.domElement.style.left = '0px'; + stats.domElement.style.top = '0px'; + stats.domElement.style.zIndex = 99999; + //将统计对象添加到对应的
元素中 + document.body.appendChild(stats.domElement); + (window as any).win_stats = stats; + } + + initAppData(); + + pubsub.subscribe('timelineLoading', (_msg, v) => { + editor.globalLoading = v; + }); + return () => { + editor.destroy(); + pubsub.unsubscribe('timelineLoading'); + }; + }, []); + + useEffect(() => { + if (loading === false) { + $('#h5dsVideoEditor').on('wheel', e => { + if (e.ctrlKey) { + e.preventDefault(); + } + }); + return () => { + $('#h5dsVideoEditor').off('wheel'); + }; + } + }, [loading]); + + if (loading) { + return
loading...
; + } + + // 控制options区域显示&隐藏 + let showOption = show.options; + if (editor.editMode === 'template') { + showOption = false; + } + + const locale = { + 'zh-CN': zh_CN, + 'en-US': en_US, + }[language.getLanguage()]; + + return ( + +
+ {editor.movieCreateSuccess && } +
+
+ {editor.movieCreateSuccess && } +
+
+ + { + showPanel('sources', !show.sources); + }} + className={styles.flodButton} + > + + + {editor.movieCreateSuccess && } + {editor.movieCreateSuccess && } +
+
+
+
+ {editor.movieCreateSuccess &&
} +
+
+ +
+
+
+ {editor.editMode === 'auto' ? ( + <> + + { + showPanel('options', !show.options); + }} + className={styles.flodButton} + > + + + + ) : null} + {editor.movieCreateSuccess && } +
+
+ +
+
+ + {editor.movieCreateSuccess && (editor.editMode === 'auto' ? : )} +
+
+ + + {editor.movieCreateSuccess && } + +
+
+ ); +} + +export default observer(EditorPage); diff --git a/src/pages/editor/EditorPage.tsx b/src/pages/editor/EditorPage.tsx new file mode 100644 index 0000000..dd317bb --- /dev/null +++ b/src/pages/editor/EditorPage.tsx @@ -0,0 +1,19 @@ +import { Provider } from 'mobx-react'; +import React from 'react'; +import { Editor } from '@stores/editor'; +import { stores, user } from '@stores/index'; +import EditorComp from './Editor'; +import { isFSApiSupported } from '@services/localStorageService'; + +const EditorPage = (props: any) => { + // 文件夹初始化已移至 App.tsx,此处直接使用 + stores.editor = new Editor(); + + return ( + + + + ); +}; + +export default EditorPage; diff --git a/src/pages/editor/PreviewSource.tsx b/src/pages/editor/PreviewSource.tsx new file mode 100644 index 0000000..5bc3b24 --- /dev/null +++ b/src/pages/editor/PreviewSource.tsx @@ -0,0 +1,40 @@ +import { stores } from '@stores/index'; +import { observer } from 'mobx-react'; +import React, { useEffect } from 'react'; +import styles from './previewSource.module.less'; +import $ from 'jquery'; +// import { Image } from '@douyinfe/semi-ui'; + +export interface IProps {} + +function PreviewSource(props: IProps) { + const { editor } = stores; + + useEffect(() => { + const hidePreviewSource = e => { + if (!$(e.target).closest('.h5dsSourcePreview')[0] || !e.target.closest('.semi-image-preview')[0]) { + editor.previewSource = null; + } + }; + document.addEventListener('click', hidePreviewSource); + return () => { + document.removeEventListener('click', hidePreviewSource); + }; + }, []); + + if (!editor.previewSource) { + return null; + } + const { type, name, url } = editor.previewSource; + return ( +
+ {type === 'image' && } + {type === 'text' && } + {type === 'video' &&
+ ); +} + +export default observer(PreviewSource); diff --git a/src/pages/editor/SDK.tsx b/src/pages/editor/SDK.tsx new file mode 100644 index 0000000..1c1dd70 --- /dev/null +++ b/src/pages/editor/SDK.tsx @@ -0,0 +1,97 @@ +import EditorPage from './Editor'; +import type { APIServer, VideoEditorSDKParams } from '@config/sdk.d'; +import ReactDOM from 'react-dom/client'; +import { Provider } from 'mobx-react'; +// import { stores } from '../../stores'; +import { Editor } from '@stores/editor'; +import { exportMovie } from '@utils/export'; + +import { observer } from 'mobx-react'; +import * as options from '@pages/editor/components/options/components'; +import { stores } from '@stores/index'; +import { User } from '@stores/user'; +import { + plugin, + ResourceItem, + helper, + utils, + initData, + getInitData, + Movie, + MovieEncoding, + loadFFmpeg, + VideoCoreSDK +} from 'video-core-sdk'; + +class VideoEditorSDK { + private _params: VideoEditorSDKParams = null; + constructor(params: VideoEditorSDKParams) { + this._params = Object.assign( + { + target: document.body, + appid: '', + token: '', + userInfo: null, + workerPath: '', + loginButtonConfig: null, + exportButtonConfig: null, + }, + params, + ); + } + + public editor: Editor = null; + + /** + * 初始化 + * @returns + */ + public init(): Promise { + return new Promise(resolve => { + const { target, ...other } = this._params; + const editor = new Editor(); + const user = new User(); + this.editor = editor; + stores.editor = editor; + stores.user = user; + + ReactDOM.createRoot(target!).render( + + { + resolve(null); + }} + /> + , + ); + }); + } + + /** + * 销毁 + */ + public destroy() { + const { target, ...other } = this._params; + this.editor.destroy(); + ReactDOM.createRoot(target!).unmount(); + } +} + +export { + exportMovie, + VideoEditorSDK, + options, + plugin, + observer, + // core中的类型 + VideoCoreSDK, + ResourceItem, + helper, + utils, + initData, + getInitData, + Movie, + MovieEncoding, + loadFFmpeg, +}; diff --git a/src/pages/editor/Sides.tsx b/src/pages/editor/Sides.tsx new file mode 100644 index 0000000..553a480 --- /dev/null +++ b/src/pages/editor/Sides.tsx @@ -0,0 +1,102 @@ +import { + UploadOne, + PictureOne, + Video, + Music, + MoreTwo, + Text, + ColorFilter, + Effects, + InvertCamera, + InnerShadowBottomLeft, + TextMessage, + Page, +} from '@icon-park/react'; +import Custom from './Custom'; + +const fill = 'var(--theme-icon)'; +export const sides = [ + { + icon: , + type: 'custom', + name: '自定义', + enName: 'Custom', + panel: Custom, + }, + { + icon: , + type: 'template', + name: '模板', // 模板 + simple: true, + enName: 'Template', + }, + { + icon: , + type: 'my', + name: '我的', // 我的 + simple: true, + enName: 'My', + }, + { + icon: , + type: 'caption', + name: '字幕', // 字幕 + enName: 'Caption', + }, + { + icon: , + type: 'image', + name: '图片', // 图片 + simple: true, + enName: 'Image', + }, + { + icon:
+ } + position="bottomRight" + trigger="click" + > + + ))} + + + + } + position="bottomLeft" + trigger="click" + > +
+ {imageRatio} + + {IMAGE_RESOLUTIONS.find(r => r.value === imageResolution)?.label} + +
+ + +
+ 💰 + {getEstimatedCredits(aiMode, imageModel, imageResolution, 1)} +
+
+ + )} + {aiMode === 'video' && ( + <> + +
+
参考选项
+
+ {VIDEO_REFERENCES.map(ref => ( + + ))} +
+
+
+
选择比例
+
+ {VIDEO_RATIOS.map(ratio => ( + + ))} +
+
+
+
选择分辨率
+
+ {supportedVideoResolutions.map(res => ( + + ))} +
+
+
+
+ 生成时长 {videoDuration} 秒 +
+ setVideoDuration(val)} + min={MODEL_SUPPORTED_DURATIONS[videoModel]?.min || 4} + max={MODEL_SUPPORTED_DURATIONS[videoModel]?.max || 10} + step={1} + marks={supportedVideoDurations.reduce((acc, d) => ({ ...acc, [d.value]: d.label }), {})} + style={{ width: '100%', marginTop: '8px' }} + /> +
+
+
选择生成数量
+
+ {[1, 2, 3, 4].map(num => ( + + ))} +
+
+
+
选择模型
+
+ {VIDEO_MODELS.map(model => ( + + ))} +
+
+ + } + position="bottomLeft" + trigger="click" + > +
+ {videoRatio} + + {supportedVideoResolutions.find(r => r.value === videoResolution)?.label} + +
+
+ +
+ 💰 + + + {getEstimatedCredits(aiMode, videoModel, videoResolution, videoCount, videoDuration)}{' '} + +
+
+ + )} + + )} + renderTopSlot={() => { + if (uploadSlots.length === 0) return null; + return ( +
+ {uploadSlots.map((slot, index) => ( +
+ { + uploadInputRefs.current[slot.key] = el; + }} + onChange={e => handleImageChange(slot.key, e)} + /> + {uploadedImages[slot.key] ? ( +
+ {slot.label} +
handleRemoveImage(slot.key)}> + x +
+
+ ) : ( +
handleImageUpload(slot.key)} + title={slot.label} + > + + {slot.label} +
+ )} + {index < uploadSlots.length - 1 && videoReference !== 'multi' &&
→
} +
+ ))} +
+ ); + }} + topSlotPosition="top" + uploadProps={{ + action: '/api/v1/common/upload/form', + accept: 'image/*', + showUploadList: false, + headers: { + Authorization: editor.token, + }, + beforeUpload: (file: any) => { + const blob = file.originFileObj || file.file || file; + if (!(blob instanceof Blob)) { + console.warn('Invalid file object:', file); + return false; + } + const reader = new FileReader(); + reader.onload = async e => { + const base64 = e.target?.result as string; + const userMsg: ChatMessage = { + id: Date.now().toString(), + role: 'user', + createAt: Date.now(), + content: [{ type: 'image', image_url: base64, file_id: `upload_${Date.now()}` }], + }; + const thinkingId = `thinking_${Date.now()}`; + const thinkingMsg: ChatMessage = { + id: thinkingId, + role: 'assistant', + createAt: Date.now(), + content: '思考中...', + status: 'loading' as any, + }; + setChats(prev => [...prev, userMsg, thinkingMsg]); + setLoading(true); + + const replaceThinking = (aiMsg: ChatMessage) => { + setChats(prev => { + const updated = prev.filter(m => m.id !== thinkingId).concat(aiMsg); + saveCurrentConversation(updated); + return updated; + }); + }; + + try { + const chatMessages = chats + .filter(m => m.role === 'user' || m.role === 'assistant') + .map(m => ({ + role: (m.role === 'user' ? 'user' : 'system') as 'user' | 'system', + content: typeof m.content === 'string' ? m.content : '', + })); + chatMessages.push({ role: 'user' as const, content: '请分析这张图片' }); + + const [res, err] = await editor.apiServer!.openAiChat({ + model: 'doubao-seedance-1-5-pro-251215', + messages: chatMessages, + }); + + if (err) { + Toast.error(err); + } + + const aiContent = err + ? `图片分析失败:${err}` + : res?.choices?.[0]?.message?.content || + res?.content || + res?.message || + JSON.stringify(res) || + '已收到你上传的图片,请告诉我你想对这张图片做什么?'; + + const aiMsg: ChatMessage = { + id: (Date.now() + 1).toString(), + role: 'assistant', + createAt: Date.now(), + content: aiContent, + }; + replaceThinking(aiMsg); + } catch (e: any) { + const errMsg = e?.message || '网络错误,请稍后重试'; + const aiMsg: ChatMessage = { + id: (Date.now() + 1).toString(), + role: 'assistant', + createAt: Date.now(), + content: `图片分析异常:${errMsg}`, + }; + replaceThinking(aiMsg); + Toast.error('网络请求失败'); + } finally { + setLoading(false); + } + }; + reader.readAsDataURL(blob); + return false; + }, + }} + /> + + + + ); +} diff --git a/src/pages/editor/components/ai-chat/AiVideo.tsx b/src/pages/editor/components/ai-chat/AiVideo.tsx new file mode 100644 index 0000000..da98b12 --- /dev/null +++ b/src/pages/editor/components/ai-chat/AiVideo.tsx @@ -0,0 +1,168 @@ +import React, { useEffect, useRef, useState } from 'react'; +import styles from './styles.module.less'; +import { Tag, TextArea, RadioGroup, Radio, Select, Image, Button, Slider, Toast } from '@douyinfe/semi-ui'; +import { observer } from 'mobx-react'; +import { getClosestVideoRatioEnhanced } from '@pages/editor/tools/tools'; +import { getImageToVideoParams } from './aiConfig'; +import { stores } from '@stores/index'; +// import { StarOne } from '@icon-park/react'; + +export interface IProps {} + +function AiVideo(props: IProps) { + const { editor } = stores; + const [aiAction, setAiAction] = useState('image-to-video'); + const [duration, setDuration] = useState(10); + const [description, setDescription] = useState(''); + + const { ratio } = getClosestVideoRatioEnhanced(editor.data.width, editor.data.height); + const [size, setSize] = useState(ratio); + + const [clarity, setClarity] = useState('720p'); + const [count, setCount] = useState(1); + const sourceListRef = useRef(null); + + const Icon = (props: { size?: number }) => { + return ( + + ); + }; + + // 处理表单提交 + const handleGenerate = async () => { + // 获取参考元素数据 + const urls = sourceListRef.current?.getURLs() || []; + + // 整合所有表单数据 + const formData = { + aiAction, + description, + size, + clarity, + duration, + count, + urls: urls.map(d => d.url), + }; + console.log('表单数据:', formData); + + // 图生视频 + const params = await getImageToVideoParams(formData); + if (!params) { + return; + } + const [res, err] = await editor.apiServer.createAiTask(params); + if (!err) { + Toast.success('任务创建成功'); + } else { + Toast.error(err); + } + // 这里可以添加后续的生成逻辑,比如调用API等 + }; + + return ( +
+

参数设置

+
+ + {/*
根据输入的文本内容进行
*/} +
+

描述信息

+
+ + + + + + + ); +} +export default observer(TemplateDown); diff --git a/src/pages/editor/components/options/components/templateDown/index.ts b/src/pages/editor/components/options/components/templateDown/index.ts new file mode 100644 index 0000000..2526539 --- /dev/null +++ b/src/pages/editor/components/options/components/templateDown/index.ts @@ -0,0 +1,3 @@ +import TemplateDown from './TemplateDown'; + +export default TemplateDown; diff --git a/src/pages/editor/components/options/components/templateDown/styles.module.less b/src/pages/editor/components/options/components/templateDown/styles.module.less new file mode 100644 index 0000000..e7f8b79 --- /dev/null +++ b/src/pages/editor/components/options/components/templateDown/styles.module.less @@ -0,0 +1,5 @@ +.align { + display: flex; + align-items: center; + justify-content: space-between; +} diff --git a/src/pages/editor/components/options/components/templateInfo/TemplateInfo.tsx b/src/pages/editor/components/options/components/templateInfo/TemplateInfo.tsx new file mode 100644 index 0000000..3e928b9 --- /dev/null +++ b/src/pages/editor/components/options/components/templateInfo/TemplateInfo.tsx @@ -0,0 +1,32 @@ +import styles from './styles.module.less'; +import Item from '../item'; +import { TextArea } from '@douyinfe/semi-ui'; +import type { VideoElement } from 'video-core-sdk'; +import { useReducer } from 'react'; +import { observer } from 'mobx-react'; +import { language } from '@language/language'; +import { stores } from '@stores/index'; + +// https://pixijs.download/release/docs/PIXI.html#BLEND_MODES +/** + * 模版的相关描述 + */ +export interface IProps {} +function TemplateInfo(props: IProps) { + const { editor } = stores; + const [, forceUpdate] = useReducer(x => x + 1, 0); + const elementData = editor.getElementData() as VideoElement; + + return ( + +
completenessnalu_typenalu_data
"+nalu_array.nalu_type+"