Send reply to browser and suppress output from mpv #2
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ryze/ff2mpv-rust#2
Loading…
Reference in a new issue
No description provided.
Delete branch "improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sending the
"ok"
message (including the quotes for a JSON-formatted string) back to the browser prevents theError: An unexpected error occurred
lines in the browser console.The output of mpv is suppressed so that it doesn't get read by the browser which then tries to parse it as JSON messages. Apart from also reducing log clutter, this change seems to have fixed a behavior where closing the browser also killed the mpv instance. This is only relevant when the
--no-terminal
option is unset. Maybe this option should be set by default, but I think the current way is fine as well where it's up to the user and you could technically even use a different player than mpv.Thanks for the PR!
I've actually tested to see if the error message appears in console on Firefox 111, maybe it did in the earlier versions though. Whatever the case I included the reply function in code, but forgot to actually call it.
Suppressed log is great! Closing browser should not affect the mpv, since it is a detached process, tested as well.