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?
inotifywait -mqe create /tmp. – grawity Nov 6 '11 at 17:45inotifywaitis supposed to die when the video starts, right? It doesn't do so here.) – Daniel Wagner Nov 6 '11 at 18:10-mmakes it monitor continuously:$ inotifywait -mqe create /tmp→/tmp/ CREATE FlashXXlanUc5, when playing that video. – grawity Nov 6 '11 at 18:26lsof -p <pid>, where<pid>is frompgrep -lf chromium | grep flash. – grawity Nov 6 '11 at 19:30