3 ms·
> 1.22MB embedded youtube players A guy who I used to post with wrote a new forum for us all to post on (woo splinter groups). It's pretty cool. One of the t
by Ntrails 10y ago
> 1.22MB embedded youtube players
A guy who I used to post with wrote a new forum for us all to post on (woo splinter groups). It's pretty cool. One of the things it does is serve a static image of the underlying youtube and then load it on click. When a 'tube might be quoted 7 times on a page - that's a pretty useful trick.
I'd just assumed this was a standard forum feature and then I opened a "Music Megathread" on an ipboard and holy shit loading 30 youtube players was painful.
- leeoniya 10y agoyes, you can lazy-load the youtube player, there's also a jquery plugin for it [1]. but this setup requires 2 clicks to play on mobile (because google restricts the player from autoplaying onload in mobile devices due to bandwidth/data-usage concerns). the first click will appear to do nothing as it loads the 1.22MB player, so delivers a crap experience. you're much better off just serving an html5 <video> tag. you can likely fit your entire video in mobile quality in that 1.22MB :D [1] https://github.com/tylerpearson/lazyYT https://github.com/tylerpearson/lazyYT