简体   繁体   中英

AFrame VR experience in iOS app using UIWebview?

Is there a way to pack an AFrame webVR experience into an iOS AppStore application? using UIWebView or the like? Would it work fully with "VR/cardboard/accelerometers" or only with the users "dragging the 360 3D scene with fingers touches" to look around?

Or is there all sorts of fluctuating iOS/AppStore restrictions that makes it impossible or impractical?

UIWebView is deprecated, you can do it with a WKWebView, something like this:

webView = WKWebView(frame: .zero, configuration: WKWebViewConfiguration())
webView?.frame = containerView.bounds
webView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
webView?.scrollView.isScrollEnabled = true
webView?.configuration.requiresUserActionForMediaPlayback = false
webView?.configuration.allowsInlineMediaPlayback = true
webView?.configuration.preferences.javaScriptEnabled = true
webView?.configuration.preferences.javaScriptCanOpenWindowsAutomatically = true
webView?.navigationDelegate = self
webView?.uiDelegate = self

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM