File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed
_includes/landing-page/yt-player Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
< div class ="yt-player-container ">
2
2
< div class ="yt-player-iframe-wrapper ">
3
- < video id ="sample-video " muted loop autoplay poster ="{{ site.baseurl }}/images/openfaas/yt-cover.png ">
3
+ < a href ="https://www.youtube.com/watch?v=ZnZJXI377ak ">
4
+ < video id ="sample-video " muted loop autoplay poster ="{{ site.baseurl }}/images/openfaas/yt-cover.jpg ">
4
5
< source src ="{{ site.baseurl }}/videos/landing-video.mp4 " type ="video/mp4 ">
5
6
</ video >
7
+ </ a >
6
8
< div id ="yt-player-play "> </ div >
7
9
< div id ="yt-player-iframe "> </ div >
8
10
</ div >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function initNavToggler() {
56
56
/*------------Init youtube player modal-------------*/
57
57
/*--------------------------------------------------*/
58
58
59
- var videoId = 'LQa8-JvIeWA ' ;
59
+ var videoId = 'ZnZJXI377ak ' ;
60
60
function initVideoModal ( ) {
61
61
var triggers = document . querySelectorAll ( '.start-demo-video' ) ;
62
62
@@ -109,7 +109,7 @@ function initVideoModal() {
109
109
110
110
function onYouTubeIframeAPIReady ( ) {
111
111
if ( document . body . className === 'landing-page' ) {
112
- landingPlayer = new YT . Player ( 'yt-player-iframe' , {
112
+ document . landingPlayer = new YT . Player ( 'yt-player-iframe' , {
113
113
videoId : videoId ,
114
114
playerVars : { 'autoplay' : 0 , 'controls' : 1 } ,
115
115
events : {
@@ -141,7 +141,6 @@ function initYoutubePlayerApi() {
141
141
firstScriptTag . parentNode . insertBefore ( tag , firstScriptTag ) ;
142
142
}
143
143
144
-
145
144
/*------------Init scripts on pageload--------------*/
146
145
/*--------------------------------------------------*/
147
146
document . addEventListener ( 'DOMContentLoaded' , function ( ) {
Original file line number Diff line number Diff line change 1
1
/*--------------Initialize youtube api--------------*/
2
2
/*--------------------------------------------------*/
3
3
4
- var videoId = 'LQa8-JvIeWA ' ;
4
+ var videoId = 'ZnZJXI377ak ' ;
5
5
var playerControl = document . getElementById ( 'yt-player-play' ) ;
6
6
var sampleVideo = document . getElementById ( 'sample-video' ) ;
7
7
var play = null ;
@@ -10,15 +10,17 @@ var stop = null;
10
10
// landingPlayer is initialized in main.js and set as global variable
11
11
12
12
function onPlayerReady ( event ) {
13
- console . log ( 'here ' )
13
+ console . log ( 'Video player ready ' )
14
14
event . target . playVideo ( ) ;
15
15
}
16
16
17
17
function playVideo ( ) {
18
- landingPlayer . playVideo ( ) ;
19
- landingPlayer . f . classList . add ( 'playing' ) ;
20
- sampleVideo . classList . add ( 'is-hidden' ) ;
21
- playerControl . classList . add ( 'is-hidden' ) ;
18
+ if ( document . landingPlayer ) {
19
+ document . landingPlayer . playVideo ( ) ;
20
+ document . landingPlayer . f . classList . add ( 'playing' ) ;
21
+ sampleVideo . classList . add ( 'is-hidden' ) ;
22
+ playerControl . classList . add ( 'is-hidden' ) ;
23
+ }
22
24
}
23
25
24
26
function initYoutubePlayer ( ) {
You can’t perform that action at this time.
0 commit comments