Browse Source

theme photoswipe: pause video when closed moved to another item

pull/398/head
Lukas Vacek 6 years ago
parent
commit
ad3d44fcea
  1. 15
      sigal/themes/photoswipe/static/photoswipe.js
  2. 242
      sigal/themes/photoswipe/static/photoswipe.min.js

15
sigal/themes/photoswipe/static/photoswipe.js

@ -990,6 +990,8 @@ var publicMethods = {
_shout('close');
_unbindEvents();
self.pauseVideo();
_showOrHide(self.currItem, null, true, self.destroy);
},
@ -1059,6 +1061,9 @@ var publicMethods = {
index = _getLoopedId(index);
var diff = index - _currentItemIndex;
if (diff != 0) {
self.pauseVideo();
}
_indexDiff = diff;
_currentItemIndex = index;
@ -1335,8 +1340,14 @@ var publicMethods = {
} else {
onUpdate(1);
}
}
},
pauseVideo: function() {
var videos = document.getElementsByTagName("video");
for (var i = 0; i < videos.length; i+=1) {
videos[i].pause();
}
}
};
@ -3731,4 +3742,4 @@ _registerModule('History', {
/*>>history*/
framework.extend(self, publicMethods); };
return PhotoSwipe;
});
});

242
sigal/themes/photoswipe/static/photoswipe.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save