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

Fix JavascriptSubtitlesOctopus dispose #3024

Merged
merged 3 commits into from Oct 4, 2021

Conversation

dmitrylyzo
Copy link
Contributor

@dmitrylyzo dmitrylyzo commented Oct 2, 2021

JavascriptSubtitlesOctopus has the dispose call in the error handler.
This makes it hard to control the disposing flow of elements.

Changes

  • 2 hacks to clear resources after JSO error occurs.
    It would be better to remove that dispose call. But we need to discuss this with the upstream.
  • Dispose JSO first (before destroying the player).

Issues
JSO is trying to remove canvas from the video element, but we already removed the latter from the DOM:
https://github.com/jellyfin/JavascriptSubtitlesOctopus/blob/f4625ac313b318bd5d2e0ae18679ff516370bae6/src/subtitles-octopus.js#L863

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at SubtitlesOctopus.self.dispose (http://.../web/JavascriptSubtitlesOctopus_dist_js_subtitles-octopus_js.33eb72ced6222e91e928.chunk.js:1616:29)
    at Worker.SubtitlesOctopus.self.workerError (http://.../web/JavascriptSubtitlesOctopus_dist_js_subtitles-octopus_js.33eb72ced6222e91e928.chunk.js:1113:12)

Steps To Reproduce

  1. Copy SRT subtitles as ASS (change extension).
  2. Refresh metadata.
  3. Select bad ASS subtitles.
  4. Play the video.
  5. Error occurs 3 times.

There is an error with the error message history, but I will fix this in the next PR (just to make things atomic).

@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

@thornbill thornbill merged commit f18b0d3 into jellyfin:master Oct 4, 2021
@dmitrylyzo dmitrylyzo deleted the fix-jso-dispose branch October 4, 2021 17:22
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.

None yet

2 participants