autoplay-policy not working for html5 video tag
Posted: Thu Jul 29, 2021 12:13 am
I have a video tag with "autoplay" option, and I want to CEF start playing this video without user interaction.
I know about chrome restrictions, and already use "--autoplay-policy=no-user-gesture-required" command line option. For html5 audio tag, or youtube video this option is help, but not for html5 video tag.
Application type: Offscreen.
This is my CefSettings:
This is example of the html page:
I also tried to playing this page from the chrome browser, and autoplay is worked (If chrome started with --autoplay-policy=no-user-gesture-required option).
I know about chrome restrictions, and already use "--autoplay-policy=no-user-gesture-required" command line option. For html5 audio tag, or youtube video this option is help, but not for html5 video tag.
Application type: Offscreen.
This is my CefSettings:
- Code: Select all
var cefSettings = new CefSettings
{
RootCachePath = cache,
CachePath = cache,
CefCommandLineArgs = { ["disable-gpu-shader-disk-cache"] = "1", ["autoplay-policy"] = "no-user-gesture-required" },
CommandLineArgsDisabled = true,
WindowlessRenderingEnabled = true
};
This is example of the html page:
- Code: Select all
<html>
<header></header>
<body>
<video autoplay controls>
<source src="video.mp4">
</audio>
</body>
</html>
I also tried to playing this page from the chrome browser, and autoplay is worked (If chrome started with --autoplay-policy=no-user-gesture-required option).