CEF3 75 之后版本 Flash 不能自动播放的问题
杨小卫 2020-03-20 17:42:43 493 收藏
展开
//相关代码片段:
CefRefPtr<CefRequestContext> ClientHandler::GetRequestContext()
{
if (!shared_request_context.get()) {
shared_request_context = CefRequestContext::CreateContext(
CefRequestContext::GetGlobalContext(), new ClientRequestContextHandler2);
}
CefString error;
CefRefPtr<CefValue> value = CefValue::Create();
value->SetInt(1);
shared_request_context->SetPreference("profile.default_content_setting_values.plugins", value, error);
return shared_request_context;
}
CefBrowserHost::CreateBrowser(window_info, this, sUrl, browser_settings, NULL, GetRequestContext());
参考网址:https://magpcss.org/ceforum/viewtopic.php?p=43395#p43395
————————————————
版权声明:本文为CSDN博主「杨小卫」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/TDGX2004/article/details/104995138