Beiträge von MIshaPetla

    I want to run Krpano code as a standalone app. After some tweaks in Xcode, it works
    great on iOS (including VR mode), but on Android, I have no idea how to get past this error.


    I KNOW this is not pure KRPano question, as the solution lies outside krpano code itself, but still, I know people have been doing it for years, I've read posts about is on this forum too years ago.

    I've done an extensive search, and no answers are safisfactory. I've been pursuing a couple of options so far:


    •Adding this code (to somewhere) in webview classes or android sdk files:


    $ publicabstractvoid setAllowContentAccess(boolean allow);
    $ publicabstractvoid setAllowFileAccessFromFileURLs (boolean allow);
    $ publicabstractvoid setAllowUniversalAccessFromFileURLs (boolean allow);
    $ publicabstractvoid setAllowFileAccess(boolean allow);


    Source: https://developer.android.com/reference/andr…ebSettings.html


    •Adding this code (to somewhere?) in the "activity" (i presume a Cordova file, class..?):


    $ myWebView.getSettings().setAllowFileAccess(true);
    $ myWebView.getSettings().setAllowContentAccess(true);
    $ myWebView.getSettings().setAllowFileAccessFromFileURLs(true);
    $ myWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);


    Source: Problems using krpano locally in Android and iOS


    •Somehow using CrossWalk (though latest update was in 2017-discontinued)


    Basically, the aim I presume is to somehow enable WebGL in Android's
    WebView, either by making changes in Android Studio, or by some command
    in Cordova/PhoneGap.
    I know some people managed to solve this, just how, remains unclear.

    Hi Klaus,

    Thanks for replying. Good to know that it'll be addressed in the next version, really appreciate you taking the time to adjust things for something that's so far outside krpano's normal usage!

    Edit - Cordova lets you forcibly set the user agent, so thanks to your help I've been able to get it to work by simply stripping out the '; wv' bit and manually pushing the user agent back to the browser. It's a bit messy but it works, so thanks again!

    I know it's 2019, but now I'm having the same problem, and find it difficult to implement your instructions; in which file in Cordova do you set the user agent, and how do you push user agent back to the browser?

    SOLVED:
    Add this to onentervr, in webvr.xml or index_core_vr.xml. And remove ask user for screensize, and if sentence on onunknowndevice.

    Not sure if all of this is needed, but it does the trick for me. I'm guessing the empty cache used to crash vr settings, now something gets written; no longer empty:)


    copy(hs, vrheadsets.headset1);


    copy(vrs, webvr.vrsetup);


    webvr.saveSettings();

    I don't think the problem can be solved by adding another device to
    the database; I'm running the tour as a standalone app, for ios and
    android, so external sources, in this case a database, are unavailable.
    The problem exists on all newer iphones (I am testing with iPhone
    Simulator and Xcode).
    Potential solutions I think are:

    • tweaking onunknowndevice parametres in index_core_vr. xml
    • disabling default VR "device-blank", or setting one of options as default
    • creating
      a settings file in advance, that way havesettings would return true.
      Only "blank" creates the problem; or not having a settings file


    What do you guys think?

    Oh and I've tried removing ask_user... "ondeviceunknown"
    https://krpano.com/forum/wbb/inde…tings#post78402
    Problem persists, tour starts ok on "custom", but the second you try to change the headset, crash. Next time (when buffer is not emtpy anymore?), it works ok.
    I'm guessing problem lies somewhere in vr_setup action?
    Klaus, any input would be most welcome, thx in advance