Mutant. 25+'s profile picture

Published by

published
updated

Category: Web, HTML, Tech

Code to share YouTube videos

Quick Manual Template

  1. Take your YouTube link, for example: https://youtu.be/VIDEOID or https://www.youtube.com/watch?v=VIDEOID

  2. Replace VIDEOID below with your video’s ID:

<iframe width="550" height="315"

    src="https://www.youtube.com/embed/VIDEOID?rel=0"

    frameborder="0"

    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

    allowfullscreen>

</iframe>

The ID in the link https://youtu.be/Xczn1PcDzD8?si=ie_NZuivopVRyWZL is Xczn1PcDzD8

Here’s how you tell:

  • For short links like youtu.be/VIDEOID?..., the VIDEOID is what comes after the slash (/) before any ? or extra stuff.

Optional Parameters
  • ?rel=0 → hides unrelated suggested videos.

  • ?autoplay=1 → starts playing automatically.

  • &loop=1&playlist=VIDEOID → makes it loop.

Example with autoplay + loop:

<iframe width="350" height="215"

    src="https://www.youtube.com/embed/b4taIpALfAo?autoplay=1&loop=1&playlist=b4taIpALfAo&rel=0"

    frameborder="0"

    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

    allowfullscreen>

</iframe>

Autoplay for profile

<iframe width="0" height="0" src="https://www.youtube.com/embed/981q4qkLo_Q//?&;amp;;autoplay=1&;loop=1&;controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">

Youtube shorts: <iframe width="315" height="560"

src="https://www.youtube.com/embed/<Shorts_video_code>"

title="YouTube video player"

frameborder="0"

allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"

allowfullscreen></iframe> 


4 Kudos

Comments

Displaying 2 of 2 comments ( View all | Add Comment )

MiRAGE_☆

MiRAGE_☆'s profile picture

Thank youu :D I been wanting to do that, I'll make sure to try it out!!!


Report Comment



I'm glad it's useful :)

by Mutant. 25+; ; Report

Russet

Russet's profile picture

oh shit??? cool

I should test it thanks


Report Comment



Your welcome, this is honestly a note to self lol

by Mutant. 25+; ; Report

understood !!

by Russet; ; Report

I always forget how to when i need it lol.

You need to click on <> in the menu when making a bulletin or blog before entering the code btw, or it won't work

by Mutant. 25+; ; Report

oh no worries i grew up with css with deviantart, it's my main reason why I'm on spacehey

by Russet; ; Report

You know more than me than lol

by Mutant. 25+; ; Report

ahehehe

by Russet; ; Report