Be more than mobile, reach every Windows screen
Reach millions of players across phone, PC, and Xbox One
The Internet of your things
The world's most personal digital assistant
I am using Visual C# Express 2010 and the webBrowser object to navigate to the following HTML5 web page:
<!-- saved from url=(0016)http://localhost -->
<!-- the above line fixes the comment: -->
<!-- internet explorer restricted this web page from running scripts or ActiveX controls -->
<title>Simple Video Example</title>
var ip = document.getElementById('myVideo'); //text box
var v = document.getElementById('v1'); //video element
v.src = ip.value;
var v = document.getElementById('v1');
<video id="v1" style="width:25%" controls="controls" >Video tag is not supported</video>
<input type="text" id="myVideo" size="60" />
The machine runs Windows 7, the browser I use is IE9. The webBrowser object is 9.0.8112.16430.
Although this page runs fine on the IE9 browser (outside of the VC# 2010 Forms app) when I run it using the webBrowser object in VC# 2010 I see the following error:
Object doesn't support property or method 'play' when I click the play button.
Can you please tell me how I can fix this?
Thats because the WB control uses IE7Emulation mode (by default) and does not recognise html5 or <video> tag attributes and methods. (document.documentMode)
If you also examine its userAgent string (navigator.userAgent) you will see that it is also using the IE7 userAgent String and version vector.
see http://msdn.microsoft.com/en-us/library/ms537184(v=vs.85).aspx for instructions to add a feature control entry to allow your WB control to use the IE9 DocumentMode and
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?