Skip to content

Commit

Permalink
update dist.
Browse files Browse the repository at this point in the history
  • Loading branch information
ying_123 committed Jun 11, 2023
1 parent 65bea11 commit 55c15c4
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# node modules
node_modules/

# dist
dist/package.json
dist/README.md

# roolup cache
.rollup.cache/

Expand Down
56 changes: 56 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
### A tool for download hls/m3u8 to mp4

#### no longer depend on @ffmpeg/ffmpeg since version 2.0

### online demo

[online demo](https://code-app.netlify.app/hls2mp4/)

### install

```shell
# npm
npm install hls2mp4

# yarn
yarn add hls2mp4
```

### usage

```js
import Hls2Mp4 from "hls2mp4";

const hls2mp4 = new Hls2Mp4({
/**
* max retry times while request data failed, default: 3
*/
maxRetry?: number;
/**
* the concurrency for download ts segment, default: 10
*/
tsDownloadConcurrency?: number;
/**
* the type of output file, can be mp4 or ts, default: mp4
*/
outputType?: 'mp4' | 'ts';

}, (type, progress) => {
// type = 0 => load FFmpeg
// type = 1 => parse m3u8
// type = 2 => downloading ts
// type = 3 => merge ts
});

const buffer = await hls2mp4.download('your m3u8 url')
hls2mp4.saveToFile(buffer, 'test.mp4')
```

#### as script
```html
<script src="static/js/ffmpeg.min.js"></script>
<script src="dist/hls2mp4.js"></script>
<script>
const hls2mp4 = new Hls2Mp4({...})
</script>
```
42 changes: 42 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "hls2mp4",
"version": "2.0.5",
"description": "a tool for download hls/m3u8 to mp4",
"main": "index.js",
"types": "index.d.ts",
"repository": "https://github.com/icefee/hls2mp4",
"keywords": [
"ffmpeg",
"hls",
"m3u8"
],
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"aes-js": "^3.1.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-typescript": "^11.1.0",
"@types/aes-js": "^3.1.1",
"@types/node": "^20.2.5",
"rollup": "^3.21.4",
"tslib": "^2.0.0",
"typescript": "^4.7.4"
},
"type": "module",
"homepage": "https://github.com/icefee/hls2mp4",
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

0 comments on commit 55c15c4

Please sign in to comment.