I have this html in my web browser control:
<html>
<body>
<video width="450" height="400" controls autoplay="autoplay">
<source src="file:///C:\Rythm\*name*.mp4" type="video/mp4">
Votre navigateur ne prend pas en charge ce format vidéo.
</video>
</body>
</html>
Of course, *name*
is replaced with the video's actual name.
The code works in chrome and IE, but not in the web browser control.
How can I fix this?
Another solution for adding a video stored on the user's hard drive to a vb.net form would alternatively also be appreciated.
The issue might be caused by that WebBrowser in VB.NET doesn't use IE 11 by default. I try to add this line in html <head>
, then it can work with WebBrowser in VB.NET:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Sample HTML code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
</head>
<body>
<video width="450" height="400" controls autoplay="autoplay">
<source src="file:///C:\Rythm\*name*.mp4" type="video/mp4">
Votre navigateur ne prend pas en charge ce format vidéo.
</video>
</body>
</html>
Result in VB.NET Form: