(function (win) { var ratio = 57; var src = "https://player.streaminghouse.ch/Player/Embed?VideoTokenId=36a54e55-fadf-46f1-a12c-ff99f780b40d"; var scriptTag = document.scripts[document.scripts.length - 1]; var container = document.createElement("div"); var frame = document.createElement("iframe"); function resize() { frame.style.display = 'block'; //frame.style.height = container.clientHeight + 'px'; } //container.style.paddingBottom = ratio + '%'; container.style.height = '100%'; frame.style.border = 'none'; frame.style.width = '100%'; frame.style.height = '100%'; var att = document.createAttribute("allowfullscreen"); frame.setAttributeNode(att); container.appendChild(frame); scriptTag.parentElement.insertBefore(container, scriptTag.nextSibling); frame.setAttribute("src", src); win.addEventListener('resize', resize); win.addEventListener('load', resize); })(window);