fix(SUP-39292): V7 Player v3.15.2 Shows ReferenceError #212
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.
Description of the Changes
Issue:
Console logs show the message "[Error] Category: 0 | Code: 0 | {name: internalException}" and in some cases also "ReferenceError: e is not defined"
Explanation:
hls.js uses a worker thread when decoding video messages
if the worker thread encounters an error, it will fallback to decoding on the main thread and will show the message "warn] > Error in "main" Web Worker, fallback to inline" (visible when playback.options.html5.hls.debug = true)
One of the changes included in the last hls.js version upgrade seems to have been a change in the worker-related code (possibly this one)
The hls.js version with these changes works fine when running the player locally, where webpack-dev-server runs with "--mode development"
However, once we build a version and use "--mode production", webpack optimization removes some code from the worker function (i did a text comparison of the worker runtime code and the production version has fewer lines of code), which then causes the worker to throw an error during initialization
This is similar to what is described in this issue
Solution:
Since decoding currently falls back to main thread anyway, we can just disable the worker as described in the issue above, which will prevent the console errors from appearing
Resolves SUP-39292, SUP-39280
CheckLists