A very odd business, this.
I'm updating two pages of a complex (and messy) website. One page is in the English-language half, created by one company. The other's in the Japanese-language half, created by another company. The halves are in subdirectory structures called "ja" and "en" respectively but these structures are asymmetrical: although there's also a single subdirectory called "video" it's one level beyond (is separated by one more "../" from) most Japanese-language pages than it is from their English-language counterparts.
Each of the two pages I'm updating has links to the same pair of videos. In the old pages, the way they're linked is crude. (For this I blame myself, not either of the companies.) I thought that for the revision (with a new pair of videos) I'd use a "lightbox" effect: the visitor clicks on a link and a little window opens in the centre of the page for the video, which starts automatically as the rest of the page is darkened; the visitor then clicks on a link titled "back" within the little window and this window disappears while the original page reappears. This of course requires a pile of Javascript and Flash hocus pocus, about which I am totally ignorant, as well as CSS.
I decided to tackle the English-language page first. Thanks to the combination of (a) Saeid Mohadjer's excellent lightbox example (together with the explanation linked from its foot) and (b) Longtail's JW Player "wizard", it all works.
Here's one vital (and fully working) script within that page:
<script type='text/javascript'>
var so = new SWFObject('../video/player.swf','mpl','480','270','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('duration','136');
so.addVariable('file','../video/pickles.mp4');
so.addVariable('autostart','true');
so.addVariable('type','video');
so.write('mediaspace1');
</script>
So far so good. Now to do a similar revision of the Japanese-language page. This is one level further below, and I therefore copy in the stuff above, adjusting two lines of it so that they read:
var so = new SWFObject('../../video/player.swf','mpl','480','270','9');
so.addVariable('file','../../video/pickles.mp4');
(Note the extra "../".) But now the Flash player can't see (or is denied access to) the MP4 file. The Flash console does open up, but it glumly reports "Video not found or access denied: ../../pickles.mp4".
Note that the SWF and the MP4 files are in the same directory, linked to in the same way.
Wondering whether the SWF file might be cached, I deliberately remove a "../" from the link to it. It no longer works, meaning that it really is being linked to successfully.
I then make a copy of the MP4 file in the very same directory, writing
so.addVariable('file','pickles.mp4');
The result works perfectly.
So it's almost as if there's a file directory syntax oddity here: "../../" works for SWF but not for MP4. But this is nuts: directory navigation is "filename agnostic".
A simple kludge would be to duplicate the two MP4 files. After all, hard drive space costs nothing. (I even have a laptop with a half-terabyte drive. Crazy.) But this is aesthetically most displeasing, and while I'm happy to know nothing about Javascript and Flash, I do like to think I understand what "../" means.
Ideas?
