Gyro issue in iframe

  • Hi, I'm trying to display panos in a mobile web app with a jquery framework, embeding the panoramas with the usual method doesn't displays anything so I used the iframe solution to display them (injected with jquery)

    The problem is the gyroscope plugin doesn't work well in an iframe, it displays the panorama always in the portrait orientation. If turn off the gyro the panorama works well in both orientation.
    Is there a solution for this bug ?

    Thanx !

    you can view the problem her : http://www.anjou360.com
    clic on "Liste" then on any item and then on 360

  • Ok, thanx for looking,
    The grand theatre has XML error is solved, but not the gyro issue in iframe.
    If I embed the pano directly in the page it works well (gyro as well)
    The problem is that I want to embed the krpano script dynamicly replacing the xml variable :

    the "360" button has id:displayPanoramaBtn

    with iframe the pano is displayed, but the gyro is bugy :

    Trying to embed krpano without iframe doesn't display anything (I guess it's becose innerHTML embed the script but it's not actived by the browser as the page is already loaded ?)

    Code
    function displayPanorama(url, dom) {
    	var xmlurl = url;
    	document.getElementById(dom).innerHTML=(' <script src="krpano/swfkrpano.js"></script><script>embedpano({swf:"krpano/krpano.swf",xml:"'+url+'",target:"panocontent"})</script>');
    }

    If someone has a solution to embed the panorama with a javascript function and xml variable... I'm a bit lost...

    Thanx !

  • If you use the gyro plugin in an iframe, it can only work if the domain of the main window is the same domain as the iframe. This is a (security) limitation of the browser.


    I tried both (same and other domain) and the gyroscope behaves the same way, it follows the device orientation but is blocked in the vertical view :

Jetzt mitmachen!

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