-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Worker source handoff is fragile and likely to break with bundlers/minifiers #5107
Comments
In order to load its worker, When using
These helpers are lexically scoped to now mangled code that relies on them. Any calls to those functions added to When the worker loads this string via blob url, all of those functions are now This type of issue is described in the I think most of this issue could be avoided by adding a |
Hey @robwalch, any good options here? We've got a workaround in place where we disable terser on this bundle and consume |
Hi @issacgerges, I'd like to maintain the current ease of use at all costs. Supporting an optional/alternative loaded worker script when defined in the config is a good idea. I would review and be open to accepting a contribution for this. Any such change should not break the default worker injection. In terms of fragility with minifiers and manglers, I would also accept changes like #5036 that improve support for changes made to minified code with certain options enabled. Whether the default worker injection is enabled or an optional worker script is configured, if either method failed (A: to run the worker or B: the main player could not ack it), operation should fallback to workerless mode. This was implemented in #5016. I expect HLS.js to run even with your repro steps when using the latest player version. If that is not the case, let me know. Forcing enableWorker to false should not be required. |
Hi @issacgerges, I'd like to get your feedback on #5299. Would it solve or at least prevent some of the bundling issues you've described? cc @laurens94 and @dev-justin |
) * Convert build packager to rollup * Add an es module target (#2910) * UMD build worker injection (#5107) * Add ES5 syntax check for UMD builds (#5301, #5288) * Add common rollup config * handle `self` not existing (happens in nodejs. The check that makes sure the dist file can be required in node and not throw was failing because of this.) * Disable coverage in CI * Add `config.workerPath` option and "hls.worker.js" build output (#5107) * Include transmuxer-interface id ("main" and "audio") in Web Worker setup and error logs Co-authored-by: Tom Jenkinson <tom@tjenkinson.me>
Version 1.4 is in beta now. We've switched from webpack to rollup for packaging. The library now includes ES module output with "hls.mjs", and a separate worker script "hls.worker.js" which you can point to via config.workerPath should you choose to use the ESM output or repackage HLS.js such that the UMD worker injection is no longer available. The worker injection is also much simpler, and the player will fallback to inline demuxing when it fails (this issue). https://github.com/video-dev/hls.js/releases/tag/v1.4.0-beta.2 |
#718) …, since this appears to cause edge case issues with initial times after ts segment transmuxing. To test Next.js usage: - confirm playbackId `8xhTU2GpKuskv1eCx8rdp3PodlGb6dABCf27f4BsmW8` does not continually load the 0th segment before playback - confirm that playback begins at time 0 - confirm that you can seek back to time 0 after playback has begun **NOTE**: We originally used the minified version of hls.js due to issues with svelte-kit and Vue minified builds, with a root cause of how its web worker was integrated. This appears to be resolved since hls.js has migrated its build setup to rollup. Confirmed locally that there were no issues with svelte-kit, but make sure to do additional smoke testing for our Vue and Svelte apps before any approval. For reference, see: - #541 - video-dev/hls.js#5107
What version of Hls.js are you using?
1.2.9
What browser (including version) are you using?
Chrome 108.0.5359.98 (Official Build) (x86_64)
What OS (including version) are you using?
MacOS Monterey 12.6.1
Test stream
No response
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
esbuild
with a flag likekeep-names
Expected behaviour
The stream should load normally
What actually happened?
The stream will fail to load
Console output
or, minified
This was previously reported in #3749, but closed as there was no repro and the report was unspecific
The text was updated successfully, but these errors were encountered: