-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use transmuxer debug/warn/error events to the debug log #1155
Changes from all commits
3ccb11a
bc0236b
7d38d47
7c9b473
1723a60
5497d00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,7 +289,8 @@ const transmuxAndNotify = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}) => { | ||
const fmp4Tracks = segment.map && segment.map.tracks || {}; | ||
const isMuxed = Boolean(fmp4Tracks.audio && fmp4Tracks.video); | ||
|
@@ -358,6 +359,7 @@ const transmuxAndNotify = ({ | |
onEndedTimeline: () => { | ||
endedTimelineFn(); | ||
}, | ||
onTransmuxerLog, | ||
onDone: (result) => { | ||
if (!doneFn) { | ||
return; | ||
|
@@ -415,7 +417,8 @@ const handleSegmentBytes = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might do a refactor after this pull request, 90% of these functions don't care about these handlers, why do we have to call each one out in the parameters every single time... |
||
onTransmuxerLog | ||
}) => { | ||
let bytesAsUint8Array = new Uint8Array(bytes); | ||
|
||
|
@@ -510,6 +513,9 @@ const handleSegmentBytes = ({ | |
// transfer bytes back to us | ||
bytes = message.data.buffer; | ||
segment.bytes = bytesAsUint8Array = message.data; | ||
message.logs.forEach(function(log) { | ||
onTransmuxerLog(videojs.mergeOptions(log, {stream: 'mp4CaptionParser'})); | ||
}); | ||
finishLoading(message.captions); | ||
} | ||
}); | ||
|
@@ -547,7 +553,8 @@ const handleSegmentBytes = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}); | ||
}; | ||
|
||
|
@@ -623,7 +630,8 @@ const decryptSegment = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}) => { | ||
decrypt({ | ||
id: segment.requestId, | ||
|
@@ -645,7 +653,8 @@ const decryptSegment = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}); | ||
}); | ||
}; | ||
|
@@ -691,7 +700,8 @@ const waitForCompletion = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}) => { | ||
let count = 0; | ||
let didError = false; | ||
|
@@ -737,7 +747,8 @@ const waitForCompletion = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}); | ||
} | ||
// Otherwise, everything is ready just continue | ||
|
@@ -753,7 +764,8 @@ const waitForCompletion = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}); | ||
}; | ||
|
||
|
@@ -942,7 +954,8 @@ export const mediaSegmentRequest = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}) => { | ||
const activeXhrs = []; | ||
const finishProcessingFn = waitForCompletion({ | ||
|
@@ -957,7 +970,8 @@ export const mediaSegmentRequest = ({ | |
isEndOfTimeline, | ||
endedTimelineFn, | ||
dataFn, | ||
doneFn | ||
doneFn, | ||
onTransmuxerLog | ||
}); | ||
|
||
// optionally, request the decryption key | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to update
rollup-plugin-worker-factory
to callonmessage
indispatchEvent
as we useonmessage
in this scenario in tests.