Here is the description of the problem:
I want to be able to play videos in the project I'm working on... The easiest way was using PInvoke and winmm.dll. Piece of code I've used for opening file is:

public void OpenFile()
    {
        if (!this.opened)
        {
            this.opened = this.paused = true;

            command = "open \"" + videoName + "\" type mpegvideo alias VideoPlayer";
            mciSendString(command, null, 0, IntPtr.Zero);

            command = "set VideoPlayer time format miliseconds";
            mciSendString(command, null, 0, IntPtr.Zero);

            command = "set VideoPlayer seek exactly on";
            mciSendString(command, null, 0, IntPtr.Zero);
        }
        else
        {
            this.CloseVideo();
            this.OpenFile();
        }
    }

And code for playing files:

command = String.Format("play VideoPlayer notify");
mciSendString(command, null, 0, IntPtr.Zero);

Problem is that the video file is opened and played but in a new window. Is there a way to make it play in the window i called the method from?
I tried searching the msdn and i did find this. If you look under the lpszPlayFlags, the flag window

Specifies that playing should use the window associated with the device instance. This is the default setting.

Even if I do use that flag, still video plays in the new window. Obviously, I'm doing something wrong. If somebody knows what are my mistakes and knows how to solve this "problem" it'll be much appreciated.
Thank you!
Best regards.

0

There are 0 best solutions below