News for hackers. Stuff that matters.
Re:YouTube Video as Background in React by Jamie9912 on Sunday March 27, 2022 @05:59AM (#30819058)
46k lines of code for this
Re:YouTube Video as Background in React by izietto on Sunday March 27, 2022 @06:20AM (#30819146)
If I should point to something that isn't very good is the placeholder test, but the code is ok to me.
Re:YouTube Video as Background in React by izietto on Sunday March 27, 2022 @06:17AM (#30819137)
I count 213 JS + 41 CSS = 254 lines
Re:YouTube Video as Background in React by 11235813213455 on Sunday March 27, 2022 @08:23AM (#30819700)
Re:YouTube Video as Background in React by naoqj on Sunday March 27, 2022 @06:47AM (#30819256)
You forget the dependencies.
Re:YouTube Video as Background in React by CapsAdmin on Sunday March 27, 2022 @07:12AM (#30819367)
of course.. :-)

I'm not sure what we're talking about here because it's not very obvious where this number comes from. Is it the YouTube API, excluding React?

If you're thinking of using a React library, we have to assume you're already using React.

Mentioning line count is useless unless you're someone intending to explicitly manage that code. But if so, why stop at 40k?

It seems more constructive to talk about the size impact in megabytes or loading time of requiring the YouTube API just to have video playing in the background vs just just hosting your own static video alongside the html. Of course assuming you already use React.