Activemovie window pop up Microsoft.DirectX.AudioVideoPlayback in C#

∥☆過路亽.° 提交于 2019-12-11 08:39:50

问题


I had create a simple windows form which display a video with Microsoft.DirectX.AudioVideoPlayback. When the video load to the panel, it pop up for milliseconds a activemovie window. How i could fix it because it is annoy every time start playing a video throws this activemovie window. It is like the application have delay.

Here is my code :

   string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Photos\test.avi");

   var ofd = path;
   var video = new Video(ofd, true);
   label3.Text = ofd;
   video.Owner = panel2;
   panel2.Size = new System.Drawing.Size(640,480);
   video.Ending += new EventHandler(videocountdown_Ending);
   video.Size = new System.Drawing.Size(640, 480);

Above it is a printscreen when i press the button which play the video. I crop it and i show you only the panel in this picture.


回答1:


video = new Video(ofd, true);
video.Owner = panel2;

So you auto-run it before binding to the panel? I suppose you want it the other way: create, then Owner thing, then Play.

video = new Video(ofd, false);
video.Owner = panel2;
video.Play();

Playback without UI initialization makes the video renderer to render video into private popup window, which has a historic caption "ActiveMovie", which is soon to celebrate 20 year anniversary...



来源:https://stackoverflow.com/questions/23308390/activemovie-window-pop-up-microsoft-directx-audiovideoplayback-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!