Is there a Win32 API for Windows or a Cocoa API for Mac which detects video/audio playback?
I'm developing a desktop application that needs to be aware of the user's activity on the computer. When the app is running, if the user is actively using his computer, the app should stay dormant. If the user is away from the computer for a certain period of time, then the app should run some logic.
There is a way to detect user activity via keyboard/mouse interaction. However, if the user is passively engaged (e.g. watching a video or listening to music) without any keyboard/mouse action, then I have no way of knowing.
There is a similar question but no answer. Video playback detection with Win32 API?
Any help would be much appreciated. Thank you!