codecomputerlove/PhotoSwipe — Issue #207: Can you show anything on top of Photoswipe?
Author: mikegartner
Created: 2011-12-02 02:31:47+00:00
State: open

I want to play a video. I am taking your suggestion to look for touch events on the stills to trigger a video, but I can't get it to display on top of Photoswipe no matter what z-index I set my content to be. I am trying 2 methods, the first using js to trigger the video already in the DOM which I figure won't work since PS hides the original content, and the 2nd, appending a div with video to the DOM on the touch event. If I click around using the 2nd method, I know the video is there because I can hear it playing, but I can't see it. Code for the 2nd method is below. I'm appending to the toolbar as a test which isn't what I want, but I couldn't find another node to append it to.

//onTouch
currentInstance.addEventHandler(PhotoSwipe.EventTypes.onTouch, function(e){

if (e.action === 'tap'){
var html = "

";
html += '';
html += '';
html += '

';
$(".ps-toolbar").append(html);

$('#someVideo').attr('src', "myvid.mp4");
$('#someVideo')[0].load();

}
});