Installing Media Codecs in Ubuntu
Open Terminal / Knosole and run
sudo apt-get update
sudo apt-get install ubuntu-restricted-extras
Or
sudo apt-get update && sudo apt-get install ubuntu-restricted-extras
After running commands above it will ask for your root password, provide your root password and hit enter, it will automatically download and install all codecs. Once install you will able to play almost all format and if something missing then try installing universal player VLC by running command below
sudo apt-get install vlc