简体   繁体   中英

How to get the playing file total time duration Media player

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">
                    <param name="fileName" value="" />
                    <param name="animationatStart" value="true" />
                    <param name="transparentatStart" value="true" />
                    <param name="autoStart" value="true" />
                    <param name="showControls" value="true" />
                    <param name="volume" value="100"  />
                    <param name="loop" value="true"  />
                </object>

Geetha.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM