How to use a different .XML for Mobile and Ipad

  • Hello,

    I am wondering how to change the .xml used depending on the device used. At the moment it uses tour.xml for everything.

    I want it to use mobile.xml for mobile & ipads and tour.xml for everything else.

    Here is one of the tours i'm working on, it is a great piece of software!
    https://d2de71h5xfnr0k.cloudfront.net/


    Thank you very much for your help.


    CODE IN MY INDEX.HTML What do i need to change in here for it to work?


    ----------------------------------------------------------


    <!DOCTYPE html>
    <html>
    <head>
    <title>Monument View</title>
    <meta name="viewport" content="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 name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <style>
    @-ms-viewport { width:device-width; }
    @media only screen and (min-device-width:800px) { html { overflow:hidden; } }
    html { height:100%; }
    body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
    </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="vertical-align: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", html5:"prefer", mobilescale:1.0, passQueryParameters:true});


    </script>
    </div>

    </body>
    </html>

    ----------------------------------------------------------

  • Perhaps there are plenty of solutions, One of them:

    html file:

    Code
    ...
    <script src="tour.js"></script>
    <div id="pano" style="width:100%;height:100%;">
    <noscript><table style="width:100%;height:100%;"><tr style="vertical-align: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:"devices.xml", target:"pano", html5:"prefer", mobilescale:1.0, passQueryParameters:true});
    </script>
    ...

    devices.xml file:

    Code
    <krpano version="1.18" bgcolor="0x000000">
    
    
    	<include url="tablet.xml" if="device.tablet" />
    	<include url="desktop.xml" if="device.desktop" />
    	<include url="mobile.xml"  if="device.mobile" />
    	
    </krpano>

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!