0

I am writing HTML from a WinForm to a WebBrowser control. I initialize the control by navigating to about:blank. The issue I am having is trying to display a video in the application's folder. The HTML I am writing is below

<video controls style='width: 200px;height: 151px;'>
    <source src='C:\Users\SomeUser\MyAppFolder\Media\media.mp4' type='video/mp4'>
    <object data='C:\Users\SomeUser\MyAppFolder\Media\media.mp4'>
        <embed src='C:\Users\SomeUser\MyAppFolder\Media\media.mp4' type='video/mp4'>
    </object>
</video>

This WinForm is using .NET 4.0 and needs to be compatible with WinXp. I can see that the HTML would fall to the embed tag. If I put an html page in the app folder and open it with IE using only

<embed src='C:\Users\SomeUser\MyAppFolder\Media\media.mp4'>

I get the ActiveX warning Internet Explorer restricted this webpage from running scripts or ActiveX controls and there is a button to allow blocked content, which I am guessing is the problem within the control. Is it possible to work around this?

Humayun Shabbir
  • 2,961
  • 4
  • 20
  • 33
Mike_G
  • 16,237
  • 14
  • 70
  • 101
  • What ActiveX warning? The one that warns the user that you want to run executable code in their browser? AFAIK there's no way to work around that. – Robert Harvey Jul 28 '14 at 20:17
  • @RobertHarvey I have updated the post with the error. – Mike_G Jul 28 '14 at 20:20
  • It's a feature, not a problem. You might be able to work around it by having the user turn off the security feature in their browser, but that's not a very good idea. – Robert Harvey Jul 28 '14 at 20:21
  • I figured that, but I also hoped there would be a way to designate content displayed within my app as trusted. – Mike_G Jul 28 '14 at 20:22
  • http://stackoverflow.com/q/2476360 – Robert Harvey Jul 28 '14 at 20:23
  • With ScriptErrorsSuppressed set to True or False it still doesn't show the button to "allow blocked content". And my issue isn't with errors, its that it doesn't display anything but an empty media player – Mike_G Jul 28 '14 at 20:26

0 Answers0