Compare commits
2
Commits
93ce2e7210
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
583ed9d006 | ||
|
|
83090a2972 |
@@ -24,6 +24,12 @@ class WebViewController : ZDViewController {
|
|||||||
let config = WKWebViewConfiguration()
|
let config = WKWebViewConfiguration()
|
||||||
config.userContentController = WKUserContentController()
|
config.userContentController = WKUserContentController()
|
||||||
|
|
||||||
|
// 允许 H5 相机预览在内联播放(iOS WebView 摄像头/WecRTC 必需)
|
||||||
|
config.allowsInlineMediaPlayback = true
|
||||||
|
if #available(iOS 10.0, *) {
|
||||||
|
config.mediaTypesRequiringUserActionForPlayback = []
|
||||||
|
}
|
||||||
|
|
||||||
// 注入环境标识
|
// 注入环境标识
|
||||||
let script = WKUserScript(source: "window.__IN_APP_WEBVIEW__ = true;", injectionTime: .atDocumentStart, forMainFrameOnly: false)
|
let script = WKUserScript(source: "window.__IN_APP_WEBVIEW__ = true;", injectionTime: .atDocumentStart, forMainFrameOnly: false)
|
||||||
config.userContentController.addUserScript(script)
|
config.userContentController.addUserScript(script)
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ open class WebViewTool : NSObject {
|
|||||||
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.managerPeople)!)?token=\((USER.token)!)"+(appending ?? ""))
|
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.managerPeople)!)?token=\((USER.token)!)"+(appending ?? ""))
|
||||||
break
|
break
|
||||||
case .gjUrl:
|
case .gjUrl:
|
||||||
vc = WebViewController(showNavBar:true, title: nil, url: "\((h5Models?.gjUrl)!)?"+(appending ?? ""), hiddenNavBarURLPaths: ["/h5/pages/order/list", "/h5/pages/invoice/list", "/h5/pages/order/detail", "/h5/pages/invoice/detail"])
|
vc = WebViewController(showNavBar:true, title: nil, url: "\((h5Models?.gjUrl)!)?"+(appending ?? ""), hiddenNavBarURLPaths: ["/h5/pages/order/list", "/h5/pages/invoice/list", "/h5/pages/order/detail", "/h5/pages/invoice/detail", "/h5/pages/invoice/form"])
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user