You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 27th 2017, 1:34pm

Controlling pano from another window

Hi,

it's an interesting fact that you can control your pano from another window. That of course requires that you are in an environment where you can show more that one window.



I made this little "remote controller" as a test.

Test page: http://wirestam.com/panos/test/tool/
Zip file: http://wirestam.com/panos/test/tool.zip


/Tommy

jordi

Intermediate

Posts: 428

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Monday, March 27th 2017, 2:15pm

Great tool Tommy !!
everpano.com smart virtual tours

3

Tuesday, March 28th 2017, 9:17am

That´s frickin awesome *thumbsup*

4

Tuesday, March 28th 2017, 10:53am

Well, it's the power of a Javascript interface...

Tommy

5

Monday, April 3rd 2017, 3:52am

좋은 ~, 고마워 ~~

6

Monday, April 3rd 2017, 10:20am

Quoted

좋은 ~, 고마워 ~~

I agree - eh, I think...

panomaster

Intermediate

Posts: 275

Location: Kobyłka, Poland

Occupation: Virtual Tours - Spherical Panoramas - Krpano developer

  • Send private message

7

Monday, April 3rd 2017, 12:26pm

:)

jordi

Intermediate

Posts: 428

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

8

Monday, April 3rd 2017, 4:04pm

Would be nice to do it from another device ;)
everpano.com smart virtual tours

9

Monday, April 3rd 2017, 4:59pm

Hi Jordi,

I gave it some thought earlier, but I'm not an expert at these things. As long as you keep your communication inside the browser, you can use the DOM (or BOM) tree.

But I think as soon as you want to communicate outside the browser, you have to use something like a Web socket. However, these communicate with an URL, so you probably have to go through a web server application - or maybe something like how Internet gaming works.

Tommy

jordi

Intermediate

Posts: 428

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

10

Wednesday, April 5th 2017, 11:58am

Yes exactlly is about web sockets, just like a chat
everpano.com smart virtual tours

11

Thursday, April 6th 2017, 9:40am

So if I understand that correctly, we could establish a JS-connection between two krpano-instances via websocket?! One instance would send the js-commands to the node.js-server and the other instance receives these commands, just like it does in Tommys example? And just like a simple chat-system the node.js-server could even be used for a two way-communication where the second krpano-instance returns permanently the actual scene-status like ath, atv and fov? *blink*

12

Friday, April 7th 2017, 2:03am

Yes, the two (or several) instances would open a websocket connection to the server application, which only acts as a transfer node between the instances. If all of them are krpano instances, I guess it would be wiser if one is the master and the other slaves - at least if you want to coordinate pano movement.

And you would probably prefer to have an Apache module in your webserver to get quick response, but my own homepage is in a web-hotel, so I don't have that possibility. On the other hand, I run an Apache server in my home PC, but I have forgotten how to write an Apache module.

In the meantime, I made another test page, where you can see that it's possible to control two separate panos with the same remote control:

http://wirestam.com/panos/test/seasons/

13

Friday, April 7th 2017, 8:49am

Great example, Tommy...again *thumbsup*
Would it be possible within your example to control the second pano not with the tool but the ath, atv and fov-values from the first pano?

We really need an websocket/Apache-expert here! This is just to darn good not to be done *g*

14

Friday, April 7th 2017, 11:30am

You can of course always trap all movements in the first pano with the "onviewchange" event, and then send it with javascript to the second pano. But I can't find any way to stop all mouse or keyboard input for moving the second pano directly. I thought I could do it when I found the stopmovements() command, but this only interrupts already ongoing movements. Maybe you can place a transparent <div> over the pano window to prevent any mouse action.

Tommy

15

Friday, April 7th 2017, 1:04pm

Just putting a transparent layer above all in the 2nd krpano-instance would be my first choice, because it´s simple and effective! And with the zorder it´s even possible to put some buttons in top of that, to activate or deactivate direct user input. That´s how I de- and reactivate all user inputs after starting the "Autotour" in my virtual tours.