Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Youtube not working on current version

Post Reply
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Youtube not working on current version

Post by thefunkyjoint »

Hi,

I don't know if it's only me, but youtube videos are not playing in the current CEF version ; the audio plays but the video shows a blank screen, any youtube url / video.

Any hints ?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Youtube not working on current version

Post by salvadordf »

Hi,

I just tested some YouTube videos with BriskBard and MiniBrowser in Windows 7 and 10, and it works fine.

Please check that you have the latest drivers for your graphics card.

Long ago someone mentioned that a second graphics card caused some issues and he had to disable it.
I would also test the app in the main monitor in case you have more than one monitor.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Youtube not working on current version

Post by thefunkyjoint »

Ok, will check that.

Another strange thing i noticed, autoplay won't work on CEF4. For instance, if i navigate to the link below :

https://www.youtube.com/watch?v=lOK0-oJSx8k&autoplay=1

The video will start play as soon as the url loads. If i open the same link on TChromium, it won't start playing automatically, i need to manually click on play button.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Youtube not working on current version

Post by salvadordf »

Short answer : Set GlobalCEFApp.AutoplayPolicy to appNoUserGestureRequired and it plays the video automatically.

Long answer :
By default, GlobalCEFApp.AutoplayPolicy has a "appDefault" value which means that it doesn't add a "--autoplay-policy" switch as you can see here :
https://github.com/salvadordf/CEF4Delph ... .pas#L1569

I checked the Chromium source and they have changed the possible values for that switch :
https://chromium.googlesource.com/chrom ... witches.cc

In previous versions you could use these values for the "--autoplay-policy" switch :
  • document-user-activation-required
  • no-user-gesture-required
  • user-gesture-required
  • user-gesture-required-for-cross-origin
But now you can only use these :
  • "document-user-activation-required" : Autoplay policy that requires a document user activation.
  • "no-user-gesture-required" : Autoplay policy that does not require any user gesture.
  • "user-gesture-required" : Autoplay policy to require a user gesture in order to play.
Perhaps the default values in CEF and Chromium are different now but setting GlobalCEFApp.AutoplayPolicy to appNoUserGestureRequired fixes this issue.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Youtube not working on current version

Post by thefunkyjoint »

Great, it worked !

Thank you again ! :)
Post Reply