1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

question about .asx files and web pages

Discussion in 'Software Development' started by Jackiefrost9, Jul 25, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Jackiefrost9

    Jackiefrost9 Thread Starter

    Joined:
    Jun 16, 2004
    Messages:
    3,765
    is there a way, using HTML preferably, to play asx files straight through a player on the webpage? I'm aware of the bgsound and embed tags but they wont play this type of file because it is not technically media. So is there any way to do it? any help or input (even if it is a simple "no") would be greatly appreciated.
     
  2. Jackiefrost9

    Jackiefrost9 Thread Starter

    Joined:
    Jun 16, 2004
    Messages:
    3,765
  3. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    The content of asx meta files looks like this:

    Code:
    <asx version="3.0">
        <entry>
            <ref href="http://somesite.com/music/file.ext"/>
        </entry>
    </asx>
    
    However, they don't always have an .asx extension. The extension you use depends on the type of file the ref element is pointing to.

    If it's audio like .wma files ( .wma files should be served as audio/x-ms-wma), you save it as .wax and serve it as audio/x-ms-wax

    If it's a wmv file (which should be served as video/x-ms-wmv), you save it as .wvx and serve it as video/x-ms-wvx

    If it's asf (which should be served as video/x-ms-asf), you save it as .asx and serve it as video/x-ms-asf

    For mp3s and other audio etc., embed them with wax playlist files.

    http://msdn.microsoft.com/library/d...l/adding_windows_media_to_web_pages__etse.asp

    To embed a playlist file on a web page, you do it like this ( where type= is the type of playlist you are embedding ):

    Since Internet Explorer doesn't support HTML's object element properly, you need to use IE conditional comments to give standard compliant browsers what they need and IE what it needs.

    Example:

    Code:
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <title>title</title>
        </head>
        <body>
            <div>
                <!--[if !IE]> <-->
                <object type="video/x-ms-wvx" data="file.wvx" width="300" height="300">
                    <param name="playcount" value="0">
                    <param name="autostart" value="true">
                    Error: Embedding <a href="file.wvx">file.wvx</a> (which points to <a href="file.wmv">file.wmv</a>) with your browser's video/x-ms-wvx handler failed. The <a href="http://www.microsoft.com/windows/windowsmedia/download/plugin.aspx">Windows Media plug-in</a> usually handles this type.              
                </object>
                <!--> <![endif]-->
                <!--[if IE]>
                <object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" width="300" height="300">
                    <param name="filename" value="file.wvx">
                    <param name="playcount" value="0">
                    <param name="autostart" value="true">
                </object>
                <![endif]-->
            </div>
        </body>
    </html>
    
    playcount=0 is WMP's way of setting loop=true.

    See http://www.w3schools.com/media/media_playerref.asp for other classids you can use for IE.

    You should not use the codebase attribute for the standard code unless you know how to use it properly.
    http://www.w3.org/TR/html4/struct/objects.html#adef-codebase-OBJECT

    With all that said, you can do it the lazy way of:

    Code:
        <embed type="video/x-ms-wvx" src="file.wvx" autostart="true" playcount="0" width="300" height="300">
    
    or

    Code:
        <embed type="application/x-mplayer2" src="file.wvx" autostart="true" playcount="0" width="300" height="300">
    
    if you want. ( This will work if you do it correctly. )

    Note that the embed element is an empty element. It should not have an end tag. The embed element is not defined in html4 or xhtml 1.x. It will be defined in HTML5 and XHTML5 though.

    Be sure to check your code in Firefox and Opera. ( making sure you have the netscape 6.4 windows media plugin installed for them)
     
  4. Jackiefrost9

    Jackiefrost9 Thread Starter

    Joined:
    Jun 16, 2004
    Messages:
    3,765
    alright that looks like it covered my question pretty well, i'll try it out and let you know how it goes. thank you
     
  5. Jackiefrost9

    Jackiefrost9 Thread Starter

    Joined:
    Jun 16, 2004
    Messages:
    3,765
    yup that did it, you probably knew it would but i figured i would just let ya know. Thanks for all that info it will come in handy with many other things later on.
     
  6. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    Thanks, and you're welcome.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/486344

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice