Hi,

i want to play a vedio clip in my web page.ihave added a media player control to the visual studio toolbox using the following procedure.

Right click in the toolbox,select Choose items from the drop down,select Com Components tab from the dialog box and then check the corresponding checkbox for windows media player and then click ok.

I can see the control added to the tool box but is in a disabled state.I found it is working fine with windows form but when used with web forms it is displayed in the toolbox but in a disabled state.

why doesn't it work with web forms?

Dani AI

Generated

Short answer: Visual Studio shows the Windows Media Player toolbox item as disabled for Web Forms because that control is a COM/ActiveX control (used by WinForms and client-side embedding), not an ASP.NET server control. The designer prevents dragging it onto an .aspx page. observed the toolbox behavior correctly; was right to point toward using HTML embedding instead.

Use the browser-side HTML object/embed approach (Visual Studio may flag <embed> in design view, but browsers still accept it). Minimal ActiveX+fallback example (for older IE/WMP):

<object id="wm" width="320" height="240"
  classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
  type="application/x-oleobject">
  <param name="URL" value="/media/sample.wmv" />
  <param name="autoStart" value="false" />
  <param name="uiMode" value="full" />
  <embed src="/media/sample.wmv" width="320" height="240" autostart="false" type="application/x-mplayer2"></embed>
</object>

If the <object> renders but no video plays, check these common causes: the video file path is wrong or not publicly accessible, the server lacks correct MIME entries, the client browser blocks ActiveX/plugins, or the codec used by the file isn’t available on the client. First test by loading the video file URL directly in the browser. Use browser DevTools and the server logs to confirm a 200 response and correct Content-Type.

For modern, cross-browser pages prefer HTML5 video and MP4/ H.264 (no ActiveX required):

<video width="640" height="360" controls>
  <source src="/media/sample.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

Quick checklist: place the media in a public folder, verify direct URL access, ensure MIME types on the server, test codecs in the target browser, and use HTML5 fallbacks for broad compatibility.

Recommended Answers

All 2 Replies

Use object or embed tag.

Hi,
Thank you for your reply.
I have some problem using <OBJECT> tag and <EMBED> tag.

when i used embed tag i am getting an error saying element 'embed' is not supported and when i used object tag i am not getting any error
but the vedio clip is not played.

can u please help me with a small example?


thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.