Skip to content
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 6 commits into from
Jul 9, 2021

Conversation

brandonocasey
Copy link
Contributor

Log debug/warn/error from the transmuxer.
videojs/mux.js#391

@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #1155 (5497d00) into main (b7942ff) will decrease coverage by 0.04%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1155      +/-   ##
==========================================
- Coverage   86.48%   86.44%   -0.05%     
==========================================
  Files          39       39              
  Lines        9509     9551      +42     
  Branches     2192     2200       +8     
==========================================
+ Hits         8224     8256      +32     
- Misses       1285     1295      +10     
Impacted Files Coverage Δ
src/media-segment-request.js 95.40% <50.00%> (-0.33%) ⬇️
src/segment-loader.js 96.19% <100.00%> (+<0.01%) ⬆️
src/segment-transmuxer.js 95.19% <100.00%> (+0.09%) ⬆️
src/transmuxer-worker.js 74.35% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7942ff...5497d00. Read the comment docs.

@brandonocasey brandonocasey force-pushed the chore/transmuxer-log-events branch from e03d46e to bc0236b Compare July 2, 2021 15:31
@@ -81,7 +81,7 @@
"lodash-compat": "^3.10.0",
"nomnoml": "^0.3.0",
"rollup": "^2.36.1",
"rollup-plugin-worker-factory": "0.5.5",
"rollup-plugin-worker-factory": "0.5.7",
Copy link
Contributor Author

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 call onmessage in dispatchEvent as we use onmessage in this scenario in tests.

@@ -415,7 +427,10 @@ const handleSegmentBytes = ({
isEndOfTimeline,
endedTimelineFn,
dataFn,
doneFn
doneFn,
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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...

Comment on lines 158 to 168
transmuxer.on('debug', function({message}) {
self.postMessage({action: 'debug', message});
});

transmuxer.on('error', function({message}) {
self.postMessage({action: 'error', message});
});

transmuxer.on('warn', function({message}) {
self.postMessage({action: 'warn', message});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the mux.js commit is already in, but I think we may be better off using log with a level and message. error usually is a special case separate from standard log messages, and it would also allow us to only have one function all the way through the chain.

gkatsev
gkatsev previously approved these changes Jul 9, 2021
@brandonocasey brandonocasey merged commit 1e2f7a4 into main Jul 9, 2021
@brandonocasey brandonocasey deleted the chore/transmuxer-log-events branch July 9, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants