I have an app where users can open videos from UIWebview, including Youtube ones. In iOS7, I was able to get a notification when it started playing, or when it became full s
Swift 5.1:
NotificationCenter.default.addObserver(
forName: UIWindow.didResignKeyNotification,
object: self.view.window,
queue: nil
) { notification in
print("Video is now fullscreen")
}
NotificationCenter.default.addObserver(
forName: UIWindow.didBecomeKeyNotification,
object: self.view.window,
queue: nil
) { notification in
print("Video stopped")
}