Pointers to Quicktime videos in Revlets
Sarah Reichelt
sarah.reichelt at gmail.com
Sat Dec 26 19:16:02 EST 2009
On Sat, Dec 26, 2009 at 4:45 PM, J. Landman Gay
<jacque at hyperactivesw.com> wrote:
> Sarah Reichelt wrote:
>
>> Is there a way for the revlet to know where it is?
>> I would prefer not to have to hard-wire the path, so that the revlet
>> would work no matter where it was moved to, assuming that the media
>> files were kept in the same relative location.
>
> The revlet thinks it's on the user's machine, so you need some kind of link
> back to your server. If you're putting the revlet on your on-rev site, then
> you could probably get the server variables to see what the REQUEST_URI is
> and get the page name from that.
I wanted a general way to do this, that did not rely on the page being
hosted by On-Rev, so I worked out how to do this using PHP as well as
On-Rev.
You can check out the On-Rev version at
<http://www.troz.net/rev/revweb.irev?revlet=System>.
I edited the html produced by the standalone builder and added this line:
pageLocation="<?rev put $_SERVER["SERVER_NAME"] & $_SERVER["REQUEST_URI"]; ?>"
This was inserted into the <embed> tag, on the line just after the instanceID.
In the revlet, I used this script to read the parameter:
put the revletParams of this stack into tParams
put tParams["pageLocation"] into tPageLocation
Then I was able to format the string the way I wanted. It includes the
page name at this stage e.g. "www.troz.net/rev/revweb.irev"
so I set the itemDelimiter to slash, removed the last item, added the
"http://" and then I was left with the containing folder.
For the PHP equivalent, you will need to change the file extension of
the html file to ".php" and instead of the irev line above, use this:
pageLocation="<?php echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; ?>"
This gives exactly the same data in exactly the same format, so the
processing can be the same.
So now I have a way to include media in a revlet, using relative addressing :-)
Cheers,
Sarah
More information about the use-livecode
mailing list