Title: How to get the playing file total time duration Media player
Tags: asp.net;javascript;media-player
Question: I use media player control to play mp3 files in asp.net application. I want to find When the playing process gets end and the total time require to finish the file using javascript.

Code:

```  <object id="mediaPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" 
                    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" 
                    height="1" standby="Loading Microsoft Windows Media Player components..." 
                    type="application/x-oleobject" width="1"&gt;
                    <param name="fileName" value="" /&gt;
                    <param name="animationatStart" value="true" /&gt;
                    <param name="transparentatStart" value="true" /&gt;
                    <param name="autoStart" value="true" /&gt;
                    <param name="showControls" value="true" /&gt;
                    <param name="volume" value="100"  /&gt;
                    <param name="loop" value="true"  /&gt;
                </object&gt;
```

Geetha.

Comment: Maybe you could show how you are *using* this media player control in your code.

Here is the accepted answer: Try to use: get_duration or get_durationString (in javascript may be "duration" or "durationString"). To see properties and methods exposed by WMP object you can download Windows Media Player SDK from Microsoft's site.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 2.5', 'CreationDate': '2010:00:03/17/10', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<asp.net><javascript><media-player>', 'Title': 'How to get the playing file total time duration Media player', 'ViewCount': 1887, 'id': 2462174, 'user_AboutMe': '', 'user_AccountId': 86029.0, 'user_DisplayName': 'Geeth', 'user_Reputation': 5192.0, 'user_Views': 753.0, 'user_id': 1470997.0}}