My Lazyload code seems to only show some thumbnails

I have used the following tutorial and code to implement a  youtube lazyload function in my website so that it doesn't take an age for all my YouTube videos to load on my page - Link to tutorial .

I also pasted the full code from the tutorial which I got from here....code used for the tutorial

To tailor it to suit my project, I linked it to my database which has four entries. I replaced the lines:
<div class="youtube" data-embed="AqcjdkPMPJA">
		<div class="play-button"></div>

Open in new window

with the following -
<?php while($song = mysqli_fetch_array($result)) 
													{ 															//WE ARE USING A WHILE LOOP TO POPULATE THE TABLE
											?> 				
													<div class="youtube" data-embed="<?php echo $song['youtube'];?>">
													<div class="play-button"></div>
													</div>
													
											  <?php } ?>

Open in new window


So it worked (sort of). The connection with the database was fine. The problem is that only the thumbnail for the example  - AqcjdkPMPJA seems to appears. For the other three entries in my table, the thumbnail does not appear - although the video plays when I click on it.

I wonder, is it an issue with the tutorial in that only a select few thumbnails work, or could I be appending incorrectly? For example, if I wanted to embed  https://www.youtube.com/embed/KmO5J05z3PY?rel=0&showinfo=0, i was putting KmO5J05z3PY in my database table....

Thoughts / advice would be greatly appreaciated. Failing that if anybody can point me in the direction of a simple YouTube Lazloader that works for all thumbnails...

Many thanks

Adam
AdamTrying to learn phpAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AdamTrying to learn phpAuthor Commented:
Further to this. I have tried a different LazyLoad script and I'm getting the same issue. The Thumbnail preview of the video only seems to work for some of the videos, not all.

No idea why.
AdamTrying to learn phpAuthor Commented:
Hi all. Just to update. I'm not sure if a thumbnail was the correct term  - I am referring to a preview of the Youtube video. I specified the size in my css / html so it's not really a thumbnail.

Still not found a solution. The preview displays only after the video is completed.

Stuck.
AdamTrying to learn phpAuthor Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.