YouTube in Confluence supports embedding individual videos and also playlists.
When you paste a YouTube URL into the Confluence editor it will attempt to generate the correct embed URL and display an embedded video.
Macro Parameters
Macro Parameter Name | Description |
---|
Width | Defaults to full width, but can be specified as a pixel value e.g. 600 |
Height | Defaults to 600 pixels, but can be specified as a pixel value e.g. 400 |
Aspect Ratio | Use this instead of a height to maintain correct aspect ratios at all screen sizes. There are a variety of aspect ratio, but the most common are: |
Examples of supported YouTube URLs
Description | URL pattern examples | Expected macro output |
---|
Normal video URLs | Code Block |
---|
https://youtube.com/watch?v={}
https://m.youtube.com/watch?v={}
https://www.youtube.com/watch?v={} |
Example: https://www.youtube.com/watch?v=FEhPhnkX4SA | Youtube macro |
---|
aspectRatio | 16 / 10 |
---|
url | https://www.youtube.com/watch?v=FEhPhnkX4SA |
---|
|
|
Normal videos with a specific start time | Code Block |
---|
https://youtube.com/watch?v={}&start=30
https://m.youtube.com/watch?v={}&start=30
https://www.youtube.com/watch?v={}&start=30 |
Note that the start time is in seconds only, e.g. &start=30 Example: https://www.youtube.com/watch?v=1AnG04qnLqI&start=30 | Youtube macro |
---|
aspectRatio | 4 / 3 |
---|
url | https://www.youtube.com/watch?v=1AnG04qnLqI&start=30 |
---|
|
|
/v/ URLs
| Code Block |
---|
https://youtube.com/v/{}
https://www.youtube.com/v/{} |
Example: https://www.youtube.com/v/FEhPhnkX4SA | Youtube macro |
---|
url | https://www.youtube.com/v/FEhPhnkX4SA |
---|
|
|
/v/ URLs with a specific start time
| Code Block |
---|
https://youtube.com/v/{}?start=30
https://www.youtube.com/v/{}?start=30 |
Note that the start time is in seconds only, e.g. &start=30 Example: https://www.youtube.com/v/1AnG04qnLqI?start=30 | Youtube macro |
---|
aspectRatio | 4 / 3 |
---|
url | https://www.youtube.com/v/1AnG04qnLqI?start=30 |
---|
|
|
Short link video URLs | Code Block |
---|
https://youtu.be/{} |
Example: https://youtu.be/FEhPhnkX4SA | Youtube macro |
---|
aspectRatio | 16 / 10 |
---|
url | https://youtu.be/FEhPhnkX4SA |
---|
|
|
Short link video URLs with a specific start time | Code Block |
---|
https://youtu.be/{}?start=30 |
Note that the start time is in seconds only, e.g. &start=30 Example: https://youtu.be/1AnG04qnLqI?start=30 | Youtube macro |
---|
url | https://youtu.be/1AnG04qnLqI?start=30 |
---|
|
|
Playlist URLs | Code Block |
---|
https://youtube.com/playlist?list={}
https://www.youtube.com/playlist?list={} |
Example: https://www.youtube.com/playlist?list=PL-9DkOQ9HIokIRFTQIlSnCIjIRdQcnARw | Youtube macro |
---|
aspectRatio | 16 / 10 |
---|
url | https://www.youtube.com/playlist?list=PL-9DkOQ9HIokIRFTQIlSnCIjIRdQcnARw |
---|
|
|
Embed URLs | Code Block |
---|
https://youtube.com/embed/{}
https://www.youtube.com/embed/{} |
Example: https://www.youtube.com/embed/FEhPhnkX4SA | Youtube macro |
---|
aspectRatio | 16 / 10 |
---|
url | https://www.youtube.com/embed/FEhPhnkX4SA |
---|
|
|
Embed URLs with a specific start time | Code Block |
---|
https://youtube.com/embed/{}?start=30
https://www.youtube.com/embed/{}?start=30 |
Note that the start time is in seconds only, e.g. ?start=30 Example: https://www.youtube.com/embed/1AnG04qnLqI?start=30 | Youtube macro |
---|
url | https://www.youtube.com/embed/1AnG04qnLqI?start=30 |
---|
|
|
Embed playlist URLs | Code Block |
---|
https://youtube.com/embed/videoseries?list={}
https://www.youtube.com/embed/videoseries?list={} |
Example: https://www.youtube.com/embed/videoseries?list=PL-9DkOQ9HIokIRFTQIlSnCIjIRdQcnARw | Youtube macro |
---|
aspectRatio | 16 / 10 |
---|
url | https://www.youtube.com/embed/videoseries?list=PL-9DkOQ9HIokIRFTQIlSnCIjIRdQcnARw |
---|
|
|