this.$overlayClose = $('#overlayClose');
this.$overlayLoader = $('#overlayLoader');
+ this.player = null;
+ this.type = null;
+
//
// Init
//
that.$overlayContent.load(url, function() {
if($('video', that.$overlay).length > 0) {
- var player = new Video(that.$overlay);
+ that.player = new Video(that.$overlay);
+ that.type = 'video';
} else {
- var player = new Audio(that.$overlay);
+ that.player = new Audio(that.$overlay);
+ that.type = 'audio';
}
setTimeout(function() {
- player.play();
+ that.player.play();
that.$overlayLoader.hide();
that.$overlayContent.addClass('loaded');
}, 2000);
that.$overlayContent.removeClass('loaded');
setTimeout(function() {
+ if(that.type == 'video') {
+ that.player.player.dispose();
+ } else {
+
+ }
that.$overlayContent.html('');
that.$overlay.removeClass('open');
}, 1000);