You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 270

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

1

Wednesday, October 12th 2016, 7:15am

WebVR Wakelock failing

Strangely, my latest attempt at a WebVR tour has a Wakelock problem. The phone falls asleep after two minutes without a physical touch. Two minutes being the Auto-lock time on my iPhone. This doesn't happen with other tours in VR mode. The main addition for this tour is two sound tracks, voice over plus music. Also a thumbnail menu. Can't imagine either being the cause.

iOS 10.0.2, KRPano 1.19pr6, iPhone 6s

Before spending a few hours running this down are there known situations that could cause this?

Here is the site (work in progress).

Thanks

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 270

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

2

Friday, October 14th 2016, 6:49am

Another test

Did a quick test with the clean, out of the box v1.19pr8. Wakelock doesn't lock. The phone goes to sleep after the autolock timeout.

Example here: Wakelock test. Same problem happened in v1.19pr6. It did not happen with v1.19pr3. Example: Lakehouse.

I am seeing this on iPhone 6s, iOS 10.0.2.

I'm not seeing anyone else with this problem so is it really just me? Any ideas what I'm doing wrong? Or is it a bug??

Tuur

Sage

Posts: 3,172

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

3

Friday, October 14th 2016, 2:26pm

Hi Scott,

i am testing your latest 1.19pr8 example on my iPhone6 iOS 10.0.1 (http://www.tourdeforce360.com/test/wakelock/)
After 3 minutes (which is my autolock setting) the phone starts to lock down.
I have it open in VR without touching or moving the phone.
i did a second test with moving the phone. Also then the phone shuts down after my 3 minutes.

I will update to 10.0.2 and do the test again, but i think there is something else going on.
Most logic conclusion i think is that Apple changed protocols... They could better fix their cross domain bug and webgl to canvas rendering.. Or maybe design a better mac pro that could be a workhorse..

i will do an other test, maybe in the weekend, with my own factory default output of the latest droplet.

Testing the lake house now and it seems that that one works good.
After, re-reading your post it could be possible that it is a krpano bug or lose end of some kind. Or maybe a small error in the new vtourskin code or so..
Maybe Klaus can confirm?

Hope it helps,

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 270

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

4

Friday, October 14th 2016, 10:58pm

Thanks for the confirmation, Tuur. I hope Klaus can shed some light on how to fix this. I suddenly have several clients very interested in webVR tours and it isn't workable with the current situation.

5

Saturday, October 15th 2016, 9:02am

Hi,

right the current wakelock-hack code isn't strangely working anymore...
I know it was working previously, but I'm not sure yet if that's now iOS10 related or not...

The original hack code was this:

Source code

1
window.location = window.location;
This forces a page reload and so resets the Safari internal wakelock counter.

But when the page url was containing a query '#', then the reloading wasn't working due the query - instead of reloading, the browser would have tried to scroll to that '#' anchor. And so the wakelock wasn't working.

Therefore in version 1.19-pr5 the code was changed to something like this:

Source code

1
window.location.href = filter_query(window.location.href);

The change was using 'location.href' instead of just 'location' and additionally filtering the query from the url.
But as it seems when setting 'location.href' instead of 'location' then wakelock hack doesn't work anymore (although technically both should be the same).

This will be changed back in the next release.
Then 'location' instead of 'location.href' will be used again.

For the meantime here a workaround code - add this anywhere in the xml:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<action name="ios10_webvr_wakelock_workaround" type="Javascript" autorun="onstart" if="device.iosversion GE 9"><![CDATA[
    setInterval(function()
    {
        if(krpano.webvr && krpano.webvr.isenabled)
        {
            krpano.trace(0,"iOS wakelock hack");
            window.location = (""+window.location.href).split("#")[0];
            window.setTimeout(window.stop, 0);
            window.setTimeout(krpano.Kloader.iOSWakelockCheck, 1);  // an internal API: restart pending loading requests
        }
    }, 15000);
]]></action>


Best regards,
Klaus

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 270

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

6

Saturday, October 15th 2016, 5:24pm

That works! And just in time for a client presentation.

Thanks Klaus!

Scott

7

Sunday, October 16th 2016, 6:36pm

thanks klaus,

adding this to my defaults for now

please leave us a note when it is obsolete

best, index

Posts: 130

Location: Venezia

Occupation: interactive pictures

  • Send private message

8

Monday, October 24th 2016, 5:16pm

May I ask a piece of code not to let phones go to sleep, something working both android and ios, independently from webvr???
THANKYOU!
Luca.

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 270

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

9

Monday, October 24th 2016, 9:29pm

I expect if you

remove: && krpano.webvr.isenabled

and change: if="device.iosversion GE 9" to if="device.mobile"

But I haven't tried.

Posts: 130

Location: Venezia

Occupation: interactive pictures

  • Send private message

10

Thursday, October 27th 2016, 9:43am

THANX!!!

I put in the webvr this:

Source code

1
2
3
4
5
6
7
8
9
10
11
 <action name="ios10_webvr_wakelock_workaround" type="Javascript" autorun="onstart" if="device.mobile"><![CDATA[
	setInterval(function()
	{
  	
        	krpano.trace(0,"iOS wakelock hack");
        	window.location = (""+window.location.href).split("#")[0];
        	window.setTimeout(window.stop, 0);
        	window.setTimeout(krpano.Kloader.iOSWakelockCheck, 1);  // an internal API: restart pending loading requests
    	
	}, 15000);
]]></action>

but it doesn't work...

11

Tuesday, November 1st 2016, 2:56pm

May I ask a piece of code not to let phones go to sleep, something working both android and ios, independently from webvr???
That hack is iOS specific, Android requires a different hack (playing a video in background).

You could try to use the nosleep.js script for Android (but only for Android! iOS requires that loading requests will be restarted - therefore the internal 'iOSWakelockCheck' function):
https://github.com/richtr/NoSleep.js

Best regards,
Klaus

12

Tuesday, November 1st 2016, 3:57pm


That hack is iOS specific, Android requires a different hack (playing a video in background).
You could try to use the nosleep.js script for Android (but only for Android! iOS requires that loading requests will be restarted
Best regards,
Klaus


does that mean there is no android-wakelock hack included in the actual release? (1.19pr8)
and how is the status for ios?
in effect: do we need to take care for wakelock ourselves or is it integrated in krpano?

13

Wednesday, November 2nd 2016, 11:55am

Hi,
does that mean there is no android-wakelock hack included in the actual release? (1.19pr8)
No, that doesn't mean that.
It means the iOS workaround from above works only for iOS and not for Android.

and how is the status for ios?
In the next krpano release it will be fixed and until then the workaround from above could be used.

in effect: do we need to take care for wakelock ourselves or is it integrated in krpano?
For WebVR usage it is integrated (see mobilevr_wakelock ), for non WebVR usage there is currently no wakelock support.

Best regards,
Klaus

14

Thursday, August 10th 2017, 9:27am

hi klaus,

i still had that in my code...
i guess it is obsolete since a while
and can be removed?

(on 1.19pr12 now)

best, index

15

Thursday, August 10th 2017, 6:38pm

Hi,

yes, that code is obsolete - it works only before iOS 10.3 and the newer WebVR plugin versions have that automatically integrated for older iOS versions and an new hack for newer iOS versions.

Best regards,
Klaus