How to play media file in your site

preview
In my recent project, i had to put video clips and mp3′s, the media file at the webpage and was searching for codes to play media files. I found this simple code that could play media files . you can simply download the zip file from the jwplayer and use it.

Step 1:
Copy and paste the following codes in the head section of your webpage.

<!--
		body { background-color: #fff; padding: 0 20px;  
                 color:#000; font: 13px/18px Arial, sans-serif; }
		a { color: #360; }
		h3 { padding-top: 20px; }
		ol { margin:5px 0 15px 16px; padding:0; list-style-
                    type:square; }
 
-->

Step 2:

Now download the following files and store it in the same folder which contains the main code.
player-viral.swf
swfobject.js
preview.jpg

Step 3

Now copy the following codes in the body section of your page

<object id="player" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="315" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="player" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=axa.flv&amp;image=preview.jpg" /><param name="src" value="player-viral.swf" /><embed id="player" type="application/x-shockwave-flash" width="400" height="315" src="player-viral.swf" flashvars="file=axa.flv&amp;image=preview.jpg" allowscriptaccess="always" allowfullscreen="true" name="player"></embed></object>

here above file “video.flv” is the media file that is going to be played and file “preview.jpg” is the image that will first appear in the screen.
now your site is ready to play the media file.

click here for demo

3 Comments How to play media file in your site

  1. Pingback: Design Gala

  2. Pingback: Design Gala

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>