Solution 1 :

Some YouTube videos use proprietary codecs and it’s not possible to play them with the CEF binaries available at Spotify.

Those CEF binaries only have open source codecs to avoid legal problems with the patent owners.

If you need to play all videos you will need to build the CEF binaries yourself with a couple of parameters to the GN_DEFINES line in the BAT scripts you can find
here.

You will need a very powerful computer, installing Visual Studio 2019 and several hours to build it. Consider adding more than 32GB of RAM because that guide is a little old and some users in the official CEF support forum reported that the latest Chromium sources need even more memory to be linked.

Problem :

I wanted to learn the CEF4Delphi component and came across a problem. CEF4Delphi does not play all videos from the YouTube site. Normal videos play normally but no live streams. Please me help in this problem. (Used: Delphi – Rad Studio 10.1 Berlin). I apologize for the English. I used machine translation google.

program Project2;

uses
  Vcl.Forms,
  WinApi.Windows,
  uCEFApplication,
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}
{$SETPEFLAGS IMAGE_FILE_LARGE_ADDRESS_AWARE}

begin

GlobalCEFApp := TCefApplication.Create;

  if GlobalCEFApp.StartMainProcess then
  begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.CreateForm(TForm2, Form2);
    Application.Run;
  end;



  GlobalCEFApp.Free;

end.

.

procedure TForm2.Button1Click(Sender: TObject);
begin
Chromium1.LoadURL('https://www.youtube.com/watch?v=dI4jr5HyuT0');
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
Chromium1.CreateBrowser(CEFWindowParent1);

end;

Attached screenshot

Comments

Comment posted by Mirza Ahmed Baig

Please make a proper title and also add a code so it will help other to understand how much efforts you have done

By

Leave a Reply

Your email address will not be published. Required fields are marked *