I'm building a small media selector application. All medias of a given directory are loaded one by one based on left/right key navigation and displayed in Windows Media Player control that is on a windows form (C#).
开发者_运维技巧I works well with videos, audio, but less with still images.
The image is displayed correctly, but after a few seconds it disapears. I looks like the media player is "playing" it for a few second, then "stop" it.
How can I make the Windows Media Player control to stay on the image until I load another media in the player ?
Here is how I solved the problem. In case the loaded media is an image, I pause the WMPC. It works, but I don't like it.
ThreadStart start = new ThreadStart(delegate() {
Thread.Sleep(2000);
this.axWindowsMediaPlayer1.Ctlcontrols.pause();
});
start.BeginInvoke(null, null);
精彩评论