Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nosleep stopped working on iOS 10.3.1 #217

Closed
HalfdanJ opened this issue Apr 12, 2017 · 10 comments
Closed

Nosleep stopped working on iOS 10.3.1 #217

HalfdanJ opened this issue Apr 12, 2017 · 10 comments

Comments

@HalfdanJ
Copy link
Contributor

New version of iOS has broken the no sleep functionality in polyfill.

@jsantell
Copy link
Contributor

Looks like others reporting the same with NoSleep.js, urg.

@customlogic
Copy link

This has been fixed in NoSleep: richtr/NoSleep.js#29

@jsantell
Copy link
Contributor

Just tried the latest nosleep and didn't seem to work for iOS11 :\

@jeppester
Copy link

jeppester commented Dec 4, 2017

I experience the same problem on iOS 11.1.2.

I took the time to run some tests with nosleep and webvr-polyfills wakelock.

webvr-polyfill's built-in wakelock (using location hack) doesn't have any effect - the screen goes to sleep after 40 seconds, every time.

With the latest nosleep.js, which uses a video that's seeked randomly after 0.5 seconds, the results get really interesting. I get between ~40 and ~80 seconds before the screen goes to sleep. Because of the variance in the number of seconds I tested a LOT of times. It almost seems like some randomness was added intentionally. Here are my numbers:
60, 79, 70, 40, 42, 46, 82, 50

I'll try out various solutions, to see if I can come up with something the works, here are my current ideas:

  • instead of using a data URI try loading the video from a file
  • try a longer video
  • try making the video visible on the screen
  • try changing the randomness of the seek operation

@jeppester
Copy link

Update: Using a longer video works.
Maybe there is a way to programatically loop parts of the base64 string to increase the length of the video.

@cvan
Copy link
Contributor

cvan commented Dec 5, 2017

great idea! looks like we can do https://github.com/richtr/NoSleep.js/blob/master/src/index.js#L20-L24 (fixed in richtr/NoSleep.js#33)

I can take this on, unless someone beats me to it

@jeppester
Copy link

The fix you are referring to is included in the latest NoSleep.js-version, which is the one I was testing. It does work to some extend, but it seems like it doesn't fool safari for very long.

My idea was to programmatically repeat parts of the base64 string to make the video's duration longer. I'm not entirely sure if it's a good idea though, it will take up some extra memory to store a very long data URI.

@jsantell
Copy link
Contributor

Looks like there's an issue open for iOS11 not working, but possibly fixed in 11.1? Can anyone else confirm? richtr/NoSleep.js#41

@jsantell
Copy link
Contributor

Fix for iOS 10 ready (immersive-web/cardboard-vr-display#1), will open a new ticket for iOS 11 issues

@jsantell
Copy link
Contributor

jsantell commented Dec 29, 2017

Fixed for iOS 10 in 71eb215, 0.10.1

wan-hellopupil pushed a commit to wan-hellopupil/webvr-polyfill that referenced this issue Apr 19, 2018
…ebvr-polyfill/immersive-web#169), and to disable when on desktop (webvr-polyfill/immersive-web#275) using NoSleep module (webvr-polyfill/immersive-web#217)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants