Sie sind nicht angemeldet.

1

Sonntag, 9. März 2014, 15:40

How to reconize different mobile devices.

When trying to play 360 Video on mobile devices we know it does not work. So I would like krpano if it see a IOS or Android device have it stop and say, "Hey these devices are not supported!" and end maybe show a URL link for IOS mobile device download or Android device download.

Any ideas on how to do this? *smile*

Thank you in advance.

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

2

Sonntag, 9. März 2014, 15:45

Hi M,

yes easy in the index, make for those devices another xml path .. like:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<script>

	var viewer = createPanoViewer({swf:"viewer/tour.swf", id:"krpanoSWFObject", target:"pano", html5:"auto", wmode:"opaque", passQueryParameters:true});
	//viewer.useHTML5("whenpossible");		// incomment to use the HTML5 krpanoJS viewer always when possible (Safari5)

	if( viewer.isDevice("iPhone|iPod|Android") )
		viewer.addVariable("xml", "tour_mob.xml");
		
	else if( viewer.isDevice("iPad") )
  		viewer.addVariable("xml", "tour_tablet.xml");	
		
		
	else
		viewer.addVariable("xml", "tour.xml");

	viewer.embed();

</script></div>



or use the device settings to trigger an event or what ever device dedicated thing you want to happen, like:

Quellcode

1
if(device.tablet, show_splash());


hope it helps

Tuur *thumbsup*

3

Montag, 10. März 2014, 12:42

Hi,

I would recommend doing that detection stuff in the xml by using the devices attribute for static checks or the device object for dynamic checks in action code:

http://krpano.com/docu/xml/#devices-notes
http://krpano.com/docu/actions/#device

Best regards,
Klaus