You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With iOS 9.2 WebKit now blocks deviceorientation and devicemotion event access from cross-origin iframes. bug link
A-Frame Version: latest
Platform / Device: Ios webkit >= 9.2
as a dirty solution I was thinking about using the iframe postMessage to send devicemotions to the child iframe
something like this:
Father page
if(window.DeviceMotionEvent){/* Add a listener for the devicemotion event */window.ondevicemotion=function(deviceMotionEvent){/* Get acceleration on x, y and z axis */varx=deviceMotionEvent.accelerationIncludingGravity.x;vary=deviceMotionEvent.accelerationIncludingGravity.y;varz=deviceMotionEvent.accelerationIncludingGravity.z;varcoordinates=deviceMotionEvent.accelerationIncludingGravity;console.log(coordinates)/* Get the interval (ms) at which data is obtained from the underlying hardware *///send the accleration coordinates from parent to child iframe //"*" used to avoid cors protectionjQuery("#myChildIframe")[0].contentWindow.postMessage(coordinates,'*');}
Children iframe
window.onload=function(){window.addEventListener('message',function(e){//e.data are the accelerometer from father//now how to pass the devicemotions coordinates to aframe??})}
but how to send the father devicemotion coordinates to the child iframe aframe?
The text was updated successfully, but these errors were encountered:
With iOS 9.2 WebKit now blocks deviceorientation and devicemotion event access from cross-origin iframes. bug link
as a dirty solution I was thinking about using the iframe postMessage to send devicemotions to the child iframe
something like this:
Father page
Children iframe
but how to send the father devicemotion coordinates to the child iframe aframe?
The text was updated successfully, but these errors were encountered: