koken-plugin-photoswipe icon indicating copy to clipboard operation
koken-plugin-photoswipe copied to clipboard

add video support

Open georg90 opened this issue 9 years ago • 5 comments

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

georg90 avatar Jan 15 '16 17:01 georg90

Please see my first (poor) attempt at getting videos working within the plugin.

Two big issues right now:

  1. videoHolder ist not scaling to the current thumbnail
  2. 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!

georg90 avatar Jan 28 '16 18:01 georg90

Hi, to understand your problem i need a working example with video support. the filenames of the videothumbnails must contain a substring 'video'.

Radla avatar Feb 14 '16 16:02 Radla

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..

georg90 avatar Feb 19 '16 17:02 georg90

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.

DanielMuller avatar Mar 09 '16 18:03 DanielMuller

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.

DanielMuller avatar Mar 10 '16 13:03 DanielMuller