Created
March 13, 2018 10:24
-
-
Save shirokoweb/d8f6aae4949c0e3c57cb2862e63497df to your computer and use it in GitHub Desktop.
Embed YT videos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="videosansson"></div> | |
<script async src="https://www.youtube.com/iframe_api"></script> | |
<script> | |
function onYouTubeIframeAPIReady() { | |
var player; | |
player = new YT.Player('videosansson', { | |
videoId: 'ID_DE_LA_VIDEO', // ID vidéo YT | |
width: 560, // Largeur player (en px) | |
height: 316, // Hauteur player (en px) | |
playerVars: { | |
autoplay: 1, // Auto-play la video au chargement | |
controls: 1, // Afficher les boutons pause/play | |
showinfo: 0, // Masquer le titre de la vidéo | |
modestbranding: 1, // Masque le logo YouTube | |
loop: 1, // Lire en boucle | |
fs: 0, // Masque le bouton plein écran | |
cc_load_policy: 0, // Hide closed captions | |
iv_load_policy: 3, // Masque les annotations de la vidéo | |
autohide: 0 // Masquer les contrôles lors de la lecture | |
}, | |
events: { | |
onReady: function(e) { | |
e.target.mute(); | |
} | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment