Xromium Embedded Framework MP3 Support

I downloaded the Xromium Embedded Framework r306 for Windows and built it. Unfortunately, it shows that it does not support mp3:

<script> var a = document.createElement("audio"); document.write(a.canPlayType('audio/mpeg')); </script> 

The output is empty, and when I try to open an mp3 file, it cannot be played (ogg is playing).

The same time that Google Chrome writes “maybe” (and it actually plays).

How to add MP3 support to CEF?

+8
mpeg mp3 chromium chromium-embedded
source share
6 answers

NOTE: PLEASE REVIEW LEGAL ISSUES BEFORE THE PROCEDURE

There is a way to enable MP3 support in CEF, but you will need to modify cef.gypi in the original distribution, restore the visual studio projects and rebuild.

Step by step instructions:

enter image description here enter image description here a enter image description here enter image description here a enter image description here enter image description here

+5
source share

Marshall Greenblatt (developer of the Chromium Embedded Framework ) refers to the lack of MP3 (and AAC) support in Chromium and CEF in this bug report (see comment No. 7 copied below):

Codecs such as MP3s and AACs are included in Google Chrome releases, but not for Chromium. This is due to the fact that these formats are not open and require licensing. Distributing these codecs with your application without a license agreement may violate the law in some countries. You should discuss with a lawyer if necessary.

+10
source share

There is a way to enable MP3 support in CEF, but you will need to modify cef.gypi in the original distribution, restore the visual studio projects and rebuild.

Detailed assembly instructions:
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding

Enabling proprietary codec support:
http://code.google.com/p/chromiumembedded/issues/detail?id=371

Add "proprietary_codecs": 1 to the cef.gypi configuration so that USE_PROPRIETARY_CODECS is determined by the request net / base / mime_util.cc.

You will also need the correct builds of avcodec, avformat and avutil dll. Fortunately, you can simply get them from the installation directory of Google Chrome itself ($ User / AppData / Local / Google / Chrome / $ Version).

+6
source share

Only MP3 codec is supported. When building in Google Chrome, install chrome codec support .

On the client side, Flash may be a compatible way, check the Google translation code.

+1
source share

I followed the steps in null1941's answer and they did a great job, with the exception of a few caveats related to modifying the build.ps1 script

 step 16 e. search for any instances of 3.yz and replace them with the current version you are building (from the folder name containing the builds ex. 3.2272.32.gbda8dc7). in function DownloadNuget it is trying to see if you have nuget in a specific place and if it isn't there it tries to go get it. Problem is DownloadFile would fail if the save directory didn't already exist. so you can manualy create or add this to the function: $Nuget_dir = Join-Path $env:LOCALAPPDATA .\nuget if(-not (Test-Path $Nuget_dir)) { mkdir $Nuget_dir } change line: "Copy-Item $Cef64\include $CefInclude -Recurse | Out-Null" to use $Cef32 if you don't have 64bit cef folders 
+1
source share

proprietary codecs enable parameters (i.e. H.264 and MP3) have been carried over since the last response.

you can read my answer with all the details on how to compile CEF with proprietary codecs enabled

now the magic happens here:

 set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome 

There are 2 batch files you need to update / create (as found here ):

C: \ code \ chromium_git \ update.bat:

 set CEF_USE_GN=1 set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome set GN_ARGUMENTS=--ide=vs2015 --sln=cef --filters=//cef/* python ..\automate\automate-git.py --download-dir=C:\code\chromium_git --depot-tools-dir=C:\code\depot_tools --no-distrib --no-build 

C: \ code \ chromium_git \ chrome \ SRC \ CEF \ create.bat:

 set CEF_USE_GN=1 set GN_DEFINES=is_win_fastlink=true proprietary_codecs=true ffmpeg_branding=Chrome set GN_ARGUMENTS=--ide=vs2015 --sln=cef --filters=//cef/* call cef_create_projects.bat 

There are 2 wiki articles that explain how to create CEF / Chromium:

+1
source share

All Articles