Skip to content

Commit 3e555bf

Browse files
committed
Document default embedParams and mark modestbranding as deprecated
1 parent 3b99ee4 commit 3e555bf

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ npm i astro-lazy-youtube-embed
1212

1313
Use `embedParams` to pass [YouTube IFrame Player API parameters](https://developers.google.com/youtube/player_parameters#Parameters) for the embed, e.g. to set start & stop times to play a particular section when clicked.
1414

15+
Default `embedParams` are:
16+
17+
```js
18+
{
19+
// automatically start to play when the player loads
20+
autoplay: 1,
21+
}
22+
```
23+
1524
Use `thumbnailRes` to control the resolution of the thumbnail used for the placeholder.
1625

1726
```astro

YouTube.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface EmbedParams {
2121
list?: string
2222
listType?: 'playlist' | 'user_uploads'
2323
loop?: ToggleParam
24+
/** @deprecated has no effect, deprecated by YouTube on August 15 2023 */
2425
modestbranding?: ToggleParam
2526
origin?: string
2627
playlist?: string
@@ -55,7 +56,7 @@ let {
5556
...attrs
5657
} = Astro.props as Props
5758
58-
let params: EmbedParams = {...{autoplay: 1, modestbranding: 1}, ...embedParams}
59+
let params: EmbedParams = {autoplay: 1, ...embedParams}
5960
6061
let thumbnailUrl = `https://img.youtube.com/vi/${videoId}/${QUALITY_PREFIXES[thumbnailRes]}default.jpg`
6162
let embedQuery = Object.keys(params).map(key => `${key}=${params[key]}`).join('&')

0 commit comments

Comments
 (0)