// 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); var current_link = -1; tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var last_sync = new Date().getTime(); // 3. This function creates an