1

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);

enter image description here

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.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
NickName
  • 313
  • 2
  • 9
  • 25

1 Answers1

0
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...

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I correct it but i have the same problem.So how i could play a video with UI initialization without Microsoft.DirectX.AudioVideoPlayback. With right render and play without pop up activemovie window – NickName Apr 26 '14 at 09:45
  • I made a quick check and I see that it is helpful as expected. No popup window with proper early `Owner` initialization. – Roman R. Apr 26 '14 at 10:18
  • I had add the your lines but it still pop ups for milliseconds the activemovie window like the printscreen in my question above. – NickName Apr 26 '14 at 14:19
  • for the record - my code with two buttons [VideoPlayback01/Form1.cs](http://www.alax.info/trac/public/browser/trunk/Utilities/Miscellaneous/VideoPlayback01/Form1.cs) show it pretty clear, one buttons causes the popup blink, and the other makes it clean. – Roman R. Apr 26 '14 at 15:02
  • I create a new form and i copy and paste your code. When i clicked the buttons doesn't do anything. I had put my path with my video and it doesn't respond at both buttons. – NickName Apr 26 '14 at 15:37