From: Jérémy Fabre Date: Tue, 14 Feb 2017 08:49:31 +0000 (+0100) Subject: Autoplay video when overlay opens X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=879a6505eead2b4d32c49c3ecf0a668d6eafec36;p=mezzo.git Autoplay video when overlay opens --- 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; };