Code snippet to embed Windows Media video in Web page

  1. Blueie

    I saw a mediacollege tutorial on embedding Windows Media files in a Web page and copied and pasted the code from one example into my Web page. A number of errors occured in my validator, so I have had to modify it as follows:

    <object id="MediaPlayer" width="275" height="240">

    <param name="FileName" value="goldfish.wmv">

    <param name="ShowControls" value="true">

    <param name="ShowStatusBar" value="false">

    <param name="ShowDisplay" value="false">

    <param name="autostart" value="false">

    <embed type="application/x-mplayer2" src="goldfish.wmv"
    width="275" height="240" autostart="false">

    The video still does not work on the site, however, because I get the following error: object id="MediaPlayer" .

    What should 'object id' be, please? I note also that there is no object type="video/x-ms-wmv"?

    Thank you.

  2. Dave
    Good spotting (and fixing). The code on that page needs updating and I'm going to get onto that right now. You're right about adding the object type. I wasn't sure about the id problem though - that seems ok to me - so I did a little research and it seems that there are some browser issues with the id attribute in an object tag. Are you getting the same error with different browsers? It sounds like Chrome is the worst offender. I need to do a bit more research into this one.

    Unless you need the id for scripting or some other purpose, it's safe to leave it out.

    I also have to ask: Do you need to use Windows Media Player? I know there are valid reasons in certain situations but in most cases I think you're better off using something more compatible such as the built-in video feature of HTML5.
  3. Dave
    One other thing - posting messages in a group's page isn't really the best way to get replies as it's often only the members of that group that see it. There are also a bunch of other limitations. In fact we don't really use these groups any more so I might shut them down to prevent confusion. It's best to post messages in the main forums, e.g. for this message I'd post it in the video forum.
  4. Blueie
    Hello Dave

    Many thanks for your message.

    I didn't know about that HTML5 video link. I'll take a look at it now. Thanks also for the link to the main forum!


Results 1 to 4 of 4
Subscribe to us on YouTube