content/hifi-content/ozan/dev/anny/scripts/embed_without_audio.html
2022-02-14 02:04:11 +01:00

75 lines
No EOL
2.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
<div id="player"></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
//https://www.youtube.com/embed/9R5JYLtDZhw?rel=0&autoplay=1&loop=1&playlist=9R5JYLtDZhw&controls=0
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: window.innerHeight,
width: window.innerWidth,
videoId: '9R5JYLtDZhw',
playerVars: {
'autoplay': 1,
'controls': 0,
'modestbranding': 1,
'showinfo': 1, // disabling this will make a youtube logo appear, greetings Thoys
'autohide': 1,
'playlist': '9R5JYLtDZhw'
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
window.onresize = function(event) {
if (player) {
player.setSize(window.innerWidth, window.innerHeight);
}
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
event.target.playVideo();
event.target.setLoop(true);
event.target.setVolume(0.0);
}
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event) {
//if (event.data == YT.PlayerState.PLAYING && !done) {
//setTimeout(stopVideo, 6000);
//done = true;
//}
}
function stopVideo() {
//player.stopVideo();
}
</script>
</body>
</html>