-
Notifications
You must be signed in to change notification settings - Fork 422
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3ccb11a
chore: use transmuxer debug/warn/error events to the debug log
brandonocasey bc0236b
add test
brandonocasey 7d38d47
update worker-factory and test for sync
brandonocasey 7c9b473
update mux.js
brandonocasey 1723a60
Merge branch 'main' into chore/transmuxer-log-events
brandonocasey 5497d00
switch from debug/warn/error to log
brandonocasey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.