Welcome, Guest [LogIn] / [Register] / [Forgot Password ?]
Home > Technical Tips > ASP.Net > How to add windows media player in asp.net web page. ?
How to add windows media player in asp.net web page. ?
Posted by Saurabh Kumar on Tuesday, Oct 20, 2009
| More

First you create a web page to open asp.net. than add this code in asp.net web form page.

<div>
     <embed type="application/x-mplayer2" width="300" height="300" src="Bir me tanhai me.DAT" showstatusbar="1">
        <param name="AutoStart" value="1" />
     </embed>
</div>

In this code :

Embed tag is used to add media player in web page.

1)    Type: Type attribute is type of player.
2)    Width & Height: width or Height is size of player.
3)    SRC: Src is a path of video or audio file to play.
4)    Showstatusbar : it is used to display a status bar of media player.
5)    Param : param tag is used to auto run a player to run a web page. If value is 1 then auto starts a player to runs webpage. If value is 0 then player is not default start.

Step to add windows media player in asp.net webpage :

Step 1) Open asp.net web forms. After add audio or video file for play in player.
        Right click in project in solution explorer then choose add existing item. Then open a dialog box. You select audio or video file. After add this file show in solution explorer.

code for add media player in asp.net

Step 2) After adding file then you write embed code in web form in html view. For create media player.
   
<div>
     <embed type="application/x-mplayer2" width="300" height="300" src="Bir me tanhai me.DAT" showstatusbar="1">
        <param name="AutoStart" value="1" />
     </embed>
</div>


Step 3) After adding code to run a web form. A media player show in web page in running mode.

display a windows mediaplayer in asp.net web forms.

Sheetalkumar  says :
August 28, 2010 at 01:11 pm
i ma not totally satisfy to your answer i want src filepath is dynamic not static send me code for dyamamic set file path ok thanks
Sachin  says :
June 17, 2010 at 01:42 pm
Hi Sir, I want to use API services with this and want to play video dynamically. ant the mai thing is it is not supporting all files. can you plsease help me to overcome this problem. Its very much required for me..
Admin  says :
May 29, 2010 at 08:32 pm
no koi path set nahi hoga u use only written code
Arunveram  says :
May 28, 2010 at 01:58 pm
sir koi paht set kar na hoga kia. jahase haem video player uthana he ... ply giv me sagetion... thanks
Dsfds  says :
April 16, 2010 at 09:32 pm
sfsaf
Asifa  says :
March 23, 2010 at 01:28 pm
not working for me....media player is not playing .dat file in browser but it worked for wmv....... y not for .dat???
Paresh  says :
March 20, 2010 at 08:48 pm
Thanks a lot!! its good code for adding window media player. but it is not supporting other video formats like 3gp , so how to add flash player or any other player instead of media player .
Maxim Levit  says :
March 12, 2010 at 12:26 pm
I need play to other audio then I click Button add audio load from sql database table . But I need after change path .
Sand  says :
February 04, 2010 at 03:02 pm
hello sir....... I want to play a video file according to client request.. for example i have a 30 minute video file instead of playing 30 min video file if user requests like "i want video from 0-5 min after that directly the cursor should jump to 15min "...is it possible playing like this
Admin  says :
January 22, 2010 at 10:43 pm
hi jalal. i am not understand your problem pl z define a problem. and in case your requirement for running multiple video in webpage then u use multiple player for running multiple files...
Jalal  says :
January 20, 2010 at 01:26 pm
Hi i am new in asp.net but i want to know how to show video file dynamically from the database where multiple url exist and want to play all not a single one. a video table there in application where many link save and want to play all. Thanks in advance jalal
Sushil  says :
November 25, 2009 at 10:37 am
Hi guys, I again boot xp3 and it is working now but there is a problem and that is while uploading my website into localhost player auto start but i want it should not start by itself and it should be pause so help me plz
Sushil  says :
November 15, 2009 at 11:30 pm
thanks for coding .i was using xp2 and i used your coding it works but now i m using window 7 and now it says "additions plugins are required to display all the media on this page.i intall quicktime also. plz help me out
Admin  says :
November 14, 2009 at 10:52 pm
Please tell me what problem facing you in adding player in asp.net.
Sushil  says :
November 13, 2009 at 06:29 pm
hi there i added player but it is not working plz help me out . thanks
Sushil  says :
November 13, 2009 at 06:13 pm
thanks and can you help me out with photo gallery in asp.net
Add Your Comments/Suggestions :
Name:
Email:
Website:
Your Comments:
 
(required)
(will not be published) (required)


©Copyright 2010 saurabhdeveloper.com