CefFlashBrowser icon indicating copy to clipboard operation
CefFlashBrowser copied to clipboard

请教 CefSharp 使用问题

Open mokouc opened this issue 2 years ago • 2 comments

求教大佬,我在自己的项目里使用 settings.CefCommandLineArgs["autoplay-policy"] = "no-user-gesture-required";,可是还需要手动启用插件。

.net framework 4.7.2 CefSharp 79.1.360

mokouc avatar Sep 10 '23 11:09 mokouc

这个参数是音视频的自动播放策略,添加 settings.CefCommandLineArgs["autoplay-policy"] = "no-user-gesture-required"; 允许网页的音视频自动播放,但 Flash 插件的内容不会受这个影响。 要让 Flash 内容自动播放的话我用的方法是在 IsBrowserInitializedChanged 事件中将 profile.default_content_setting_values.plugins 设为1,这样 Flash 内容就可以自动播放了,详见: https://github.com/Mzying2001/CefFlashBrowser/blob/master/CefFlashBrowser.FlashBrowser/ChromiumFlashBrowserBase.cs#L17

Mzying2001 avatar Sep 10 '23 12:09 Mzying2001

感谢大佬,看源码正好看到这了(๑•̀ㅂ•́)و✧

mokouc avatar Sep 10 '23 14:09 mokouc