![]() ![]() I ultimately settled on using just a service worker in a Chrome extension to listen to tab state changes. I also considered sending periodic still-in-a-meeting messages from the content script to the background script and waiting for a timeout to indicate that I've left, but that doesn't allow for instantaneous updates, and it also fails to reset the state if Chrome is closed before the timeout occurs. Sounds easy enough, right? Extensions even have a nice feature allowing you to run code whenever a page matches a certain URL pattern! This works great for knowing that I'm in a meeting, but then how do I detect if I've left? window.onunload seems useful on the surface but isn't reliable enough. So ultimately I gave up on that approach and settled on a more naive solution - create a Chrome extension that detects whether a meeting is active. The closest I got was using this Golang library - it gives the correct state of the hardware at first, but subsequent checks within the same process fail to detect state changes, and I don't know enough Objective C and MacOS API internals to figure out the solution. ![]() It turns out this isn't easy to do with MacOS. My first idea was to detect whether the camera or microphone was in use so my solution would work with any conferencing software. ![]() The solution: build my own "On Air" light that turns on/off automatically when I'm in a meeting! Sure, there are commercially-available products that do exactly this, but where's the fun in buying something when I have the skills and equipment to build my own? Just how hard could it be? (famous last words) False Starts Like any good project, this one started with a problem: how do I let my wife know I'm in a meeting so she doesn't let the dog barge in? (I work remotely and my office is the only way to get to the backyard.) ![]()
0 Comments
Leave a Reply. |