'use strict'; const socket = io(); const buttonLocation = document.querySelector('#sendLocation'); const form = document.querySelector('#sendMessForm'); const formButton = document.querySelector('#formButton'); const input = form.childNodes[1]; const button = form.childNodes[3]; const messageContainer = document.querySelector('#messages-container'); const sidebarContainer = document.querySelector('.chat__sidebar'); const changeVideoButton = document.querySelector('#changeVideo'); const syncVideosButton = document.querySelector('#syncVideos'); // TEMPLATES const sidebarTemplate = `

{{room}}

Users

`; const htmlTemplate = [ `

{{user}} {{createdAt}}

{{string}}

`, `

{{user}} {{createdAt}}

Link

`, `

{{string}}

`, ]; let message = ''; let videoId = ''; // YT PLAYER LOGIC // Load the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = 'https://www.youtube.com/player_api'; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // Replace the 'ytplayer' element with an