koken-plugin-photoswipe
koken-plugin-photoswipe copied to clipboard
add video support
sorry .. wifi is not the best here in south east asia..
I'd like to keep this as a track to add video option to the plugin. And probably extend the plugin when there is a native option.
See https://github.com/dimsemenov/PhotoSwipe/issues/651
Please see my first (poor) attempt at getting videos working within the plugin.
Two big issues right now:
- videoHolder ist not scaling to the current thumbnail
- The url to the original content (mp4 file) is not within the gallery object of the photoswipe instance
https://github.com/georg90/koken-plugin-photoswipe/commit/d36c53ce64e82c78978052f07215d3552ee0d542
any help is greatly appreciated!
Hi, to understand your problem i need a working example with video support. the filenames of the videothumbnails must contain a substring 'video'.
Thanks for your thoughts.
The thumbnails have the "video" substring - the script is getting executed. The problem is more related to the implementation within the koken-plugin. Since koken pre caches different sizes for each image, you'll need the "original" url for the video file (not one of the different sizes). But I cannot find the path within the gallery object. I think @DanielMuller needs to step in to solve this one.
As I'm on the go I can't really give you any working example :-/
PS: The first problem persists also in your implementation (the bike tour). The videofile is small, so you can click left and right of the image and you only notice it on mobile devices. But if the image is 4000x4000px (the size is used for the videoHolder class). This way it blocks the left/right arrows of photoswipe and also you can't go "back" except with the hotkeys. Here we need some CSS tweaks..
sorry, I somehow missed this thread. I never used videos with Koken, so I never bothered to try to have them work. I did a quick inspect on the source html, there is no proper way to find a video, except that the alt tag ends with .mp4 and not .jpg
It would be more elegant to have Photoswipe handle videos natively instead of trying to add a video container on the fly. But as Dimitri states in his documentation, using Video is not recommended. Using a modal could be a light way to start.
I spoke too quickly in my previous comment. ALT tag is just the title, it doesn't give any information on content-type. Without any information on content-type or url to source file in the album DOM, it's impossible to start building something to display a video in Photoswipe. Your alternative here, would be to create a custom theme and adapt the plugin for your custom theme. But this doesn't scale well.