0

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!

  • This looks like a duplicate of that question that you link to – David Heffernan Oct 16 '18 at 20:05
  • It's a duplicated question. – E.Coms Oct 16 '18 at 20:22
  • Yeah the question from the link is similar but it's specific to Windows only. I'm looking for a way that works for both Windows and Mac. And there is no answer other than comments although it's from 5 years ago, so I was wondering if we now have a way with advances in technology :) – Dongyon Kang Oct 17 '18 at 20:46
  • It looks like there's a way for Windows https://stackoverflow.com/questions/45422255/determine-if-windows-is-currently-playing-sound This works for both audio and video. Now I just need a way for macOS. – Dongyon Kang Oct 18 '18 at 00:44

0 Answers0