• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 46
  • Last Modified:

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
0
Adam
Asked:
Adam
  • 3
1 Solution
 
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.
0
 
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.
0
 
AdamTrying to learn phpAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now