revBrowser windowid problems

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

revBrowser windowid problems

Post by sturgis » Sat Feb 06, 2010 6:06 pm

Got a quick question, when starting a revbrowser instance, the windowid is supplied so that it knows where to put itself. Things like maximizing, changing the decorations etc change the window id so revbrowser stops showing. Is there a way to update the current windowid associated with a specific instance? The only alternative is shut the instance down and reopen it which requires a reload of url. While in most cases this isn't a huge issue, when building a client for an online tv service (which is what i'm doing) this isn't good.

Admittedly I could do all this by eliminating all decorations, setting up my own controls to do whats needed (hide decorations, set the rect to the screen rect) as suggested in another topic where I asked this similarly, but it would be SO much easier if I could just point the revbrowser instance at the new window id. IS this possible?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowser windowid problems

Post by Mark » Tue Mar 02, 2010 5:52 pm

Sturgis,

Why do you need to change the decorations for a window? Once a window has decorations, there isn't really a reason to change them. Use them, don't change them. Changing such things is as if you tell the user that you changed your mind on the interface design, while the user is already working with your software.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: revBrowser windowid problems

Post by sturgis » Tue Mar 02, 2010 10:34 pm

Setting fullscreen changes the windowID also, so for a web browser video player, every time you "set the fullscreeen of" the windowid changes and the browser goes blooey.

I understand that its possible to build my own controls and when going into fullscreen mode, hide them while setting the stack size etc, but this isn't really a "fullscreen" solution. I had asked this particular version of the question while trying to implement a version that does as described IE hide the window controls and set the rect of the stack to the screen rect, but again this isn't a "fullscreen." On a mac, the doc and menubar are there to detract from the video viewing experience.

Even if I were to do the self made controls on a stack with no window decorations, the dock and menubar being there makes it kinda poinltles. Might as well leave the controls, let em maximize the window and give up on the idea of a fullscreen. Especially considering my horrible design skills *grin* Would be SO much nicer to use the built in look and feel of the OS to accomplish this.

I guess the best option would be to have a "fullscreen only" app, but then for people like me who need to do other things while watching on and off it becomes problematic. Can't leave fullscreen, check IMS and email, then fullscreen again using revbrowser the way it sits due to the windowID change. So I guess the real best option is scrap the idea of using revbrowser for everything except my web scraping, and use firefox/safari/whatever for the video itself, in which case my question mutates into "Is there any way to launch a url and specify a specific tab/window instance of a browser from within rev?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowser windowid problems

Post by Mark » Tue Mar 02, 2010 10:51 pm

Hi Sturgis,

Normally, you'd set fullscreen if you want to make a kiosk application or similar. It is an interface decision, which you do only once. If you don't want to make a real full-screen application, you'd set the rect of your window to the rect of your screen. It is all about interface design.

I don't deny that it would be much easier for us if the WindowID wouldn't change, but if you'd make your app in Visual Studio or XCode, you'd still run into these problems, because it is assumed that you make your interface design before using the app and not during using the app.

There is an external (LibKiosk) to hide the dock and you can easily hide the menubar. Have you considered using a backdrop instead of a "fullscreen" mode?

If your app isn't an internet application, I woudn't add internet features. Just make clear choices about what your app is supposed to do and whether or not one should be able to access other programmes while using yours (it is almost always unacceptable to take over someone's screen, unless you're building software for a museum or other public instiute).

Of course, you can load a specific URL in a specific browser instance. Just read about the revBrowser related commands in the dictionary.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: revBrowser windowid problems

Post by sturgis » Tue Mar 02, 2010 11:37 pm

I'm building an interface to 3click.tv for use by myself and 2 others who also subscribe to 3click. Currently the 3click interface is completely web browser based, and transitions while browsing tv shows and seasons is horrendously slow. Getting the data needed to go directly to an individual episode of a specific show isn't very difficult, and doesn't bi-pass their auth method which is cool. If your session has timed out when you try to view a show you are prompted to enter password by 3click and the show starts.

The shows themselves are played in a seperate browser window using the 3click flash player that includes a maximize and minimize button.
I think the libkiosk and backdrop items are the direction I should be looking to simulate this behavior. Thank you very much for the direction. As you say, a fullscreen only app that takes over the users sytem isn't really something I want to do. With the info you provided I can finally turn this corner and maybe get something i'm happy with. Will still need to build my own widows controls so that they can be hidden, but as long as nobody cares that its ugly (did I mention my ability to design is sorely lacking?), it should work.

The question about targeting a specific window/tab was in reference to using launch to send the video links to firefox or safari. At this point the whole fullscreen switching issue would go away because I could use the built in flash fullscreen option. This is where my targeting question came into play. If the user changes their mind and chooses a new show to watch, it should take over the currently playing show and not start a new tab/window in firefox, or whatever is the default system browser. IF launch can't specify this information, my guess is that the next option would be to use applescript to get the deed done, and for the 1 windows machine, vbscript.

As far as design considerations, while its true, that in most cases its a cut and dried thing, for some types of applications its not. The mac dvd player will work either in fullscreen or windowed mode, as will itunes, wmp, etc etc etc. Thankfully your proposed method to hide the menu bar and dock should be a fine and dandy way to get this done, if I decide using an external browser won't work easily enough. Much appreciate the help!

P.S. It amazes me how many gems like backdrop there are in rev that i've not managed to find before. Again, thx for the pointer.

Post Reply