You are not logged in.

1

Tuesday, May 22nd 2012, 6:47pm

about embedpano with condition

Hello people!

First of all sorry about my poor and bad english!

I read in the documentation saying about the methods to embed the panoramas.

As I understand it, I can only put the wmode parameter using the function embedpano.

But I would like to write something with a condition such as: If a device add the variable containing the xml to be read, saying directly that will not be a flash movie, but if not a device, then that performs the function normally, as is!

Can someone help me!


Right now I'm trying something like:

var viewer = embedpano({swf: 'vivi1.swf ", target:" panoDIV ", wmode:" opaque "});

if (viewer.isDevice ("iPhone | iPod | Android | iPhone | androidtable"))
viewer.addVariable ("xml", "vivi1b.xml");
else

viewer.embed ()

Thanks!

2

Wednesday, May 23rd 2012, 10:56am

Hi,

the 'embedpano' function doesn't return anything, it is directly embedding the viewer,

see here:
http://krpano.com/docu/html/#description

and means use 'createPanoViewer' instead,
e.g.

Source code

1
2
3
4
5
6
7
8
var viewer = createPanoViewer({swf: 'vivi1.swf ", target:" panoDIV ", wmode:" opaque "});
   
if ( viewer.isDevice("iPhone|iPod|Android|iPhone|androidtable") )
  viewer.addVariable("xml", "vivi1b.xml");
else
  viewer.addVariable("xml", "desktop.xml");
 
viewer.embed();


Best regards,
Klaus