Skip to content

Conversation

@peaBerberian
Copy link
Collaborator

Built on #1664 (the PR, not the other thing).

While exchanging in that PR with @Florent-Bouisset, we noticed that the choice of whether we rely on mse-in-worker was done by the Public API part of the code, which then directly told our WebWorker to use that feature without telling any other part of the code.

However, that PR brought the need to have that information inside the ContentInitializer - so that it knows whether a given codec is supported (for cases, only seen on Edge for now, where codec support is different depending on if MSE is relied on inside a worker or on main thread).

Even without this, I thought that our ContentInitializer, as a global controlling module, should probably architecturally be in the know of whether MSE API are called in-worker or in-main-thread.

So I propose this modification, where the information on whether mse-in-worker should be used is both communicated to the ContentInitializer, but is also set per-content (we don't need that, but it's actually both simpler and more powerful that way so why not).

This also opens the way for an API to control this, but I did not add one for now.

…-worker

Built on #1664 (the PR, not the other thing).

While exchanging in that PR with @Florent-Bouisset, we noticed that the
choice of whether we rely on mse-in-worker was done by the Public API
part of the code, which then directly told our WebWorker to use that
feature without telling any other part of the code.

However, that PR brought the need to have that information inside the
`ContentInitializer` - so that it knows whether a given codec is
supported (for cases, only seen on Edge for now, where codec support is
different depending on if MSE is relied on inside a worker or on main
thread).

Even without this, I thought that our `ContentInitializer`, as a global
controlling module, should probably architecturally be in the know of
whether MSE API are called in-worker or in-main-thread.

So I propose this modification, where the information on whether
mse-in-worker should be used is both communicated to the
`ContentInitializer`, but is also set per-content (we don't need that,
but it's actually both simpler and more powerful that way so why not).

This also opens the way for an API to control this, but I did not add
one for now.
@github-actions
Copy link

✅ Automated performance checks have passed on commit 6c434c22c4127e5a4f35cd4e77a7c75da9bc6bc9 with the base branch dev.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.65ms -> 20.05ms (-0.394ms, z: 0.06052) 27.15ms -> 27.15ms
seeking 12.76ms -> 14.72ms (-1.964ms, z: 0.24748) 11.55ms -> 11.55ms
audio-track-reload 27.23ms -> 27.13ms (0.098ms, z: 1.02085) 39.75ms -> 39.60ms
cold loading multithread 48.56ms -> 47.75ms (0.815ms, z: 11.54520) 70.95ms -> 69.75ms
seeking multithread 30.70ms -> 24.14ms (6.561ms, z: 1.09557) 10.50ms -> 10.50ms
audio-track-reload multithread 26.88ms -> 26.84ms (0.042ms, z: 0.95114) 39.45ms -> 39.45ms
hot loading multithread 16.69ms -> 16.57ms (0.119ms, z: 2.71681) 24.15ms -> 23.85ms

@peaBerberian peaBerberian added this to the 4.4.0 milestone Apr 9, 2025
@peaBerberian peaBerberian merged commit 82796cf into dev Apr 9, 2025
10 checks passed
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.

3 participants