Embed html5 video in browser control
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- klishb-morrisville
- Posts: 17
- Last visit: Thu Jan 11, 2024 12:08 pm
Embed html5 video in browser control
I'm creating a GUI with treeview navigation and a browser object on the right. I'm trying to embed local mp4 video in the browser object, but it doesn't appear to be supported. Any way to accomplish this? Seems like it should be possible with HTML5 being the standard at this point.
- klishb-morrisville
- Posts: 17
- Last visit: Thu Jan 11, 2024 12:08 pm
Re: Embed html5 video in browser control
If I link to Youtube it seems to play HTML5 video just fine. That tells me it's possible, but maybe I'm not embedding the video correctly in the HTML.
- klishb-morrisville
- Posts: 17
- Last visit: Thu Jan 11, 2024 12:08 pm
Re: Embed html5 video in browser control
The browser object points to a different html page and that draws correctly. Within that page I put a hyperlink to another page that is this:
<!DOCTYPE html>
<html>
<body>
<video width="661" height="443">
<source src="file:///C:\MyMovie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<video width="661" height="443">
<source src="file:///C:\MyMovie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
- klishb-morrisville
- Posts: 17
- Last visit: Thu Jan 11, 2024 12:08 pm
Re: Embed html5 video in browser control
Actually I originally used this line to get it to autoplay and display controls, but I had edited it out during troubleshooting.
<video width="661" height="443" autoplay controls>
<video width="661" height="443" autoplay controls>
Re: Embed html5 video in browser control
HTML 5 renders streaming video and not file based video. You need to use Media Player for MP4 files.
You also cannot use a web site to refer to a file on the local system. The file must reside on the web server that is delivering the video page.
The web browser control defaults to IE 9 I believe and will not correctly render HTML 5. Use a metatag on the page to force IE11. I am not sure that will work but it might.
You also cannot use a web site to refer to a file on the local system. The file must reside on the web server that is delivering the video page.
The web browser control defaults to IE 9 I believe and will not correctly render HTML 5. Use a metatag on the page to force IE11. I am not sure that will work but it might.
- klishb-morrisville
- Posts: 17
- Last visit: Thu Jan 11, 2024 12:08 pm
Re: Embed html5 video in browser control
Yes that works perfectly. Thank you!
Also, this appears to be false:
Also, this appears to be false:
You also cannot use a web site to refer to a file on the local system. The file must reside on the web server that is delivering the video page.