Skip to content

Commit

Permalink
fix compatibility on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
icefee committed Jun 11, 2023
1 parent d2f581d commit 30dc186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hls2mp4",
"version": "2.0.4",
"version": "2.0.5",
"description": "a tool for download hls/m3u8 to mp4",
"main": "index.js",
"types": "index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Hls2Mp4 {
private totalSegments = 0;
private duration = 0;
private savedSegments = new Map<number, Uint8Array>()
public static version = '2.0.4';
public static version = '2.0.5';
public static TaskType = TaskType;

constructor({ maxRetry = 3, tsDownloadConcurrency = 10, outputType = 'mp4' }: Hls2Mp4Options, onProgress?: ProgressCallback) {
Expand Down Expand Up @@ -217,11 +217,11 @@ class Hls2Mp4 {
for (let i = 0; i < matches.length; i++) {
const matched = matches[i]
if (matched.match(/#EXT-X-KEY/)) {
const matchedKey = matched.match(keyMatchRegExp)
const matchedIV = matched.match(/(?<=IV=)\w+$/)
const matchedKey = matched.match(keyMatchRegExp)?.[0]
const matchedIV = matched.match(/IV=\w+$/)?.[0]?.replace(/^IV=/, '')
segments.push({
key: matchedKey?.[0],
iv: matchedIV?.[0],
key: matchedKey,
iv: matchedIV,
segments: []
})
}
Expand Down

0 comments on commit 30dc186

Please sign in to comment.