Rev Player?

Richard Gaskin ambassador at fourthworld.com
Tue Jul 14 14:45:31 EDT 2009


James Hurley wrote:

 > Richard wrote:
 >>
 >> I believe RunRev still makes a Player, so there should be one
 >> available for the latest engine version.
 >>
 >> But if you're using Studio or Enterprise it's only a few minutes'
 >> work to make your own, allowing you to tailor the user experience
 >> and branding for your specific audience while retaining all the
 >> conveniences of being able to deliver tiny stack files.
 >
 > Richard,
 >
 > This sound intriguing, but I wouldn't know where to begin. How about a
 > hint?

At the heart of it is the popular syntax for downloading and opening a 
stack which Rev provides in one simple line:

    go url <url>

e.g.:

   go url "http://www.fourthworld.net/channels/Revel.rev"

Just include the Internet library when building a standalone, and any 
standalone can do that.

And of course standalones can open stack files locally too, so a custom 
"player" can run files from anywhere and provide a convenient offline 
mode if desired.

Stack files can be pretty small, but with Rev's built-in compress and 
decompress functions you can make them even smaller.  Just run them 
through compress before uploading them to your server like this:

   put compress( url "binfile:/hd/folder/stack.rev" ) \
     into url "ftp://user|password@ftp.domain.com/stack.rev.gz"

...and then your standalone can decompress them on the fly with:

   go decompress( url "http://domain.com/stack.rev.gz")

The compress/decompress functions use the gzip algorithm, which is very 
efficient for textual patterns like scripts, so it's not uncommon to see 
compressed stacks save between 30% and 50% in size, sometimes more.

On the user interface side, like everything else in Rev the sky's the 
limit.  You could, for example, provide a sort of "Library" window which 
presents a list of stacks already downloaded and new ones available on 
the server, letting the user download those to a local "cache" folder 
you can maintain locally.

If you don't want to bother your user with keeping track of their stack 
files you can store them all in one place and provide a UI to list and 
open them.  Good places to store such a cache of stack files are the 
Application Data folder -- specialFolderPath("26") -- on Win or the 
Application Support folder -- specialFolderPath("asup") -- on Mac.  See 
Ken Ray's site for a complete listing of codes supported by Rev's 
specialFolderPath function:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

Managing the list of available files can be done easily by just posting 
a small text file to your server which contains info about the stacks 
there.  If the file is tab-delimited you can just drop it into a list 
field for display without modification.  At a minimum this file could 
have fields for the stack name, a brief description, and the url, but of 
course you can add any other info that would be useful for your app.

All this is fun, but then consider what you can do by tossing the Rev 
CGI into the mix.  You can build forms in stacks used by your standalone 
which use the post command to send data to a CGI, where the data can use 
your mail server to send you mail, or log posts to a message board, or 
submit test results for courseware for instructor review, or anything 
else you can dream up.

While you're at it you can make whatever tools you need to manage all 
this in just a few minutes in Rev, such as tools for compressing and 
uploading your stacks and updating your stack info list file.

Various forms of all this are used by RevNet, included in the Rev 
install - in Rev, see Development->Plugins->GoRevNet

On my ever-growing To Do list is turning RevNet into a more flexible 
library for broader use across multiple stack-sharing apps, but if you 
can make sense of the code in RevNet you're welcome to borrow from it if 
it's helpful.

These two examples of distributed stackware are also worth looking at, 
inspiring real-world uses of "go url":

The Reactor Lab
<http://www.revjournal.com/features/reactorlab.html>

Dynamic Digital Maps
<http://ddm.geo.umass.edu/>


IMO, sharing stacks over the Internet within standalones is one of the 
most underutilized capabilities of Rev.  There's a bit of irony with 
that as well, given that we've had this capability for more than a 
decade with Rev and Rev makes it so easy to do.

The new Rev web plugin is way cool and there are a great many uses for 
it, but there's also a universe of opportunities for delivering stacks 
and other media with all the benefits of Internet connectivity in an 
application environment dedicated for specific tasks.

If Web 2.0 is Google Maps, perhaps Web 3.0 is Google Earth.

With OS X's Widgets and Vista's Gadgets, older technologies like Rebol 
and new ones like Adobe AIR, there seems to be an infinite variety of 
ways one can use the Internet in specialized applications.

With all the talk about The End of the Desktop, people sometimes forget 
that the Desktop is where the Browser lives too. :)

<http://www.fourthworld.com/embassy/articles/netapps.html>

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com



More information about the use-livecode mailing list