google-photos icon indicating copy to clipboard operation
google-photos copied to clipboard

Expired baseUrl

Open masterhui opened this issue 5 years ago • 3 comments

Hi there, I really like your photo-frame-sample application, but I'm having the following issue, hoping you can help:

When running a slide show on a large album, the baseUrl to the image expires after 60 seconds. My custom built photo frame running the photo-frame-sample app then displays an error when fancybox tries to load the next image of the slide show. Can you think of a fix that would allow running the slideshow for durations >60 minutes?

Somehow the link that wraps the image needs to point to a ressource that retrieves a valid baseUrl during runtime of the slideshow. Could we call mediaItems.get using the mediaItemId to dynamically obtain a vailid baseUrl when fancybox tries to access an image?

Regards

masterhui avatar Oct 25 '18 21:10 masterhui

Yes, the way to handle this would be to re-request base URLs for all media items that are currently in the queue. (This would be a call to mediaItems.get. There would need to be some additional logic to handle the timeout and automatically refresh the items as they are expiring.

I'll mark this one as a feature request, but I'm not sure if that's something we can update in the very near future. For now, reloading the app itself also triggers a reload of all media items and base URLs.

jfschmakeit avatar Oct 25 '18 23:10 jfschmakeit

Thanks for your reply Jan, refershing the baseUrls of the whole queue sounds like a good idea i have not thought of yet. I think I might give it a try to implement a timed baseUrl refresh mechanism myself. I'll let you know how it goes :-)

masterhui avatar Oct 26 '18 16:10 masterhui

This is making me feel a little dumb! I don't see a mediaItems.get method - is that something intrinsic to mediaItems, or is it a method I need to create? Any samples of how to put this together?

bulldoguk avatar Nov 09 '19 02:11 bulldoguk