Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Video link metadata files #51

Open
Alyosha47 opened this issue Sep 23, 2021 · 7 comments
Open

[Feature request] Video link metadata files #51

Alyosha47 opened this issue Sep 23, 2021 · 7 comments

Comments

@Alyosha47
Copy link

This is a very clean and amazing plug-in, but it misses one feature that really makes nanoGallery very special, which is its video-embedding capability.

When this plugin scrapes the folders for images and metadata files, could it not also find metadata files for embedded video, and then include these video links in the object list it passes to the gallery engine?

Thanks!

@lenoba
Copy link

lenoba commented Oct 15, 2021

I agree, having videos would be great.
I wonder where the limitation is that it isnt already implemented, as the nanogallery2 supports videos. Even for youtube/vimeo/etc, you could make simple <title>.youtube files where the whole content would be the youtube link for example and then display that.

If this isnt being worked in, please at least point me in the direction of where i should start hacking it in, so that i can ease the work of others :)

@Alyosha47
Copy link
Author

It looks like it's in the nano_photos_provider2.json.class.php file...

at line 159, it checks to see if the current JSON file stored in the cache folder is up to date.

and if it isn't, at 218-270 the code combs through the folder system and creates a new JSON file from all the images it can find there.

What I imagine would be that it could recognize a video data filetype, with filenames sorted and organized just like they are already for the images, and where the video data is included in the content of that file. the code could then add the video information into the JSON file just like the protocol in https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript . It handles multiple filetypes already, so hopefully including non-image metadata files for videos should be pretty straightforward

@lenoba
Copy link

lenoba commented Oct 18, 2021

Tried mucking about the .class file, and i think i got the videos recognised as a meta and everything. But ithink the problem is in the nanogallery.js, since it looks like it ignores video kinds when its using nanoprovider.

Since im not gonna go fiddle with nanogallery as well, i promptly gave up on it and came up with a barbaric solution that works.

Made a php script that gets the json from manually running nanoprovider, on the albums and subalbums, and also checks for my video.yt files ( where the whole content is a youtube link ). It then parses that json and outputs it as a general html usage of nanogallery.

sure, i have to manually run the php script everytime i add new albums/pics, but it has the benefit of getting all the thumbnails and other features of the nanoprovider... and videos work as they should.

I can provide the script if you want, it was easy to make.

@Alyosha47
Copy link
Author

that is an interesting approach.

as I understand it, the nanoprovider code does the work of creating a json object, which it stores in /_thumbnails/cache.json ... and then nanogallery reads it, unserializes it, and it works.

I'm curious, since you were able to get the nanoprovider code to find your video metadata files, why, if that information were included into the cache.json file acording to the spec at https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript, nanogallery it wouldn't be able to use it.

I am def interested in the code you came up with as well, thanks for working towards a solution!

@lenoba
Copy link

lenoba commented Oct 19, 2021

The cache.json did include the youtube links, had thumbnails, src, its kind was set to video, ...it just didnt show up in the gallery, like nanogallery was ignoring it.. thats why i gave up on that approach, and this current one is easier.

https://pics.lenoba.net/generate.php.source

and you can see the gallery in action at https://pics.lenoba.net , if you want to see videos as well, the latest album "2021-10-17 Rogla" has 3 videos inside.

@Alyosha47
Copy link
Author

Thanks for the code! I'm still curious though: did you try plugging the video-including cache.json file generated by your earlier efforts straight into a nanogallery page without nanoprovider, just to see if, in the absence of nanoprovider, it works?

If not, that might be worth a shot... if it does work, then we could use nanoprovider to generate the json info, including video, for nanogallery to call. similar to the standalone run-it-when-you-update solution you've got, but perhaps with all the features that nanoprovider offers included.

@marcza71
Copy link

Good day. I found this post about adding a movie in nano_photos_provider2. I have a huge request to share this script. If so, I send an e-mail: [email protected]. Thank you in advance and best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants