You are not logged in.

1

Friday, September 27th 2019, 10:05am

ios 13 and DeviceOrientationEvent.requestPermission

Hello!

In ios 12 apple introduced the pesky checkbox in settings for allowing device motion, which meant that we did not have any way but making the user go into settings and enabling this feature.

But now in ios 13 they have removed that checkbox and now you have to ask permission for the different apis.

i just tried 1.20 against ios 13 and it doesn't seem to ask for permission, so this is something that needs fixing.

Something like this is needed



if (typeof DeviceOrientationEvent.requestPermission === 'function') {
document.body.addEventListener('click', function () {
DeviceOrientationEvent.requestPermission()
.then(function() {
console.log('DeviceOrientationEvent, DeviceMotionEvent enabled');
})
.catch(function (error) {
console.warn('DeviceOrientationEvent, DeviceMotionEvent not enabled', error);
})
}, {once: true});
return;
}

2

Friday, September 27th 2019, 10:49am

DeviceOrientationEvent.requestPermission()
.then(function() {
console.log('DeviceOrientationEvent, DeviceMotionEvent enabled');
})
It seems permission have to be requested separately for DeviceOrientationEvent and DeviceMotionEvent

3

Friday, September 27th 2019, 11:45am

Hi,

make sure to use krpano 1.20 and also the newer gyro2.js and webvr.js plugin from there!

They already support requestPermission for DeviceMotionEvent (which is used by default) and also for DeviceOrientationEvent.

Best regards,
Klaus

4

Saturday, September 28th 2019, 1:16pm

Yeey, got it working.


We have a complex setup, and I missed updating the plugins in one place :P

Thanks!

5

Saturday, October 19th 2019, 7:04pm

Hi,

make sure to use krpano 1.20 and also the newer gyro2.js and webvr.js plugin from there!

They already support requestPermission for DeviceMotionEvent (which is used by default) and also for DeviceOrientationEvent.

Best regards,
Klaus

Hi, I've updated my krpano to 1.20.2 and copied gyro2 and webvr files but I still can't get my gyro and vr to work on iPhone.


Any idea what to do?

6

Saturday, October 19th 2019, 7:14pm

Will this code work even though the motion and orientation option is missing from Safari with the iOS 13 update?

And when I open the gyro2 in 1.20 - its a lot of code..where does the above code go??

I see code examples but no where are tutorials on WHERE to put the code. I know this is a great software, but for experienced code gurus newbies must own way but I'm under deadline, totally lost and ready to find another application. Wont spend the money on a 3rd upgrade if its so difficult to use.

7

Saturday, October 19th 2019, 11:24pm

Hi,

please ignore that code above, that's misleading and not krpano related.

All you would need todo is to use the latest krpano version and HTTPS and gyro/webvr will work.

Best regards,
Klaus

8

Sunday, October 20th 2019, 6:45pm

Hi,

please ignore that code above, that's misleading and not krpano related.

All you would need todo is to use the latest krpano version and HTTPS and gyro/webvr will work.

Best regards,
Klaus
I've done that, not sure what could be wrong. You can check it out here: https://cityguide360.ba

9

Tuesday, October 22nd 2019, 12:06pm

Hello All,

Reporting about gyro issue - just been updated to 13.1.3 and gyro stop working (1.20.2/https/etc) as there is no motion&orientation permission dialog request. At the same time when I enters WebVR, the motion&orientation request dialog appears fine and it works once allowed.

Also, when using videoplayer.xml from 1.19.pr16 no user interaction is needed when video is muted, while with 1.20.2 it is needed in any case (13.1.3 Safari) - keep using old videoplayer.xml with 1.20.2 as of now and it's just fine.

regards,
Granton

This post has been edited 2 times, last edit by "granton" (Oct 23rd 2019, 10:52am)


10

Thursday, October 31st 2019, 8:58pm

Hello All,

Found the solution - set(plugin[gyro].enabled, true); is a must (even it was enabled before) with onclick event

regards,
Granton

Similar threads