I have a standard WebBrowser
Control that has been modified to use IE11 in Edge Mode (see here for details for how I did that).
I am unable to play Flash content on some websites, a notable one being BBC iPlayer and other media requiring Flash served on the BBC website, for which I receive the following error:
There was a problem initialising the player.
Script access is denied in your browser.
I am able to view this content using Internet Explorer, and script access is enabled within IE. Errors are suppressed in the WebBrowser
control by setting ScriptErrorsSuppressed
property to true, even when set to false I am still unable to view media on the BBC website.
I have Flash version 17,0,0,188 installed (latest version as of writing this).
How can I view BBC iPlayer using the WebBrowser
control?
Update:
I tested this using a computer that had Flash 15 installed and BBC iPlayer and media worked. So the issues lies with this version of Flash, I guess?
The general consensus on this issue is that it is a long-lived Flash bug that seems like they will never address. You can get a little more info at this link:
http://blogs.msdn.com/b/johan/archive/2009/08/06/problems-with-flash-content-in-the-webbrowser-control.aspx
It comes down to caching cross-domain ActiveX controls. I have yet to get this to be fully resolved, but have found that setting some feature settings in the registry for the WebBrowser control have helped.
The main setting that seems to affect this for me is:
SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_OBJECT_CACHING
SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_OBJECT_CACHING
MSDN: https://msdn.microsoft.com/en-us/library/ee330729(v=vs.85).aspx#object_caching
I set both of those to '0' through group policy. I end up having 4 entries as I do it for both the HKCU and HKLM hives (probably not needed, but I'm trying everything).
I have also done the usual 'FEATURE_BROWSER_EMULATION' set to 11000 in order to use IE11.
MSDN: https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation
There's also this setting that supposed to filter out IE caches:
Software\Microsoft\Windows\CurrentVersion\Internet Settings\MimeExclusionListForCache
Appending 'application/x-shockwave-flash' should prevent caching of flash objects, but I haven't seen that help out anything.
These are some Group Policy settings that I've also applied:
One day I went a little crazy and attempted changing all settings to test. Here's a screenshot of the registry settings I modified through Group Policy:
Even after all this work, I can only get videos from facebook (the one I use to test) to load once and subsequent videos fail. Restarting the application, though, seems to work. This isn't acceptable, but it's all I can achieve at the moment.
Some mention that clearing the cache on navigation solves the issue, but I haven't pursued that approach as I believe it will slow down the browsing experience. This approach might work well if you only clear cached flash objects, but again, not something I have tested.
I prefer to just clean up swf files from IE Cache each time I start the control and load a page with flash activated content:
private void ClearCachedSWFFiles()
{
try
{
var cachefolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
"\\Microsoft\\Windows\\INetCache\\IE";
var dirinfo = new DirectoryInfo(cachefolder);
foreach (var directoryInfo in dirinfo.GetDirectories())
{
foreach (var fileInfo in directoryInfo.GetFiles("*.swf"))
{
fileInfo.Delete();
}
}
}
catch (Exception ex)
{
throw ex;
}
}