From 879a6505eead2b4d32c49c3ecf0a668d6eafec36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Tue, 14 Feb 2017 09:49:31 +0100 Subject: [PATCH] Autoplay video when overlay opens --- app/static/src/js/index.js | 2 ++ app/static/src/js/modules/instagram.js | 19 +++++++++++++++++++ app/static/src/js/modules/video-overlay.js | 3 ++- app/static/src/js/modules/video.js | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 app/static/src/js/modules/instagram.js diff --git a/app/static/src/js/index.js b/app/static/src/js/index.js index bedd48d8..c9be516d 100644 --- a/app/static/src/js/index.js +++ b/app/static/src/js/index.js @@ -19,6 +19,7 @@ var HomeMenu = require('./modules/home-menu'); var Audio = require('./modules/audio'); var Video = require('./modules/video'); var VideoOverlay = require('./modules/video-overlay'); +var Instagram = require('./modules/instagram'); // // Init all the modules @@ -41,3 +42,4 @@ window[HomeMenu] = new HomeMenu(); window[Audio] = new Audio(); window['Video'] = new Video(); window[VideoOverlay] = new VideoOverlay(); +window[Instagram] = new Instagram(); diff --git a/app/static/src/js/modules/instagram.js b/app/static/src/js/modules/instagram.js new file mode 100644 index 00000000..f261edc4 --- /dev/null +++ b/app/static/src/js/modules/instagram.js @@ -0,0 +1,19 @@ +var Instagram = function() { + + this.feed = null; + + // + // Init + // + this.init(); + +}; + +Instagram.prototype.init = function() { + + var that = this; + + +}; + +module.exports = Instagram; diff --git a/app/static/src/js/modules/video-overlay.js b/app/static/src/js/modules/video-overlay.js index ab99782d..a95a52fd 100644 --- a/app/static/src/js/modules/video-overlay.js +++ b/app/static/src/js/modules/video-overlay.js @@ -55,8 +55,9 @@ VideoOverlay.prototype.openOverlay = function(url) { that.$overlayContent.load(url, function() { - window['Video'].init(); + var player = window['Video'].init(); setTimeout(function() { + player.play(); that.$overlayLoader.hide(); that.$overlayContent.addClass('loaded'); }, 2000); diff --git a/app/static/src/js/modules/video.js b/app/static/src/js/modules/video.js index 4238d58d..a2fc4438 100644 --- a/app/static/src/js/modules/video.js +++ b/app/static/src/js/modules/video.js @@ -56,9 +56,9 @@ Video.prototype.init = function() { }); }); - console.log(playlist); that.player.playlist(playlist); + return that.player; }; -- 2.39.5