I've downloaded Chromium Embedded Framework r306 for Windows and built it. Unfortunately, it shows, that it doesn't support mp3:
<script>
var a = document.createElement("audio");
document.write(a.canPlayType('audio/mpeg'));
</script>
Output is empty and when I try to open an mp3 file, it can't be played (ogg is playable).
The same time Google Chrome writes "maybe" (and it actually plays).
How can I add support for MP3 in CEF?
the options to enable
proprietary codecs
(i.e. H.264 and MP3) have been moved since the last answer.you can read my answer with all the details on how to compile CEF with enabled
proprietary codecs
the magic now happens here:
there is 2 batch files that you should update/create (as found here):
c:\code\chromium_git\update.bat:
c:\code\chromium_git\chromium\src\cef\create.bat:
There is 2 wiki articles that explain how to build CEF/Chromium:
BranchesAndBuilding
in the same wikiI followed the steps in null1941's answer and they worked great save a few caveats having to do with modifying the build.ps1 script
MP3 codec only be supported When build to Google Chrome, check chromium's Codec Support.
On client side, the compatible way may be Flash, check google translate's code.
Marshall Greenblatt (the maintainer of the Chromium Embedded Framework) addresses the lack of support for MP3 (and AAC) in Chromium and CEF in this bug report (see comment #7, copied below):
NOTE: PLEASE CONSIDER LEGAL ISSUES BEFORE PROCEEDING
There is a way to enable MP3 support in CEF, but you'll have to modify the cef.gypi in the source distribution, regenerate the visual studio projects and rebuild.
Step by step instructions:
a
a
There is a way to enable MP3 support in CEF, but you'll have to modify the cef.gypi in the source distribution, regenerate the visual studio projects and rebuild.
Detailed build instructions:
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
Enabling proprietary codecs support:
http://code.google.com/p/chromiumembedded/issues/detail?id=371
You'll also need proper builds of the avcodec, avformat and avutil DLLs. Luckily, you can just get these from the installation directory of Google Chrome itself ($User/AppData/Local/Google/Chrome/$Version).