Page 1 of 1

Displaying an image in a thread

Posted: Tue Mar 15, 2011 3:30 pm
by pony
Complete newbie first time RenRev user.

I am evaluating RunRev as a replacement to RealStudio - My Real Studio Enterprise license expires in April this year. A huge advantage of RunRev is it builds for iOS.
Anyway, on to my problem.

I have a MPEG stream being served over HTTP from an application I wrote in Real Studio; I can switch the stream through various network cameras by sending a HTTP POST command to my application. I can hit the server with my web browser and all works well. I wanted to use RunRev to write a simple iOS app to display the stream, and on pressing a button change the stream by sending my server the necessary HTTP Post request.
If I have my button script tot:

Code: Select all

on mouseUp
   set the filename of image 1 to "<URL of static image>"
end mouseUp
it works


if I use

Code: Select all

on mouseUp
   set the filename of image 1 to "<URL of stream>"
end mouseUp
then the app hangs. I'm presuming becaue the image never finishes loading (its a stream).

Any ideas how to show my stream and still have GUI control?

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 4:03 pm
by Klaus
Hi pony,

well, an image is an image*** but a stream is more of a video, right?
So setting the filename of an image to a VIDEO url will surely not work.
*** You can use GIF, JPG, PNG (and BMP on windows) files for this and nothing else!

You could try to:
...
play video "<URL of stream>"
...
But I am not sure if this will work.


Best

Klaus

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 4:27 pm
by pony
yeah that didn't work.

Any idea how to display a MPEG stream in RunRev, or is this just not possible?

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 5:02 pm
by Klaus
Hi pony,

LiveCode relies on QuickTIme to display video of all kind on the desktop.
This way one could add plug-ins like PERIAN (Mac Only!) to extend the
playable codecs of QuickTIme.

But I am afraid that you can only take what iOS gives to you, and obviously
MPEG streams are not part of it.

With the upcoming version 4.6, LiveCode will support externals on iOS,
so maybe this could be done with an external?

I have no idea however...


Best

Klaus

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 6:09 pm
by pony
On my iPhone using WebKit (Safari) I am able to view the video stream. Is it not possible to embed an HTML view in to a window (I'm thinking how UIWebView Class in XCode, and HTMLViewer Class in Real Studio, work)?

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 7:43 pm
by Klaus
Hi pony,

ah, hm, yes, sure, well, in that case you can use a UIWebView control (browser) in LiveCode on iOS :D
Looks like I didn't quite understand at first...


Best from germany

Klaus

Re: Displaying an image in a thread

Posted: Tue Mar 15, 2011 8:20 pm
by pony
EDIT:
Found the Mobile Browser Example that appears to contain all I need to make this work.

Re: Displaying an image in a thread

Posted: Wed Mar 16, 2011 2:24 pm
by pony
I'm not sure what the 'browser' object is and how I would add another. I'm able to use the example, but would like to know how I go about adding my own in future.

Re: Displaying an image in a thread

Posted: Wed Mar 16, 2011 3:39 pm
by Klaus
Hi pony,

check the iOS release notes, which seem to be the only docs for iOS right now!
In LiveCode go menu: Help -> iOS Release Notes


Best

Klaus