Skip to content

Instantly share code, notes, and snippets.

@animoplex
Created March 24, 2019 19:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save animoplex/644deaefc79099f44f6d5bd278156391 to your computer and use it in GitHub Desktop.
Save animoplex/644deaefc79099f44f6d5bd278156391 to your computer and use it in GitHub Desktop.
Enhanced YouTube Embed Code - Animoplex
<!-- Enhanced Youtube Embed Code for Motion Portfolios - Created by Animoplex
Features: Responsive-width player, removes tracking cookies, changes red controls to white, reduces YouTube branding
How to use: Replace the standard YouTube iframe embed code with the code below and add your YouTube video ID -->
<div style="width:100%; max-width:960px;">
<div style="position:relative; height:0; padding-bottom:56.25%;">
<!-- Video size ratio calculation: 1080px / 1920px = 0.5625 (16:9) -->
<iframe
style="position:absolute; width:100%; height:100%;"
src="https://www.youtube-nocookie.com/embed/YOUTUBEVIDEO?autoplay=1&amp;color=white&amp;modestbranding=1&amp;rel=0"
title="Video Player"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
<!-- Replace YOUTUBEVIDEO above with your YouTube video ID (Example: 7_hZlzD4fos) -->
</iframe>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment