Leave a Reply

22 Comments on "Building a Media Player #9"

Notify of
avatar

SomeDud3
Guest
SomeDud3
12 days 3 hours ago

What are the underscores from? Are you using underscore library?

Ante Šepić
Guest
Ante Šepić
10 days 2 hours ago

I believe he used underscore to mark the class method as private. It's just a naming convention.

Mehran Djalali Behzad
Guest
Mehran Djalali Behzad
12 days 23 hours ago

@Paul, Would you suggest using the IntersectionObserver polyfill from WICG? or rather stick to a custom scroll event handler for this use case?

Robert Lamacraft
Guest
Robert Lamacraft
13 days 7 hours ago

will be so nice when stuff like this can be bundled into a reusable Web Component…

Paul Lewis
Guest
Paul Lewis
14 days 21 hours ago

For anyone wondering, I've now updated this code thanks to the suggestions in the comments from Birkir Guðjónsson and Abinash Mohapatra. See, team work makes the dream work! o/github.com/GoogleChrome/sample-media-pwa/commit/8b52486ea53c5ad40e3cab9d3063e6add30ba6d0

Gil Goldshlager
Guest
Gil Goldshlager
14 days 23 hours ago

Nice :)Can you please give a proper title to each video for it will be easier to find it later? for example the current title doesn't even have anything to do with this video.

Jonathan Hodgson
Guest
Jonathan Hodgson
14 days 23 hours ago

Do you add the src to a data-src attribute or something or do you unset the src attribute before the images have loaded? I have always been put of lazy loading images because they require the user to have JavaScript on. Have you got a work around for this?

Dale Martyn
Guest
Dale Martyn
14 days 20 hours ago

could you not use <noscript>, use regular <img src> and use a service worker to change the src into data-src? or is that a stupid idea?

Paul Lewis
Guest
Paul Lewis
14 days 22 hours ago

Yeah the <noscript> element, which contains a div with the BG image set on it.

Birkir Guðjónsson
Guest
Birkir Guðjónsson
14 days 23 hours ago

Hey, why don't you use the `unobserve` method to stop observing loaded images?

Hannan Ali
Guest
Hannan Ali
10 days 12 hours ago

ayyyy

Birkir Guðjónsson
Guest
Birkir Guðjónsson
14 days 7 hours ago

Paul Lewis sweet!

jarrod fairs
Guest
jarrod fairs
14 days 9 hours ago

good "observation" 😛

Paul Lewis
Guest
Paul Lewis
14 days 21 hours ago
Paul Lewis
Guest
Paul Lewis
14 days 22 hours ago

Sure, good idea.

ABINASH MOHAPATRA
Guest
ABINASH MOHAPATRA
14 days 23 hours ago

y not just unobserve the entries once the IO callback is called?? Then maybe we won't need the tagged class thingy?? just thinking out loud…

Paul Lewis
Guest
Paul Lewis
14 days 21 hours ago
Paul Lewis
Guest
Paul Lewis
14 days 22 hours ago

Yep, should have done that.

Raphael Höser
Guest
Raphael Höser
14 days 23 hours ago

Just a short question on your style of coding: Was it on purpose, that you add the "js-lazy-image–handled" class in line 86 of lazy-load-images.js via text and not by using LazyLoadImages.HANDLED_CLASS ?In my opinion it would be more elegant and future-proof to use the attribute you already created for this use.

Paul Lewis
Guest
Paul Lewis
14 days 22 hours ago

Just a bug. I should fix that.

Miyabi Igarashi
Guest
Miyabi Igarashi
14 days 23 hours ago

any chat on the accessibility?

Paul Lewis
Guest
Paul Lewis
14 days 22 hours ago

I have much to do there, which I will get to shortly.

wpDiscuz