added mozplugger package
[hdw-linux/hdw-linux.git] / packages / multimedia / mozplugger / mplayer_plugin
diff --git a/packages/multimedia/mozplugger/mplayer_plugin b/packages/multimedia/mozplugger/mplayer_plugin
new file mode 100755 (executable)
index 0000000..083d947
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh 
+# original by: sammy umar
+# small modifications to leave mplayer untouched
+
+# store argument 
+argument="$*" 
+# check to see if argument contains http 
+http=`echo $argument | grep http -` 
+# for remote/local files do things differently 
+if [ "$http" != "" ]; then 
+# obtain all the options until the filename/path 
+  options=${argument%http*} 
+# get the filename 
+  file=${argument#*http} 
+# extract the extension 
+  ext=${file##*.} 
+  if [ "$ext" = "asx" ]; then 
+    mplayer $options -playlist http$file 
+  else 
+    mplayer $*
+  fi 
+else 
+# if local just do the command line 
+  mplayer $* 
+fi