nanostudio-org / nano_photos_provider2

PHP photos provider for nanogallery2
https://nanophotosprovider2.nanostudio.org/
47 stars 12 forks source link

[Feature request] Video link metadata files #51

Open Alyosha47 opened 2 years ago

Alyosha47 commented 2 years ago

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 commented 2 years ago

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 .youtube files where the whole content would be the youtube link for example and then display that. </p> <p>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 :)</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Alyosha47"><img src="https://avatars.githubusercontent.com/u/91294852?v=4" />Alyosha47</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>It looks like it's in the nano_photos_provider2.json.class.php file...</p> <p>at line 159, it checks to see if the current JSON file stored in the cache folder is up to date.</p> <p>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.</p> <p>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 <a href="https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript">https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript</a> . It handles multiple filetypes already, so hopefully including non-image metadata files for videos should be pretty straightforward</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/lenoba"><img src="https://avatars.githubusercontent.com/u/6769070?v=4" />lenoba</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>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.</p> <p>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.</p> <p>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. </p> <p>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.</p> <p>I can provide the script if you want, it was easy to make.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Alyosha47"><img src="https://avatars.githubusercontent.com/u/91294852?v=4" />Alyosha47</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>that is an interesting approach.</p> <p>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.</p> <p>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 <a href="https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript">https://nanogallery2.nanostudio.org/datasource.html#ngy2_define_javascript</a>, nanogallery it wouldn't be able to use it.</p> <p>I am def interested in the code you came up with as well, thanks for working towards a solution!</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/lenoba"><img src="https://avatars.githubusercontent.com/u/6769070?v=4" />lenoba</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>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.</p> <p><a href="https://pics.lenoba.net/generate.php.source">https://pics.lenoba.net/generate.php.source</a></p> <p>and you can see the gallery in action at <a href="https://pics.lenoba.net">https://pics.lenoba.net</a> , if you want to see videos as well, the latest album "2021-10-17 Rogla" has 3 videos inside.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Alyosha47"><img src="https://avatars.githubusercontent.com/u/91294852?v=4" />Alyosha47</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>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?</p> <p>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.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/marcza71"><img src="https://avatars.githubusercontent.com/u/62882776?v=4" />marcza71</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>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: marunia23@wp.pl. Thank you in advance and best regards.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>