Quick Way to Play or Embed MP3/WMA/AVI/MPG audio/video files on your Web Page

Contributor Icon Contributed by davak Date Icon May 6, 2005  
Tag Icon Tagged: Windows

If you need a rough way to embed a music file into your web page, this will get you started.


Much sexier ways to do this exists. Sorry. However, this short code will play a music or video file using microsoft’s media player.

Of course, this will not work on non-Windows systems…

Change http://www.somesite.com/file.wma to the exact URL of the music file.

If you want to play video files, increase the height to 240.

CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">


SRC="http://www.somesite.com/file.wma"
NAME="MediaPlayer"
WIDTH=320
HEIGHT=42>

This should get you started. Many javascript options exist out there which are more cross-platform friendly. I’ll try to write up that method soon. If you can improve on this method, please drop a note in the comments.

Previous recipe | Next recipe |
 
  • Anonymous
    Is there a way to do this for Quicktime?
  • Anonymous
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
    <param name="autoplay" value="false">
    <param name="controller" value="true">
    <param name="href" value="http://homepage.mac.com/igstudio/.Music/SaxSampler(long).mp3">
    <param name="target" value="myself">
    <param name="type" value="video/quicktime">
    <param name="KIOSKMODE" value="TRUE">
    <embed pluginspage="http://www.apple.com/quicktime/download/" href="http://homepage.mac.com/igstudio/.Music/SaxSampler(long).mp3" target="myself" kioskmode="true" type="video/quicktime" controller="false" autoplay="false"></embed>
    </object>
  • Anonymous
    I think that using k-lite codec pack media player.. 99% of available video formats can be played including rm and mov :)

    google it for more 8)
  • safdf
    very helpful! just what i was looking for, thanksx
  • vikas
    pls tell me also that how to embed k-lite codec pack in my web page?
  • thank you
blog comments powered by Disqus