简体   繁体   中英

How to find out if the video is currently playing in full screen on OS X

We have an application for Mac OS X that needs to know when the user is watching a movie in full screen to change its behavior.

Is there any system programmatic "hooks" that allow native Objective-C application to know when fullscreen playback is started?

You can get a list of all windows by using the CGWindow API, like in the Son of Grab sample.

From there, you can look at the window levels to figure out which windows are full screen, but I am not aware of any way to look for video playback specifically, as different apps (VLC, QickTime Player) all use slightly different methods. Of course, you could hard code specific process names, and assume that they are doing video playback if they have a fullscreen window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM