I have an asp.net page, I want to play a video in it. I've tried using <video>
and <Object>
, but nothing worked. Either the video appears as a white block, or it doesn't appear at all.
I'm trying to play .wmv file which is stored in the localhost in Images folder. Here are some code samples I tried:
<video width="320" height="240" controls="controls">
<source src="~/Images/file.wmv" type="video/mp4">
<source src="~/Images/file.wmv" type="video/ogg">
<source src="~/Images/file.wmv" type="video/wmv">
<source src="~/Images/file.wmv" type="video/ogv">
Your browser does not support the video tag.
</video>
Also, this one:
<object width="425" height="344">
<embed src="file.wmv" width="425" height="344"></embed>
</object>
And this one:
<object width="425" height="344">
<param name="file" value="~/Images/file.wmv"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="localhost/Images/file.wmv" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
</object>
None of the code samples above worked. Can you please tell me how can I fix this problem?
Also, what if the user will upload some video file to the server (and I have no prior knowledge about its type, it may be .wmv, .swf, etc.) What coding technique would support playing a variety of video types?
Thanks.