Hacker News new | ask | show | jobs
by Ntrails 3475 days 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.

1 comments

yes, 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

I'd still prefer a video link, and leave it to my client to negotiate. I have never enjoyed viewing embedded videos in web pages (content aside).
It's an issue with a poor UI design, not lazy-loading though.