我在C#项目中使用WMP(AxWindowsMediaPlayer),并希望提取最多0.1或0.01秒的确切时间戳。有什么办法可以做到这一点吗?
以下内容不起作用,因为它太不精确了: - /
player.Ctlcontrols.currentPositionString
我不认为同时运行计时器是一个很好的解决方案,因为每次用户暂停视频时我都必须停止并恢复它,并且在几次暂停和恢复后最终会出错。
您是否尝试过使用currentPosition属性,该属性从start开始返回double,而不是currentPositionString,它返回字符串MM:ss格式。
字符串格式仅为精确到第二个最接近的整数值。 currentPosition属性是一个double应该给你几分之一。
参考
currentPositionString http://msdn.microsoft.com/en-us/library/windows/desktop/dd564739(v=vs.85).aspx
currentPosition http://msdn.microsoft.com/en-us/library/windows/desktop/dd564740(v=vs.85).aspx