You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Mux Elements/Packages does this apply to? Select all that apply
playback-core
Which browsers are you using?
Chrome
Which operating systems are you using?
macOS
Description
Preface: this only happens in built/packed environments, local servers don't run into this issue.
hls-js uses a web worker if it can for muxing and as of hls-js 1.4.X, the library now ships with an ESM version and webpack v5 will by default grab the ESM dist instead of the raw worker that we need to be executing.
This causes the worker to fail after grabbing the first chunk of the video and for preload='metadata' on chrome that means our first playbacks were consistently 270p (level 0), even if initially the first rendition was 720p (level 2). .
We use mux-player-react for our site, but I imagine this affects anyone using playback-core and webpack v5 +.
The solution for us was to eject the worker file during packing and pass in the absolute path to the hlsConfig for the mux-player.
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, `${paths.appNodeModules}/hls.js/dist/hls.worker.js`),
to: path.resolve(__dirname, `../build/hls.worker.js`)
}
]
})
install mux-player-react into a site packaged with webpack v5.
turn on debug logging for hls.
load a video with preload of metadata on chrome to get the cleanest logs since it just loads 1 chunk.
watch the worker error and cap level drop to 0, and subsequent refetch of chunk 0 at level 0.
Current Behavior
playback-core/hls.js performance is degraded when using webpack v5
Expected Behavior
I'm not sure if the solution would be to just update documentation to reflect this interaction or if there's something clever you all could come up with to do this by default, but I'd bet there's quite a few consumers of this library that are using webpack and are quite confused with the first chunk issues (at least in browser that support web workers)
Errors
No response
What version of the package are you using?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Which Mux Elements/Packages does this apply to? Select all that apply
playback-core
Which browsers are you using?
Chrome
Which operating systems are you using?
macOS
Description
Preface: this only happens in built/packed environments, local servers don't run into this issue.
hls-js uses a web worker if it can for muxing and as of hls-js 1.4.X, the library now ships with an ESM version and webpack v5 will by default grab the ESM dist instead of the raw worker that we need to be executing.
This causes the worker to fail after grabbing the first chunk of the video and for
preload='metadata'
on chrome that means our first playbacks were consistently 270p (level 0), even if initially the first rendition was 720p (level 2)..
We use
mux-player-react
for our site, but I imagine this affects anyone usingplayback-core
and webpack v5 +.The solution for us was to eject the worker file during packing and pass in the absolute path to the hlsConfig for the mux-player.
Reduced test case
No response
Steps to reproduce
mux-player-react
into a site packaged with webpack v5.metadata
on chrome to get the cleanest logs since it just loads 1 chunk.Current Behavior
playback-core/hls.js performance is degraded when using webpack v5
Expected Behavior
I'm not sure if the solution would be to just update documentation to reflect this interaction or if there's something clever you all could come up with to do this by default, but I'd bet there's quite a few consumers of this library that are using webpack and are quite confused with the first chunk issues (at least in browser that support web workers)
Errors
No response
What version of the package are you using?
No response
The text was updated successfully, but these errors were encountered: