MPlayer GUI (gmplayer - NOT gnome-mplayer) single instance fix...
So I finally made the leap to a single media player. Long gone are the days of VLC + MPlayer + Xine-UI + XMMS + whatever... why bother? MPlayer (or more properly stated, its 'stock' GUI) has come well far enough that it serves as an all-in-one without repute.
So... enter my issue. Every time I click on a music of movie file, bang, a new unique instance of the MPlayer GUI is launched, leaving me with two songs playing at once, or a song and a movie, etc... etc... So, I putz around through the manpage, looking for an answer. There is none; and the wiki states that it is a 'known issue'. The spin-off Gnome MPlayer front end (command is gnome-mplayer rather than gmplayer), has a 'single instance' flag that can be used, however it simply blocks you from opening a second file, rather then enqueing and auto-playing the second file clicked (whilst stopping the first one). So, it was of no help. Then, it dawned on me... simple is simple is simple is... stupid? gmplayer-hack.sh Code:
#!/bin/bash I then proceeded to smack myself on the forehead and become ashamed for not having thought of it earlier. I post this here for posterity, as hopefully someone else looking for the "mplayer gui prevent multiple instance or instances" fix will find it, as I searched Google to no avail for a good half hour before realizing the folly. Enjoy, - Vince. |
Quite dirty, but simple and effective. Nice job man! :P
|
The big problem there is that you can only play one file at a time with it, and you can't pass it any other options.
Changing item_to_play=$1 to item_to_play="$@" will help correct that. Even shorter: killall -9 gmplayer && gmplayer. You can set it up as an alias too. But I personally don't see how you can think it's possible to go with a single player yet. I still run across videos that will only work correctly in one player or another. There's just too much variability involved in multimedia for any one solution to be able to handle them all. |
works great but !!!!
this script working great but if your video file name contain any spaces it wont play it !!
how to fix that ? |
Quote:
Code:
#!/bin/bash |
poweredbydodge thanks man >>>> your script working great .
|
All times are GMT -5. The time now is 11:34 PM. |