I like to turn my music off when I start watching Flash videos. It used to be that Flash videos were cached in
/tmp, so I could watch for them with inotify:
sorghum:~% incrontab -l /tmp IN_CREATE /home/dmwit/.scripts/flash_movie_start $# sorghum:~% cat .scripts/flash_movie_start #!/bin/sh case "$1" in Flash*) mpc pause ;; esac
This recently stopped working (at least for YouTube, though some other video sites do still seem to trigger this). After digging around online, I think this may be because YouTube has recently switched over to using RTMP, which doesn't store a cache on disk anywhere.
Is there a way to detect when a browser starts retrieving an RTMP stream?