« Web, HTML, Tech Forum

yt video popup

Posted by aissss

posted

Forum: Web, HTML, Tech

how does one make a youtube video popup on the side of the screen not in the about me section or something


Report Topic

1 Reply

Reply by byte

posted
updated

Hi! this code, autoplays the youtube video and you can manually set it anywhere in your profile page.

Instructions:

  • don't insert in inside <style></style>
  • place it at the very bottom of your about me
  • find a youtube video you like, and take the video ID of its youtube link. 
  • example: https://www.youtube.com/watch?v=BnkhBwzBqlQ (the underlined part is the video ID)
  • now in the code, replace the name VIDEO_ID with the actual ID you just got from the youtube link

let me know if it works!


Code:

<div id="youtube-video" style="position: fixed; top: 20%; right: 10px; width: 300px; z-index: 1000;">

<!-- you can change the location of the yt vid anywhere by fiddling with the top, and right! -->

<!-- you can also change them to bottom and left or left and top or right and bottom, you get the idea -->

  <iframe 

    width="300" <!-- change the width of the video-->

    height="170" <!-- change the height of the video-->

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

    frameborder="0" 

    allow="autoplay; encrypted-media" 

    allowfullscreen>

  </iframe>

</div>


Permalink Report Reply