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

Contributor Icon Contributed by David Kirk     
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.

 

2 Comments -


  1. vikas said on January 21, 2009

    pls tell me also that how to embed k-lite codec pack in my web page?

  2. Ahmed said on June 13, 2009

    thank you

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -