#ios #swift #webkit #wkwebview #360-virtual-reality
#iOS #swift #webkit #wkwebview #360-виртуальная реальность
Вопрос:
Я создаю приложение виртуальной реальности, которое использует изображения с разрешением 360 градусов. Это приложение показывает изображения с помощью HTML. WKWebView позволяет определять ориентацию устройства.
webView.uiDelegate = self
Можно показывать изображения со всеми направлениями.
Тем не менее, он показывает белое квадратное поле для отображения содержимого. И коснитесь этого квадрата, появится видеодиспетчер. Затем нажмите кнопку закрытия «X», этот квадрат исчезнет, и содержимое будет запущено.
Ниже приведено сообщение об ошибке, когда я запустил это приложение на симуляторе.
2020-10-05 14:03:00.220288 0900 WebViewButton[70653:4552750] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}>
2020-10-05 14:03:00.220599 0900 WebViewButton[70653:4552750] [ProcessSuspension] 0x106df57e0 - ProcessAssertion: Failed to acquire RBS MediaPlayback assertion 'WebKit Media Playback' for process with PID 70655, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}
2020-10-05 14:03:00.222371 0900 WebViewButton[70653:4552750] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}>
2020-10-05 14:03:00.225196 0900 WebViewButton[70653:4552750] [ProcessSuspension] 0x106df5810 - ProcessAssertion: Failed to acquire RBS MediaPlayback assertion 'WebKit Media Playback' for process with PID 70653, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}
2020-10-05 14:03:03.652871 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b09fe0> - changing property masksToBounds in transform-only layer, will have no effect
2020-10-05 14:03:03.653989 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b17200> - changing property masksToBounds in transform-only layer, will have no effect
2020-10-05 14:03:03.658501 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b0a520> - changing property masksToBounds in transform-only layer, will have no effect
2020-10-05 14:03:03.663858 0900 WebViewButton[70653:4552750] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003b0a7e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-10-05 14:03:03.704443 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b07a40> - changing property masksToBounds in transform-only layer, will have no effect
2020-10-05 14:03:03.706753 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b0b340> - changing property masksToBounds in transform-only layer, will have no effect
2020-10-05 14:03:03.727357 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b0a520> - changing property allowsGroupBlending in transform-only layer, will have no effect
2020-10-05 14:03:03.727779 0900 WebViewButton[70653:4552750] <CATransformLayer: 0x600003b07a40> - changing property allowsGroupBlending in transform-only layer, will have no effect
Говорят, что нет ресурсов MediaPlayback.
Что? Для этого не нужен Madiaplayer.
Как удалить этот белый квадрат? Как отключить MediaPlayback?
Ниже приведен исходный код
import UIKit
import WebKit
class WebViewController: UIViewController, WKNavigationDelegate, WKUIDelegate {
@IBOutlet weak var webView: WKWebView!
@IBOutlet weak var backBtn: UIButton!
var rcvURL="" //Contents URL
override func viewDidLoad() {
super.viewDidLoad()
webView.uiDelegate = self // enable to get omni direction sensor
webView.navigationDelegate = self
openUrl(urlString: rcvURL)
}
/** BackButton **/
@IBAction func back(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
/** Open Contents URL **/
func openUrl(urlString: String) {
let url = URL(string: urlString)
let request = NSURLRequest(url: url!)
webView.load(request as URLRequest)
}
}
- эта среда:
Xcode12.0.1
iOS 14.0.1 (iPhoneXR)
Swift 5.3
Комментарии:
1. вы нашли какое-либо решение?
2. да. пожалуйста, обратитесь к ответу. Вам также может потребоваться установить флажки «Для воспроизведения звука» и «Для воспроизведения видео».
Ответ №1:
Комментарии:
1. Где я могу найти этот экран «Инспектор WebView»? Это где-то в Xcode?
2. Это должно быть помечено как принятый ответ. И @MichM , вы найдете его в раскадровке . выберите webview и на правой панели под «вкладка инспектора атрибутов»