Opening files in MPlayer through nautilus

Posted in Linux, gnome by sandaruwan on November 26th, 2007

There is no doubt that MPlayer is one of most amazing players around. Specially considering that it’s capability of handling all sort of codecs. I was a happy mplayer user until I upgraded MPlayer to 1.0rc2-4.1.3. After the upgrade when a file is opened via nautilus, it gives me an error message, “file://…..” cannot be opened. Opening the file via terminal worked perfectly. So, the problem was nautilus is sending the Gnome-VFS url of the file to mplayer and mplayer is not capable of handling URL, rather it needs a direct file path.

Thanks to some recent project I was pretty aware of “.desktop” files. The “.desktop” files are used by the desktop environment to get the list of available applications. So does in nautilus’ “open with” section. So, simply editing the “/usr/share/applications/mplayer.desktop” file and changing the Exec value from “gmplayer %U” to “gmplayer %F” solved the problem. Read the freedesktop spec for more information on Exec parameters.

6 Responses to “Opening files in MPlayer through nautilus”

  1. R Says:

    Don’t know whether it works for Linux but VLC player is quite simply awesome in Windows. Haven’t found any clip that it couldn’t play.

    November 26th, 2007 at 3:50 pm

  2. sandaruwan Says:

    It’s same in linux, VLC is awesome for just playing, but MPlayer comes with menconder and supports various command line arugment, keyboard control, blah blah.. However, considering just codecs, both have their unique ways of implementing those, and both works quite well.

    November 26th, 2007 at 6:19 pm

  3. Vasco Says:

    Thank you so much I’ve been looking for this for some time, I already knew what the problem was but didn’t know the best way to solve it.

    But I still have another one:
    Edit the gnome menu (right click in the menu) go to mplayer’s launcher and do the same edit “gmplayer %U” to “gmplayer %F”.

    At first it doesn’t make much sense but it will overload the mplayer main launcher by creating mplayer’s .desktop in “~/.local/share/applications/”.

    It works only for one user but it has less changes on the system (which I avoid).

    December 15th, 2007 at 7:36 pm

  4. AnRkey Says:

    Thanks for the tip! It works nicely now. I still have one small problem though. Every time I double click a new song, mplayer opens a new instance instead of using the already open instance to switch to the new song. Do you have any ideas?

    AnRkey

    December 29th, 2007 at 2:29 pm

  5. sandaruwan Says:

    Hello AnRkey,

    I’m not sure about this solution, may be “-enqueue” option will help you.

    Regards,
    Sandaruwan

    December 29th, 2007 at 6:09 pm

  6. Seymore Says:

    Brilliant. I love google and you in equal measure :-)

    January 5th, 2008 at 5:10 pm

Leave a Reply