问题
I am integrating a video player to an existing .NET WinForms application.
I first tried to use "Windows Media Player Control" which is included in Windows SDK, but I could not change the playback rate.
The following is the code I wrote to change the rate.
if (axWindowsMediaPlayer1.settings.get_isAvailable("Rate"))
{
axWindowsMediaPlayer1.settings.rate = 3.0;
}
The condition in the if statement always returns "false" no matter what video file I use. Does anyone have any idea why I cannot change the rate? It really needs to be available to change the playback rate, so WMP control seems to be a bad choice if it's impossible to do so.
Or, is there any alternative solution which allows me to change the rate? Preferably a .NET based library which does not involve any unmanaged code.
Thanks!
回答1:
I ended up using DirectShow.NET (http://directshownet.sourceforge.net/) which is an open-source library. It contains a lot of samples, and it has a sample with playback rate control.
回答2:
IF a commercial library is an option take a look at http://www.visioforge.com/media-player-sdk-net.html
Another commercial option would be Leadtools MultIMedia SDK - see http://www.leadtools.com/sdk/multimedia.htm#+cp_playback
回答3:
Is the if statement really necessary? I could set the rate fine without it..
axWindowsMediaPlayer1.settings.rate = 3.0;
来源:https://stackoverflow.com/questions/7369845/net-video-play-library-which-allows-to-change-the-playback-rate