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.

1

Thursday, April 12th 2018, 12:32pm

how to delete the link to file in the screen of a fatal mistake?

Problem: at emergence of a fatal mistake (the black screen) on the screen the complete absolute path to the file which could not be loaded (for example - http://.........../plugins/webvr.xml) is displayed. To us it is very important that nobody has seen the link to file (our hosting).

Whether there is an opportunity to make that at such mistakes the way to the file was not displayed?
It is very important for us. Very much we ask for help.
Maybe somebody faced such problem?

2

Saturday, April 14th 2018, 9:37pm

Hi,

you could use the new onxmlerror event to implement a custom error handling:
https://krpano.com/docu/xml/#events.onxmlerror

When this event will be set, no krpano error message related to xml-loading/parsing will be shown.

And about fixing that problem - I would say just upload that missing xml...

Best regards,
Klaus

3

Tuesday, April 17th 2018, 9:51pm

<krpano version="1.19" title="Virtual Tour" >



Hi!
Thanks! I tried to make so, here a part of my tour.xml:

<events name="onxmlerror" keep="true" onxmlerror="xmlerror();" />

<action name="xmlerror" >
addlayer(xmlerror);
set(layer[xmlerror].url, %CURRENTXML%/skin/fatalerror.jpg);
set(layer[xmlerror].keep, true);
set(layer[xmlerror].zorder, 99);
set(layer[xmlerror].align, center);
set(layer[xmlerror].width, 100%);
set(layer[xmlerror].height, 100%);
</action>


But it doesn't work...
If there is no xml, for example webvr.xml, or because of a bad connection of WiFi couldn't be loaded, then there is a standard option of a mistake which is formed by the main tour.js module
We have a problem that under no circumstances nobody has to see an absolute path to our files (to our hosting).
If for example there is a mistake when loading tour .xml, then the method with onxmlerror.events won't help. And such mistake is theoretically possible.
Can be to eat some team which can be added for example to the index.html file instead of a line - <script src="tour.js"></script> ?

4

Wednesday, April 18th 2018, 11:02am

Hi,

you could:
  • use 'null' as startup xml
  • use the onready callback
  • set the onxmlerror event there
  • and then load the first xml.
E.g.

Source code

1
2
3
4
5
embedpano({xml:null, ..., onready:function(krpano)
{
   krpano.set("events.onxmlerror", function(){ console.log("error:"+krpano.get("lasterror")); });
   krpano.call("loadpano(tour.xml);");
}});


Best regards,
Klaus

5

Wednesday, April 18th 2018, 1:00pm

It is a shame to me to admit, but I don't know a basis of HTML of programming at all... :( Very much I ask to help to resolve this very important issue up to the end.
I have added your example to index.html, but the standard option of a mistake from tour.js is all the same displayed...
Here is how my index.html looks now:


<!DOCTYPE html>
<html>
<head>
<title>krpano - 9</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<style>
@-ms-viewport { width:device-width; }
@media only screen and (min-device-width:800px) { html { overflow:hidden; } }
html { height:100%; }
body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
</style>
</head>
<body>

<script src="tour.js"></script>

<script src="html5sound/js/howler.core.min.js"></script>
<script src="html5sound/js/howler.effects.min.js"></script>

<div id="pano" style="width:100%;height:100%;">
<noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
<script>
embedpano({swf:"tour.swf", xml:null, target:"pano", html5:"auto", mobilescale:1.0, onready: function (tour)
{
tour.set ("events.onxmlerror", function () {console.log ("error:" + tour.get ("lasterror"));});
tour.call ( "loadpano (tour.xml);");
}
});
</script>
</div>

</body>
</html>

6

Wednesday, April 18th 2018, 1:52pm

The code looks okay (assuming that onxmlerror will not be redefined in the xml itself).
Are you sure that use krpano version 1.19-pr16?
In older versions there is no onxmlerror event!

7

Wednesday, April 18th 2018, 1:58pm

I have krpano version 1.19-pr14 now
Shouldn't work?

8

Wednesday, April 18th 2018, 2:41pm

No - as said it need to be 1.19-pr16 (or to be exact: pr15 or higher) - the onxmlerror event is NEW and was first added there:
krpano 1.19-pr15 / pr16

9

Wednesday, April 18th 2018, 3:36pm

I have now updated all files in a tour to the version 1.19-pr16, and now began to work :) Now at a fatal mistake just black screen. I have added the command and now the black screen with the inscription "ERROR".

Thanks a lot for the help, Klaus! I didn't know in the new version there is such opportunity :)