Can't get embedding to work with ios detection

  • Hello

    Im trying to embed a krpano version of a tour if ios is detected. Cant get it to work. Ive got the code below so far.

    I dont know how to construct the krpano embed statment.I need it to emulate what you can see in the fpp flash instruction you can see in the 'else' bit

    Thanks a lot in advance for any help

    Masten

  • Why are you using the old way?

    https://krpano.com/docu/html/

    Use the new way and only put the different xmls in their own braces.

    Code
    var viewer = createPanoViewer({swf:"tour.swf", target:"pano"});
    var ua = navigator.userAgent.toLowerCase();
    if(ua.indexOf("ipad") >= 0 || ua.indexOf("iphone") >= 0 ||  ua.indexOf("ipod") >= 0) {
    viewer.addVariable("xml", "ios/tour.xml");
    }
    else {
    viewer.addVariable("xml", "tour_virtual_tours.xml");
    }
    viewer.embed();
  • Hi Sacha

    OK, thanks. |cant get it to work though. Nothing embeds when I use first piece of code below. All the krpano stuff is in folder 'ios'. Im using the user agent in safari to test.

    Dont I need to define the size of the pano somehow

    The tour is working as when I go that folder and use the tour.html file in that folder it works fine (2nd piece of code below)

    Thanks a lot

    Masten


Jetzt mitmachen!

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