Asynch work: loading movie from file example...
andre at andregarzia.com
Thu Dec 20 10:23:12 EST 2007
Rev is single threaded so when you issue blocking commands, the UI
will block and there's nothing you can do. What you can do is code
around blocking commands. For tcp/ip communications you have both
blocking commands and async commands. Now when the problem is with the
player object things get ugly since you don't have async commands for
that. Rev will block while loading the movie.
I have a solution for you but I believe you won't like it. I've
implemented this with success in the Hinduism Today Digital Edition
magazine ( http://www.hinduismtoday.com/digital ). Our magazine has a
built-in media viewer that plays videos, audio and slideshows. We
encountered a lot of trouble with the different media files and Rev QT
player. Files that would play normally in QT Player would not play in
Rev's own QT player wrapper. We took a bold move to solve this and it
is working like a charm.
What we have now is a fake RevBrowser window as the player object.
RevBrowser windows run on their own thread so they won't block the UI
and QT player on a browser behaves better than qt player on rev. We
assemble a QT embeded object in a string and set the htmltext of the
revbrowser to it, so you don't need to be connected to the internet.
All happens in memory, a temporary HTML that is loaded on the browser
that holds reference to the movie file and player. The user never sees
the difference and we can now play lots of movies and multimedia
All our movies are on the server, so to use our system, you need to be
connected but this solution also applies to non-connected apps. This
is also a good way to load flash movies and the like.
I think it may be overkill to your project, but thats how we solved
our UI trouble related to the player.
On 12/20/07, David Bovill <david at openpartnership.net> wrote:
> I'm trying to get to the bottom of how to code asynchronous GUI work in Rev
> - and thought I'd ask for tips. The example to hand is simple a user clicks
> on a line in a field which triggers a script to set the filename of a player
> to a movie file. The problem is that the files are large mp4 files and the
> first time they load they take over a second to show up in the player - in
> the mean time you get a spinning pizza.
> What I would like to do is load the movie asynchronously and allow the user
> to do other stuff in the mean time - no spinning pizza. I chose this example
> as its a built in blocking Rev command - not using shell command or anything
> external. Any thoughts?
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://www.andregarzia.com All We Do Is Code.
More information about the Use-livecode