I found WindowsMediaPlayer in WMPLib but not the TimeCode!
Anyone known how to do that?
I believe that the answer to your question is that you will need to call IWMReaderTimecode::GetTimecodeRangeCount for each stream in your file. Then call IWMReaderTimecode::GetTimecodeRangeBounds for each range in each stream to get the startTimecode and endTimecode of each range.
Looking at these two articles Get WMA/WMV meta information in C# and Getting Current Time Code Using Windows Media Player Class in C#, you could try the following:
using WMPLib; // this file is called Interop.WMPLib.dll
WindowsMediaPlayerClass wmp = new WindowsMediaPlayerClass();
IWMPMedia mediaInfo = wmp.newMedia("myfile.wmv");
Console.WriteLine("Duration = " + mediaInfo.duration);
for (int i=0; i<mediaInfo.attributeCount; i++) {
Console.WriteLine(mediaInfo.getAttributeName(i) + " = " +
mediaInfo.getItemInfo(mediaInfo.getAttributeName(i)) );
}
or use the Controls.CurrentPositionString
property to get the current time.
Console.WriteLine(wmp.controls.currentPositionString);