immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
92 stars 43 forks source link

Wakelock Issue on IOS 13 #44

Open danrossi opened 4 years ago

danrossi commented 4 years ago

I believe there is a wakelock issue for IOS 13 and it requires this NoSleep forked project which has the fixes.

https://github.com/Domratchev/NoSleep.js

danrossi commented 4 years ago

I believe the change to this branch doesn't work. Wakelock broken in IOS 13.

jsantell commented 4 years ago

Wakelock on iOS has always been a challenging pile of hacks. I don't have access to an iOS 13 device at the moment, hopefully there's some possible solution

danrossi commented 4 years ago

Please hold I have a client testing the updated branch, they claim the live demo version is working not sure which build that is. Ive been between 3 different forks and the fork changes might be an issue. The version built into vr cardboard display is def broken. IOS 13 has broken many things indeed. I may close

danrossi commented 4 years ago

master branch is working with IOS 13. The forks I tried and manually merged cause issues. Updated the github dependency in the cardboard display project.

jsantell commented 4 years ago

What version of nosleep.js did you pin/update to that worked for you?

danrossi commented 4 years ago

The github master branch. I've got it in my fork which I had to also fix IOS 13 detection properly.

https://github.com/danrossi/cardboard-vr-display

jsantell commented 4 years ago

@danrossi thanks for the update; looks like iOS 13 was fixed for the 0.11.0 release, we can try pinning cardboard-vr-display to that upstream (should be currently the same as pinning to the master branch)

danrossi commented 4 years ago

The branch on its own does work. They are claiming its still going to sleep within vr display. Have to debug further.

danrossi commented 4 years ago

I think I found the problem. If I make a pull request it might be complicated as it may be out of sync. There is still IOS 13 detection issues. See this ?

export const isIOS = (function() {
  var isIOS = ((/iP(hone|ad)/i).test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));
  return function() {
    return isIOS;
  };
})();

isMobile I don't think detects IOS 13

if (USE_WAKELOCK && Util.isMobile()) {
    this.wakelock_ = new NoSleep();
  }