aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-10-09 11:08:09 +0200
committerGitHub <noreply@github.com>2018-10-09 11:08:09 +0200
commit62cd74a890ea3b150c77482d746a716d5001a323 (patch)
treec81bd73d236f6826d23b9b4f2fe38b9af7bd170e
parent7b707696b40a98e717d91e24162869f6d9c22957 (diff)
downloadfreenode-live-2017-presentation-62cd74a890ea3b150c77482d746a716d5001a323.tar
freenode-live-2017-presentation-62cd74a890ea3b150c77482d746a716d5001a323.tar.gz
add note about lazy loading iframes #1672 #1938
-rw-r--r--README.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/README.md b/README.md
index 72d2ac9..c60e6a4 100644
--- a/README.md
+++ b/README.md
@@ -517,7 +517,7 @@ If there's some part of your content that needs to remain accessible to touch ev
When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option.
-To enable lazy loading all you need to do is change your `src` attributes to `data-src` as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible.
+To enable lazy loading all you need to do is change your `src` attributes to `data-src` as shown below. This is supported for image, video, audio and iframe elements.
```html
<section>
@@ -530,6 +530,12 @@ To enable lazy loading all you need to do is change your `src` attributes to `da
</section>
```
+#### Lazy Loading Iframes
+Note that lazy loaded iframes ignore the `viewDistance` configuration and will only load when their containing slide becomes visible. Iframes are also unloaded as soon as the slide is hidden.
+
+When we lazy load a video or audio element, reveal.js won't start playing that content until the slide becomes visible. However there is no way to control this for an iframe since that could contain any kind of content. That means if we loaded an iframe before the slide is visible on screen it could begin playing media and sound in the background.
+
+
### API
The `Reveal` object exposes a JavaScript API for controlling navigation and reading state: