Repository navigation
Expand file tree
/
Copy pathvideo.js
More file actions
38 lines (38 loc) · 1.37 KB
/
Copy pathvideo.js
File metadata and controls
38 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('YouTubeBackgroundVideoPlayer', {
videoId: 'fmDps4O7pCw', // YouTube Video ID
width: 1280, // Player width (in px)
height: 720, // Player height (in px)
playerVars: {
playlist: 'fmDps4O7pCw',
autoplay: 1, // Auto-play the video on load
autohide: 1,
disablekb: 1,
controls: 0, // Hide pause/play buttons in player
showinfo: 0, // Hide the video title
modestbranding: 1, // Hide the Youtube Logo
loop: 1, // Run the video in a loop
fs: 0, // Hide the full screen button
autohide: 0, // Hide video controls when playing
rel: 0,
enablejsapi: 1
},
events: {
onReady: function(e) {
e.target.mute();
e.target.setPlaybackQuality('hd1080');
},
onStateChange: function(e) {
if(e && e.data === 1){
var videoHolder = document.getElementById('home-banner-box');
if(videoHolder && videoHolder.id){
videoHolder.classList.remove('loading');
}
}else if(e && e.data === 0){
e.target.playVideo()
}
}
}
});
}