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

fix page-reloads on iOS (#2782) #2925

Merged
merged 1 commit into from Aug 4, 2017
Merged

Conversation

klaasman
Copy link
Contributor

@klaasman klaasman commented Aug 2, 2017

Description:
On iOS devices, the application seems to randomly reload. This has been pinpointed to a reload after 30 seconds of inactivity while in VR mode, caused by the iOS wakelock feature. As seen in other wakelock-implementations and issues, the window.location = window.location creates this issue.

Changes proposed:
Update the wakelock implementation to match other implementation which don't cause this reload-bug.

One thing to mention is the wakelock does not work on iOS (11), however I think it's better to have an application which will sleep after X seconds, instead of an application which will reload every X seconds.

@dmarcos
Copy link
Member

dmarcos commented Aug 3, 2017

Have you tried on Android?

@klaasman
Copy link
Contributor Author

klaasman commented Aug 3, 2017

No, but the touched lines belong to the iOSWakeLock() – it shouldn't have any impact on Android.

@klaasman
Copy link
Contributor Author

klaasman commented Aug 3, 2017

Or I'm missing something, in that case: enlighten me :-)

@dmarcos
Copy link
Member

dmarcos commented Aug 4, 2017

Thanks! 🥇

@dmarcos dmarcos merged commit b4015f5 into aframevr:master Aug 4, 2017
@@ -47,9 +47,9 @@ function iOSWakeLock() {
this.request = function() {
if (!timer) {
timer = setInterval(function() {
window.location = window.location;
window.location.href = '/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this fix? this assumes a page lives at the root, right?

a better wakelock imo would be to play an empty autoplay audio track on loop (but would have to test to guarantee no perf impact).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants