I am trying to do a simple way of playing a youtube video and getting it back as a Stride Texture. One simple way is to use VL.CEF and render the Stride texture.
I convert the URL of the youtube video from something like:
This was pretty interesting. Didn’t know there was a media engagement score (just open about://media-engagement in any chrome-based browser).
Okay, so it seems like CEF/Chromium needs some sort of user interaction unless you start it with commandline arguments.
So the question would be if VL.CEF can somehow start chromium with that commandline parameter and since CEF is often used with no user interaction possible, if it shouldn’t be the default?
You can put “command_line->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required");“ inside OnBeforeCommandLineProcessing,I verified it and it succeeded.
Maybe this can be exposed in VL.CEF similar to how you can SetAudioMuted.
Yeah okay, so you can get it to work with my example above if you add “&mute=1” as an argument to the URL. It then autoplays the video, which would be fine.
Now the issue seems that CEF can’t actually play youtube videos properly. It plays like the first frame, then another frame like 2 seconds later and then just gives up.
Okay, seems like enabling Shared Texture fixes it. Strange that something like https://www.testufo.com/ runs at around 50fps even with Shared Texture off (and around 100fps with it on), but for a Youtube video it runs at like 3 frames total. Can’t even put it in fps, since it literally will render around 3 frames and then stop.
Well if it’s a web kiosk I’ve would suggest to use C# UWP instead. I made few apps a month ago without that much issues… you can even block the urls with some navigation starting event… They have this webview2 that uses chromium… The only problem there is to remove window header, but that also possible to suppress…
@antokhio I am only using the texture and ideally the sound of the playing youtube videos. There is no user interaction, so I need the videos to autoplay in fullscreen. Youtube videos are just an alternative source to playing videos from files in our application.
It’s basically working okay now with shared texture enabled, but I have to start the videos with mute=1 so they autoplay. If I could get CEF to set the autoplay policy, which apparently is possible with a command line argument, I guess it would work fine. But I have not seen a way to pass that argument using VL.CEF.
Sorry for replying so late. It should’ve been possible to pass that command line argument to vvvv.exe itself, for example vvvv.exe --autoplay-policy=no-user-gesture-required should do the trick, since we currently pass all arguments to CEF itself.
In any case, upcoming builds of VL.CEF will add this flag internally as you suggested so there will be no need to pass it manually and your example should just work.