mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 09:14:06 +01:00
Stop image zooming on swipes and video playback on button presses. Issue #1801
This commit is contained in:
parent
f79eaf7c19
commit
e3b32847f9
@ -94,7 +94,10 @@ class WebViewController: UIViewController {
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
stopMediaPlayback()
|
||||
if let webView = webView {
|
||||
stopMediaPlayback(webView)
|
||||
cancelImageLoad(webView)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
@ -450,7 +453,8 @@ private extension WebViewController {
|
||||
guard let webView = webView else { return }
|
||||
|
||||
webView.removeFromSuperview()
|
||||
webView.evaluateJavaScript("cancelImageLoad();")
|
||||
stopMediaPlayback(webView)
|
||||
cancelImageLoad(webView)
|
||||
|
||||
webView.navigationDelegate = nil
|
||||
webView.uiDelegate = nil
|
||||
@ -559,8 +563,12 @@ private extension WebViewController {
|
||||
}
|
||||
}
|
||||
|
||||
func stopMediaPlayback() {
|
||||
webView?.evaluateJavaScript("stopMediaPlayback();")
|
||||
func stopMediaPlayback(_ webView: WKWebView) {
|
||||
webView.evaluateJavaScript("stopMediaPlayback();")
|
||||
}
|
||||
|
||||
func cancelImageLoad(_ webView: WKWebView) {
|
||||
webView.evaluateJavaScript("cancelImageLoad();")
|
||||
}
|
||||
|
||||
func configureTopShowBarsView() {
|
||||
|
Loading…
Reference in New Issue
Block a user