Home

Default video player in Linux

Just a quick memo on how to make mplayer the default videoplayer in Linux:

xdg-mime default mplayer.desktop application/vnd.rn-realmedia application/x-extension-mp4 application/x-flash-video application/x-matroska application/x-quicktime-media-link application/x-quicktimeplayer text/google-video-pointer text/x-google-video-pointer video/3gpp video/dv video/fli video/flv video/mp4 video/mp4v-es video/mpeg video/msvideo video/quicktime video/vivo video/vnd.divx video/vnd.rn-realvideo video/vnd.vivo video/x-anim video/x-avi video/x-flc video/x-fli video/x-flic video/x-m4v video/x-matroska video/x-mpeg video/x-ms-asf video/x-msvideo video/x-ms-wm video/x-ms-wmv video/x-ms-wmx video/x-ms-wvx video/x-nsv video/x-ogm+ogg video/x-theora+ogg

This of course depends on your system actually having a desktop file for MPlayer (which the mplayer-nogui package in Ubuntu doesn't), so if your system doesn't have it (check /usr/share/applications/), you can copy the following to .local/share/applications/mplayer.desktop in your home directory:

[Desktop Entry]
Version=1.0
Type=Application
Encoding=UTF-8
Name=MPlayer
Comment=Play multimedia files and media
GenericName=Media Player
Exec=mplayer %U
Icon=mplayer
NoDisplay=true
MimeType=application/vnd.rn-realmedia;application/x-extension-mp4;application/x-flash-video;application/x-matroska;application/x-quicktime-media-link;application/x-quicktimeplayer;text/google-video-pointer;text/x-google-video-pointer;video/3gpp;video/dv;video/fli;video/flv;video/mp4;video/mp4v-es;video/mpeg;video/msvideo;video/quicktime;video/vivo;video/vnd.divx;video/vnd.rn-realvideo;video/vnd.vivo;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-ms-asf;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg;

Afterwards, you might need to run

update-desktop-database ~/.local/share/applications

and log out and in again.... mimetypes are a bit magic...

« The future of Ubuntu and the desktop internetWindows are for breaking »
There are  on this post. Add yours?
By activating and using the Disqus feedback service, you agree to their privacy policy.