mozilla-mobile / webxr-ios

An iOS app for testing WebXR
Mozilla Public License 2.0
211 stars 42 forks source link

Trying to make this work with current state of WebXR #186

Open Noltibus opened 4 years ago

Noltibus commented 4 years ago

I checked out the repo and tried the master as well as the develop branch. Both of these branches navigate to the site webxr-ios.webxrexperiences.com, which is also the default site for the current version of WebXR Viewer on Apple Store. The version on the App Store is able to run the examples from the site with no difficulties, however, the version in this repository is not. After I click on the Go Button, absolutely nothing happens. Is there any way to make it work, any diff to the current Firefox sources to just make the examples work? All I want to achieve is an iOS app with a single web view, opening an HTML file containing one of the simplest AR examples.

blairmacintyre commented 4 years ago

The current code is in the webxr branch of the Firefox for iOS source repo (https://github.com/mozilla-mobile/firefox-ios/tree/webxr)

It should be possible to make the current polyfill (in https://github.com/mozillareality/webxr-ios-js) work with this app, but I haven't tried. If you want to build your own app based on some code, that would be your best bet; the firefox code is far more complicated.

Noltibus commented 4 years ago

Any basic tutorials or tips on how to build a working webview containing an AR sample, ie. the teapot example?

blairmacintyre commented 4 years ago

What do you mean "build a working webview"?

Is your goal to embed a webview into another app? If so, no we don't have a tutorial; it's quite complicated. Most of this app is devoted to this, the "browser" part is pretty minimal.

Noltibus commented 4 years ago

Yes, I want to embed a webview into a basic iOS app, no other functionality is needed. Just the webview containing the teapot example. The main code of this app is devoted to it, I know, but there aren't any hints on why it is not working with the current examples, are there?

blairmacintyre commented 4 years ago

I honestly can't recall what we changed; the basic communication between the app and the javascript is the same, I suspect there are some differences in the handshaking per frame, initialization and teardown (in terms of timing). We stripped out a ton of extra code from the polyfill when we restructured it to be based on the official polyfill, and then again when we moved it to Firefox.

I'm not sure if looking through the commit history of the polyfill will help, but it may.

vithias commented 4 years ago

Slightly tangential, but are those experiments at the webxr-ios link AR only or are there also experiments demonstrating a VR view? On the immersive-web page here(https://immersive-web.github.io/webxr-samples/), the samples just bring up a dialogue that says "VR not found", as opposed to Chrome on Android, which would say "Enter VR". This happens even though the immersive-web page says that the WebXR Viewer browser is WebXR enabled(green check mark). Is this behavior expected?

Everything written above is with the most current version of the Mozilla WebXR Viewer on the App Store.

blairmacintyre commented 4 years ago

These experiments we wrote are AR only; the webxr viewer (for which they were written) only support immersive-ar mode, which is valid for WebXR (any given browser does not need to support both AR and VR -- you won't see AR on the Oculus Quest, for example).

I personally would love to have the WebXR Viewer support VR; it would be perfect feasible to do it, but having immersive VR mode that does side-by-side rendering without showing the camera video, exposes two views, and uses the AR tracker for smooth motion. If someone wanted to implement this and do a PR against https://github.com/mozillareality/webxr-ios-js we could include it!

ivnnv commented 4 years ago

sorry for the +1, but commenting for also getting notified when theres some updates on this. I will also love to have VR support on the iOS app