C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Exact time length by media player to play a media file


Posted Date: 04 Nov 2009      Posted By: Ramesh N D      Member Level: Gold     Points: 1   Responses: 1



Hi All,
I want to calculate the exact time length taken by media player to play a media file (wmv format). How can i do this programmatically?

Thanks in advance.





Responses

Author: Hari    21 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,
Use this code
Include this dll Interop.WMPLib.dll

WindowsMediaPlayerClass clas1 = new WindowsMediaPlayerClass();
IWMPMedia Med = clas1.newMedia(@"c:\Test.wmv");
double val =Med.duration;
Note that this wont work for .avi files. It will only work for wmv and mp3 files.



Post Reply
You must Sign In to post a response.
Next : How to split image into small pieces in C#
Previous : How to use menu dynamically
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use