Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教 CefSharp 使用问题 #29

Open
mokouc opened this issue Sep 10, 2023 · 2 comments
Open

请教 CefSharp 使用问题 #29

mokouc opened this issue Sep 10, 2023 · 2 comments

Comments

@mokouc
Copy link

mokouc commented Sep 10, 2023

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

.net framework 4.7.2
CefSharp 79.1.360

@mokouc mokouc changed the title CefSharp使用问题 请教 CefSharp 使用问题 Sep 10, 2023
@Mzying2001
Copy link
Owner

这个参数是音视频的自动播放策略,添加 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

@mokouc
Copy link
Author

mokouc commented Sep 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants