YouTube provides privacy enhanced mode for embedded videos to avoid loading any tracking cookies. This can be configured when you get the embed like from YouTube. This way you don't have to worry about cookie consent:

<iframe width="560" height="315" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Another way would be to load YouTube embed video using inline javascript code which will honor the cookie preferences:

<div id="ytplayer">You must enable analytical cookies to watch this video</div>
<script type="text/plain" data-consent="analytics">
// Load the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

// Replace the 'ytplayer' element with an <iframe> and
// YouTube player after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('ytplayer', {
height: '390',
width: '640',
videoId: 'NHEaYbDWyQE'