2024-02-06 20:05:17 +01:00
|
|
|
<!DOCTYPE html><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
.container {
|
|
|
|
position: relative;
|
2024-03-18 17:09:08 +01:00
|
|
|
overflow: hidden;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
2024-02-06 20:05:17 +01:00
|
|
|
}
|
|
|
|
.video {
|
|
|
|
position: absolute;
|
2024-03-18 17:09:08 +01:00
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
2024-02-06 20:05:17 +01:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<div class="container"><div class="video" id="player"></div></div>
|
|
|
|
<script>
|
|
|
|
const url = new URL(window.location)
|
|
|
|
const viewport = document.querySelector("meta[name=viewport]")
|
|
|
|
|
|
|
|
const tag = document.createElement("script")
|
|
|
|
tag.src = "https://www.youtube.com/iframe_api"
|
|
|
|
const firstScriptTag = document.getElementsByTagName('script')[0];
|
|
|
|
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
|
|
|
|
|
|
|
let player
|
|
|
|
function onYouTubeIframeAPIReady() {
|
|
|
|
player = new YT.Player('player', {
|
|
|
|
width: "1000",
|
|
|
|
height: "1000",
|
|
|
|
videoId: url.searchParams.get('videoId'),
|
|
|
|
playerVars: {
|
|
|
|
autoplay: 1,
|
|
|
|
start: url.searchParams.get('start'),
|
|
|
|
rel: 0,
|
|
|
|
loop: 0,
|
|
|
|
playsinline: 1,
|
|
|
|
origin: url.origin
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function onPlayerReady(event) {
|
|
|
|
event.target.playVideo();
|
|
|
|
}
|
|
|
|
</script>
|