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 11< div class ="yt-player-container ">
22 < 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 ">
45 < source src ="{{ site.baseurl }}/videos/landing-video.mp4 " type ="video/mp4 ">
56 </ video >
7+ </ a >
68 < div id ="yt-player-play "> </ div >
79 < div id ="yt-player-iframe "> </ div >
810 </ div >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function initNavToggler() {
5656/*------------Init youtube player modal-------------*/
5757/*--------------------------------------------------*/
5858
59- var videoId = 'LQa8-JvIeWA ' ;
59+ var videoId = 'ZnZJXI377ak ' ;
6060function initVideoModal ( ) {
6161 var triggers = document . querySelectorAll ( '.start-demo-video' ) ;
6262
@@ -109,7 +109,7 @@ function initVideoModal() {
109109
110110function onYouTubeIframeAPIReady ( ) {
111111 if ( document . body . className === 'landing-page' ) {
112- landingPlayer = new YT . Player ( 'yt-player-iframe' , {
112+ document . landingPlayer = new YT . Player ( 'yt-player-iframe' , {
113113 videoId : videoId ,
114114 playerVars : { 'autoplay' : 0 , 'controls' : 1 } ,
115115 events : {
@@ -141,7 +141,6 @@ function initYoutubePlayerApi() {
141141 firstScriptTag . parentNode . insertBefore ( tag , firstScriptTag ) ;
142142}
143143
144-
145144/*------------Init scripts on pageload--------------*/
146145/*--------------------------------------------------*/
147146document . addEventListener ( 'DOMContentLoaded' , function ( ) {
Original file line number Diff line number Diff line change 11/*--------------Initialize youtube api--------------*/
22/*--------------------------------------------------*/
33
4- var videoId = 'LQa8-JvIeWA ' ;
4+ var videoId = 'ZnZJXI377ak ' ;
55var playerControl = document . getElementById ( 'yt-player-play' ) ;
66var sampleVideo = document . getElementById ( 'sample-video' ) ;
77var play = null ;
@@ -10,15 +10,17 @@ var stop = null;
1010// landingPlayer is initialized in main.js and set as global variable
1111
1212function onPlayerReady ( event ) {
13- console . log ( 'here ' )
13+ console . log ( 'Video player ready ' )
1414 event . target . playVideo ( ) ;
1515}
1616
1717function 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+ }
2224}
2325
2426function initYoutubePlayer ( ) {
You can’t perform that action at this time.
0 commit comments