You are not logged in.

1

Wednesday, May 25th 2016, 7:23am

webVR hangs inside cordova iOS app

When accessing the tour via mobile Safari, webVR works fine. But when I package the tour into an app using cordova, the app hangs when clicking on the VR icon.

What do you think is causing the problem? I'm not seeing any errors on the console output.

2

Wednesday, May 25th 2016, 9:35am

Got an update on this:

Using the mobile inspector, I traced the error to cordova's version of document.addEventListener.

Source code

1
document.addEventListener = function(evt, handler, capture) {  var e = evt.toLowerCase();



Error is on the call to toLowerCase because evt is undefined. Perhaps webvr.js is attaching some undefined event?
When I wrap this in an if statement checking for undefined, webvr works normally.

This post has been edited 1 times, last edit by "engwan" (May 25th 2016, 10:32am)


3

Wednesday, May 25th 2016, 11:06am

Hi,

thanks - right, there is a bug in the webvr.js that relates to iOS.

There a code line like this:

Source code

1
document.addEventListener(device.browser.events.fullscreenchange, on_fullscreen_change);
but the 'fullscreenchange' is undefined because there is no HTML5 fullscreen API support in iOS.

This will be fixed in the next release.

I think normal browsers are just converting the first argument to a string, so the event name would be 'undefined' and that wouldn't have any effect.


If it's possible to edit the Cordova code I would recommend changing:

Source code

1
var e = evt.toLowerCase();
to:

Source code

1
var e = (""+evt).toLowerCase();
Then this the argument will be always converted to a String and even invalid usage cases will be handled well.

Best regards,
Klaus

4

Friday, July 15th 2016, 1:11am

Hi,

I had the same issue with a Cordova app running a WebVR pano on iOS.
The fix mentioned above did work and the VR button did activate the VR mode, but then the app would just render a blank screen instead of the expected stereoscopic view.
I know that since iOS 7 Webview-based apps cannot run in fullscreen mode, could it be the issue here ? I tried to emulate fullscreen by hiding the nav and status bars, but the tour still won't display in stereo. Nothing shows in the krpano console or in the safari remote debugger either...

@engwan did you manage to display the tour eventually ?

Thanks !

5

Thursday, September 1st 2016, 2:32pm

Hi,

I had the same issue with a Cordova app running a WebVR pano on iOS.
The fix mentioned above did work and the VR button did activate the VR mode, but then the app would just render a blank screen instead of the expected stereoscopic view.
I know that since iOS 7 Webview-based apps cannot run in fullscreen mode, could it be the issue here ? I tried to emulate fullscreen by hiding the nav and status bars, but the tour still won't display in stereo. Nothing shows in the krpano console or in the safari remote debugger either...

@engwan did you manage to display the tour eventually ?

Thanks !
Yeah, the tour works in VR after I made that change. It was the only change I made.

Haven't encountered what you described so I can't tell.

6

Tuesday, September 6th 2016, 9:31pm

Just as note - that fix is already included in the latest krpano releases. That means no need to edit the Cordova code.

7

Tuesday, November 14th 2017, 5:29pm

I'm having a similar issue here with Android now - this is with a basic fresh-from-the-dropper krpano VR tour, version 1.19 r13. Going into VR just hangs the tour - you can't even pan it with your finger.

Any ideas?

8

Tuesday, November 14th 2017, 10:30pm

Sorry, but I don't use or test with Cordova.