Displaying an image in a thread

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Displaying an image in a thread

Post by pony » Tue Mar 15, 2011 3:30 pm

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?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Displaying an image in a thread

Post by Klaus » Tue Mar 15, 2011 4:03 pm

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

pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Re: Displaying an image in a thread

Post by pony » Tue Mar 15, 2011 4:27 pm

yeah that didn't work.

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

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Displaying an image in a thread

Post by Klaus » Tue Mar 15, 2011 5:02 pm

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

pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Re: Displaying an image in a thread

Post by pony » Tue Mar 15, 2011 6:09 pm

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)?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Displaying an image in a thread

Post by Klaus » Tue Mar 15, 2011 7:43 pm

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

pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Re: Displaying an image in a thread

Post by pony » Tue Mar 15, 2011 8:20 pm

EDIT:
Found the Mobile Browser Example that appears to contain all I need to make this work.

pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Re: Displaying an image in a thread

Post by pony » Wed Mar 16, 2011 2:24 pm

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.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Displaying an image in a thread

Post by Klaus » Wed Mar 16, 2011 3:39 pm

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

Post Reply