From 2255713e6912e114702ff77c137f5628f17a2b17 Mon Sep 17 00:00:00 2001 From: himanshuc3 Date: Sun, 4 Mar 2018 09:20:23 +0530 Subject: [PATCH 1/4] fixes #68 --- js/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 8fb49e0..715fc33 100644 --- a/js/main.js +++ b/js/main.js @@ -38,6 +38,7 @@ var main = { // Pause if(keypress == "p"){ + console.log(keypress); if (script.popcorn.paused()) script.popcorn.play(); else @@ -54,9 +55,14 @@ var main = { if (!script.popcorn.paused()) script.popcorn.pause(); script.popcorn.currentTime( script.popcorn.currentTime() - (1.0/30.0)); console.log( script.popcorn.currentTime()); - } + } + + if(e.which == 13){ + main.playVideo(); + $("#begin").button('loading'); + } - }); + }); } // Buttons From be88aa630a24dce72f5c60401028fdb202714fb6 Mon Sep 17 00:00:00 2001 From: himanshuc3 Date: Sun, 4 Mar 2018 09:22:04 +0530 Subject: [PATCH 2/4] fixes #68 --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 715fc33..39b67d4 100644 --- a/js/main.js +++ b/js/main.js @@ -61,7 +61,7 @@ var main = { main.playVideo(); $("#begin").button('loading'); } - + }); } From 93939107002c75e1dd2ae8777fa477d99b079cf1 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Sun, 4 Mar 2018 09:23:24 +0530 Subject: [PATCH 3/4] Update main.js --- js/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 39b67d4..f43d35a 100644 --- a/js/main.js +++ b/js/main.js @@ -38,7 +38,6 @@ var main = { // Pause if(keypress == "p"){ - console.log(keypress); if (script.popcorn.paused()) script.popcorn.play(); else @@ -197,4 +196,4 @@ var main = { $('#main').css('transform', transform); } -} \ No newline at end of file +} From 1040cab9669bc9ad636752a86ab99264f6531e71 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Thu, 29 Mar 2018 09:13:12 +0530 Subject: [PATCH 4/4] Update main.js --- js/main.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/js/main.js b/js/main.js index f43d35a..b037473 100644 --- a/js/main.js +++ b/js/main.js @@ -1,7 +1,20 @@ +//ENTER to start video. +$('body').keypress(function(e){ + + //if enter key pressed and still on welcome screen. + if(e.which == 13 && !main.isPlaying){ + $("#begin").button('loading'); + main.playVideo(); + main.isPlaying = true; + } +}); + + var main = { sketch: null, scaleFactor: 1.0, debug: false, + isPlaying: false, // Initalize Demo @@ -34,10 +47,11 @@ var main = { $('body').keypress(function(e){ var keypress = String.fromCharCode(e.which); - + console.log(keypress); // Pause if(keypress == "p"){ + console.log(keypress); if (script.popcorn.paused()) script.popcorn.play(); else @@ -56,10 +70,6 @@ var main = { console.log( script.popcorn.currentTime()); } - if(e.which == 13){ - main.playVideo(); - $("#begin").button('loading'); - } }); }