hi friends can anyone tell me how to play videos using Windows Media Player in ASP.NET 2.0 using c#.
please help, i am novice programmer in asp.net and c#
hi friends can anyone tell me how to play videos using Windows Media Player in ASP.NET 2.0 using c#.
please help, i am novice programmer in asp.net and c#
The question from is commonly solved two ways: embed the Windows Media Player ActiveX control in the ASPX page (works in Internet Explorer with the WMP plugin/codecs installed), or serve modern formats via the HTML5 <video> element for cross‑browser compatibility. The links posted by and are useful starting points; below is a concise, distilled approach plus a few practical cautions.
Minimal WMP embed (client must support ActiveX):
<object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="640" height="360">
<param name="URL" value="/media/sample.wmv" />
<param name="AutoStart" value="false" />
<param name="uiMode" value="full" />
<a href="/media/sample.wmv">Download the video</a>
</object> To set the media URL from C# in code-behind, render the object markup into a server control (for example, an asp:Literal) so the path can be built with ResolveUrl/Server.MapPath. For streaming large files, prefer Response.TransmitFile over loading bytes into memory:
protected void StreamFile(string virtualPath)
{
string physical = Server.MapPath(virtualPath);
Response.Clear();
Response.ContentType = "video/x-ms-wmv";
Response.AddHeader("Content-Length", new System.IO.FileInfo(physical).Length.ToString());
Response.TransmitFile(physical);
Response.End();
} Practical notes and pitfalls:
<video> fallback (H.264 MP4 + WebM) or use a JS player..wmv -> video/x-ms-wmv, .mp4 -> video/mp4).TransmitFile may not handle range requests.This summary complements the demo links already posted and focuses on practical, working patterns for ASP.NET 2.0 + C#.
Jump to Post— dickersonka 104look at 2nd post down
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.