You are not logged in.

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

1

Thursday, April 14th 2011, 4:52am

variable "if" for android ?

Hi,

Is it possible to use the var "if" for android ? For example i'd like to reach after the alt url of my hotspot when using a smartphone, not only with iPhone. Then to use the "altonloaded" variable as for iPhone (if(isphone.....)), for android.
Did someone already tested that ?

Thanks. *smile*
Steph
Steph

2

Thursday, April 14th 2011, 3:26pm

Hi,

see here:
http://krpano.com/docu/actions/#isandroid

best regards,
Klaus

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

3

Friday, April 15th 2011, 6:40pm

Hi Klaus,

Thanks for the link. However i wasn't enough clear in my post upon. Sorry.
For example, if i want to use the same style for the three possible configuration (PC, iphone, android), is my code below correct?

Source code

1
2
3
4
5
6
7
8
9
10
<plugin name="A"
               url="myplugin.swf"
               style ="B"
                          ......./>


<style name="B"
       alturl="iphone.png"  <!---for iphone, android can use the swf---->
       altonloaded="if(isphone, set (scale,2)); if(isandroid, set(scale,2.3));"
            /> 

Now, if i want to use a third url for android in .swf, is that possible.? Or to use the same alturl than iphone instead the main .swf, can that be done ?

An other solution could be to lead the request straight from the html to three differents xml .? Thing is when i do a xml dedicated to iphone, it loads quicly. Now, if i load the big main xml and use the "alt" variables, it seems to be longer than the other.
VN gave me a code example here VN html code but i don't have the same syntax than him, in my html.

Is this one correct ? Because it doesn't work, my iPod load the main xml.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
	<title>krpano.com - Salle-une</title>
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<style>
.........
	</style>
</head>
<body>

<script src="tour.js"></script>

<div id="pano" style="width:100%; height:100%;">
	<noscript><table style="width:100%;height:100%;"><tr style="valign:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
	<script>
		embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano"});
<!----Below,  what i've added---->
                //viewer.useHTML5("whenpossible");
               if( viewer.isDevice("iPhone|iPod|iPad") )
		viewer.addVariable("xml", "iphonetour.xml");
	else
		viewer.addVariable("xml", "androidtour.xml");
		
	viewer.embed();

	</script>
</div>

</body>
</html>



Thanks very much. *smile*
Steph
Steph

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

4

Friday, April 15th 2011, 8:03pm

Use the devices tag in the plugin, to make different plugins for each device, and then don't put that attribute alt in the style.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

5

Saturday, April 16th 2011, 11:40am

Hi sachagriffin,

Thanks for your suggestion. I keep it.
In case i'd like to give a xml to each devices, how could i write it in the html ?
The way i did just don't work.

Thanks everybody. *smile*
Steph.
Steph

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

6

Saturday, April 16th 2011, 4:15pm

The previous code
if( viewer.isDevice("iPhone|iPod|iPad") )


should work fine.. but note.. there is no such thing as an iPod device. It matches iPhone.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

7

Wednesday, February 29th 2012, 12:01pm

Easys, i have the same problem too...i have 3 different xml and i want do do a switching between flash,android and js version....

Ihave tryed with the same script in html and doesn't work...have you resolved? *love*

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

8

Wednesday, February 29th 2012, 2:06pm

Hi Corsifo,

I solved the problem whether write plugins or hotspots for each device, or embed my tour in swf and keep a lighter xml for html5 and iOs.

Otherwise, i get no answer enough clear to add code in the main html;

Hope this help. ;-)
Bye.
Steph
Steph

9

Friday, March 2nd 2012, 4:13pm

Solved:)...I don't know what was the problem, but i solved whit the krpano.swf file as base and 2 different .xml : One for I-phone|I-Pad|Android end the second for the Desktop tour.

Thz for the help guys!:)