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

Feature Request: Reduce bundle size, currently arround 120kB #741

Open
1 task done
JoeMatkin opened this issue Aug 15, 2023 · 2 comments
Open
1 task done

Feature Request: Reduce bundle size, currently arround 120kB #741

JoeMatkin opened this issue Aug 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@JoeMatkin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-video-react

Description

There is no easy way to lazy load the player and even so they bundle size is way to big.

It added 120kB to my first load JS

Instead I'm now lazy loading react-player with a reduced bundle size of 120kB

Expected Behavior

A reduced bundle size and the ability to defer / lazy load

@JoeMatkin JoeMatkin added the enhancement New feature or request label Aug 15, 2023
@dylanjha
Copy link
Contributor

@JoeMatkin thanks for opening. Lazy loading will depend on your framework and build setup, what are you using?

We do have a guide here about Lazy Loading Mux Player

The biggest dependency we have is Hls.js, which is beefy and required in order to make Hls playback work in all non-Safari browsers.

@Hahlh
Copy link

Hahlh commented Mar 29, 2024

@JoeMatkin thanks for opening. Lazy loading will depend on your framework and build setup, what are you using?

We do have a guide here about Lazy Loading Mux Player

The biggest dependency we have is Hls.js, which is beefy and required in order to make Hls playback work in all non-Safari browsers.

HLS leads to 383kb being loaded client side in our case.

Not including the other 83kb by mux-embed and another 135kb by @mux.
That's quite a bit.

image

Is that expected?
Our only dependency in package.json is "@mux/mux-player-react": "^1.14.2",.

Might v2 contain some improvements in that regard?
Or is this unexpected we should hunt for some kind of misconfiguration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants