Path to poster image incorrect

Page: 1

Author Post
Member
Registered: Oct 2017
Posts: 38
First, let me say that what does work properly is planting a poster image in the same directory as the video, with the same base name as the video, which is what one would normally do (and what I'll be doing in my application).

But if you use a query string with a relative URL, Floatbox appears to be looking for the poster image in the wrong directory. It constructs the URL relative to the calling script, rather than relative to the calling page. In this demo, for example, I believe it's looking for the poster image at floatbox/slides/poster.jpg, rather than at slides/poster.jpg.

https://misterneutron.com/posterqstring/
Administrator
Registered: Aug 2008
Posts: 3382
It's not so much constructing the path relative to the script, but rather constructing the path relative to the currently active page (as per spec), which is floatbox/video.html running in an iframe.

I probably won't be bulking things up with code to modify this technically correct behaviour. The demand for such a 'fix' is likely close to zero, the workarounds are simple and obvious, and it's really just another instance of how relative references can cause trouble in cases where the 'relative-to-what' context is ambiguous or fluid.
Member
Registered: Oct 2017
Posts: 38
This is what I call "inside baseball," and I get it. But the src attribute is relative to the calling page, so having the poster attribute relative to another location is just a bit counter-intuitive. The basic <video> tag certainly doesn't behave that way.
Administrator
Registered: Aug 2008
Posts: 3382
I'm not sure about baseball, but the full and complete answer to the issue raised in this thread is "don't use relative paths for the poster". I should probably put that into the docs to make it official.
Member
Registered: Oct 2017
Posts: 38
Yes, it seems to work just fine with an absolute URL: https://misterneutron.com/pq2/.

But that makes for a bit of a site maintenance problem - move the album, and you have to edit the code. Either that, or keep all of your poster images in a fixed location.

In any event, sticking to the "same base name" poster image and avoiding query strings is the real solution. :)

Page: 1