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:
|
Quellcode
|
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:
|
Quellcode
|
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:
|
Quellcode
|
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