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, January 31st 2011, 11:28pm

Loading XML actions for specific devices?

Is there a simple way to define which <action> gets loaded for each device?

For example, I would like buildthumbs(); to run only if I'm viewing the vtour from an iPad|iPhone|mobile, but NOT if I'm viewing via flash on a desktop web browser - it seems like we could throw a simple switch to define which device it would/not run... iPad=true, iPhone=true, flash=false;

I realize that I can define separate html and subsequently xml for each device fork, I was hoping that we could use a universal XML to define what actions/plugins get loaded for each type of device...

Back to my initial query, any ideas how to load the thmbnails on all devices other than desktop/flash?

2

Monday, January 31st 2011, 11:57pm

This has worked for me. Basically it states, if it is flash then create the gallery. If it is not then build thumbs.
Then have actions set up with those names.

<events
 
  onxmlcomplete=" if(isflash, create_gallery(), buildthumbs() );"
  
  />


Jarred

3

Tuesday, February 1st 2011, 12:57am

Thanks for the help!

I found in another post that you can add the following line:

set(plugin[get(thumbname)].devices, html5);

In <action name="buildthumbs">

Seems to work for my specific purpose, having thumbnails on everything but desktop browser - but I'm wondering if Klaus can offer a more appropriate suggestion for having actions apply to specific devices -i.e. is there a flag or switch we can throw to toggle actions for specific devices using a universal XML?

4

Tuesday, February 1st 2011, 10:55am

Hi,

yes, see this thread:
1.0.8.14 pre-release with "devices" attribute for all xml tags

with it you can e.g. define the same action two times for different devices:

Source code

1
2
3
4
5
6
7
<action name="start" devices="desktop">
  ...
</action>

<action name="start" devices="mobile|tablet">
   ...
</action>


best regards,
Klaus