Hello.
If I am load web site with movies using WKWebView and then press on player in website content will be open in some player above WKWebView, It is possible detect when this player is open or close?
Or if it's impossible I can detect when user press on player and then catch iframe of web element like that
and then open inside UIView or something else above WKWebView.
For clarity I am attach url with image of this player
Regards, Ihor.
If I am load web site with movies using WKWebView and then press on player in website content will be open in some player above WKWebView, It is possible detect when this player is open or close?
Or if it's impossible I can detect when user press on player and then catch iframe of web element like that
Code Block <iframe src="URL of player" width="560" height="315" frameborder="0" allowfullscreen></iframe>
and then open inside UIView or something else above WKWebView.
For clarity I am attach url with image of this player
Code Block https://ibb.co/y69tQ6c
Regards, Ihor.
I am solved this problem using NotificationCenter using UIWindowDidBecomeVisibleNotification & UIWindowDidBecomeHiddenNotification.
Example of my code.
If somebody know another way glad to hear your answer.
Example of my code.
Code Block override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(onDidEnterFullscreen(_:)), name: UIWindow.didBecomeVisibleNotification, object: view.window) NotificationCenter.default.addObserver(self, selector: #selector(onDidLeaveFullscreen(_:)), name: UIWindow.didBecomeHiddenNotification, object: view.window) } @objc func onDidEnterFullscreen(_ notification: Notification) { print("Enter Fullscreen") } @objc func onDidLeaveFullscreen(_ notification: Notification) { print("Leave Fullscreen") }
If somebody know another way glad to hear your answer.