summaryrefslogtreecommitdiffstats
path: root/bin/flash
diff options
context:
space:
mode:
Diffstat (limited to 'bin/flash')
-rwxr-xr-xbin/flash21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/flash b/bin/flash
new file mode 100755
index 0000000..6cee48d
--- /dev/null
+++ b/bin/flash
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Play flash videos in mplayer
+# https://bbs.archlinux.org/viewtopic.php?pid=901228#p901228
+
+# The original: works only when there is only one plugin-container process
+# mplayer $(d=/proc/$(pidof plugin-container)/fd; ls --color=no -l $d | gawk '/\/tmp\/Flash/ {print "'$d'/" $9}' )
+
+videos=
+for pid in $(pidof plugin-container)
+do
+ d=/proc/$pid/fd
+ videos="$videos $(ls --color=no -l $d | gawk '/\/tmp\/Flash/ {print "'$d'/" $9}')"
+done
+
+if [ "$videos" ]
+then
+ mplayer $videos
+else
+ echo 'No Flash is loaded'
+ exit 1
+fi