Skip to content

Commit e4c5e27

Browse files
committed
mention embed lazy loading
1 parent 5627a44 commit e4c5e27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/website/embedding.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ You should change these attributes appropriately:
1515

1616
- `src="https://turbowarp.org/414716080/embed"` contains the ID of the project you want to embed. You should change this. We're using 414716080 as an example, but you can replace that number with any other project ID. You can also include other URL paramters as listed below.
1717
- `width="482" height="412"` defines the size of the embed. The player will automatically resize to whatever you specify here, so you can change the numbers. The border around the stage takes two pixels of width and height, and the controls take an extra 50 pixels of height. Thus, to get a 480x360 stage, you would use 482 and 412.
18+
- Optionally, you may want to add `loading="lazy"` to the attributes which lets the browser wait to load the iframe until the user scrolls closer to it. This can improve performance if the embed is pretty far down the page and doesn't need to be loaded right away.
1819

1920
The rest of the attributes should not be changed. Here's what they do if you were curious:
2021

@@ -26,7 +27,7 @@ The rest of the attributes should not be changed. Here's what they do if you wer
2627

2728
Here's what that example embed looks like in action:
2829

29-
<iframe src="https://turbowarp.org/414716080/embed" width="482" height="412" allowtransparency="true" frameborder="0" scrolling="no" allowfullscreen="" style={{colorScheme: "auto"}}></iframe>
30+
<iframe src="https://turbowarp.org/414716080/embed" width="482" height="412" allowtransparency="true" frameborder="0" scrolling="no" allowfullscreen="" style={{colorScheme: "auto"}} loading="lazy"></iframe>
3031

3132
## Unshared projects can't be embedded {#unshared-projects}
3233

0 commit comments

Comments
 (0)