question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use for lazy-loading embedded videos?

See original GitHub issue

I was trying to use this to lazy-load youtube videos embedded via their iframe widget, but unfortunately it doesn’t work (it tries to convert the iframe source to data:image/png;base64).

Can this be updated to also support lazy-loading of iframes?

Example:

<iframe width="560" height="315" frameborder="0"  v-lazy="'//www.youtube.com/embed/' + videoID" allowfullscreen></iframe>

I would expect this video to be lazy-loaded, but using the current version it throws an error.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hilongjwcommented, Feb 21, 2017
<template>
<div>
<lazy-component tag="div"  @loaded="handler">
  <iframe width="560" height="315" frameborder="0"  src="'//www.youtube.com/embed/' + videoID" allowfullscreen></iframe>
<lazy-component>
</div>
</template>

<script>
export default {
  methods: {
    handler () {
     console.log('loaded')
    }
  }
}
</script>
0reactions
atazmincommented, Dec 29, 2020

Maybe wrap in <client-only> or <ssr> ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy load embedded YouTube videos | CSS-Tricks
This is a very clever idea via Arthur Corenzan. Rather than use the default YouTube embed, which adds a crapload of resources to...
Read more >
How to properly configure "Lazy Loading" of a YouTube ...
In this article, I'm going to explain how to optimally load an embedded YouTube video using lazy loading with JavaScript. A.1. Include ...
Read more >
How to “Lazy Load” Embedded YouTube Videos
In this tutorial I'll explain how to “lazy load” multiple embedded YouTube videos. Doing so will improve the performance of our initial page ......
Read more >
Lazy loading video - web.dev
This post explains lazy loading and the options available to you when lazy loading video.
Read more >
7 Best Youtube Lazy Loaders To Improve Page Speed (2022 ...
embedVideo is a simple-to-use jQuery plugin that helps you quickly embed Youtube videos into your webpages with lazy load support.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found