[MPlayer-users] auto play DVD's and .avi CD's
Thomas Lübking
thomas.luebking at web.de
Wed Jun 11 00:37:59 CEST 2003
Am Dienstag, 10. Juni 2003 20:00 schrieb Carl Karsten:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Has anyone come up with a way to launch mplayer when a DVD movie is put in,
> or a CD with an .avi file in the root?
>
> Carl K
I'm not sure, why you want to do this, but you could use some shellscript like
this:
==========================================================
#! /bin/sh
# this is a simple stupid script to scan the device (or better the mountpoint)
# given with the first argument for containing .avi files.
# if so, it starts mplayer and enqueues all contained .avi files
#
# License: this is absolutely unworthy to be distributed under any license or
# claim some copyright and or -left
# as long as we live...
while true;
# check given drive every 5 seconds for inserted disk
do while ! mount $1; do sleep 5; done
# echo "Disk found";
# if the disk contains .avi files...
if ls $1/*.avi; then
# start mplayer with them
# edit this line for mplayer settings, e.g. start gmplayer or add any options
you wish to have
mplayer -enqueue $1/*.avi; fi
done
==========================================================
it will at least autoplay, if you insert a disk with one (or more) avi files
in the root. i regretfully do not know, how to check for an inserted dvd...
hope this helped a bit
thomas
ps:
1. this is very like a daemon - it won't stop by itself
2. you won't be able to umount (obviously) - use eject instead
3. start with the mountpoint of your drive as first argument
More information about the MPlayer-users
mailing list