Jump to content
  • Advertisement
Sign in to follow this  
anvil

DirectX.AudioVideoPlayback / video.Owner

This topic is 4707 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have found a media player in one of the managed DX samples. Im trying to modify it to play the movie inside my game window, but the Owner method says it requires System.Windows.Forms.Control object and I just need to use this.sampleFramework.Window.... any ideas? exact error Cannot implicitly convert type 'System.IntPtr' to 'System.Windows.Forms.Control'

private Video videoClip = null;

public void PlayMovie()
{
     // First try to open this as a video file
    videoClip = new Video("video.mpg");
   
    videoClip.Size.Height.Equals(640);  //movie height
    videoClip.Size.Width.Equals(480);   //movie width

    // the sample uses a form but I have just a window formed by DX
    videoClip.Owner = this.sampleFramework.Window;  //build error
    
    // Start playing now
    videoClip.Play();
}


Share this post


Link to post
Share on other sites
Advertisement
Have you tried using the FromHandle or FromChildHandle mehtods of Control? I don't know much about the sample framework, but if they call it a window and the type is IntPtr than than the IntPtr is probably a HWIND and you can get a Control from it like so:
Control.FromHandle(this.sampleFramework.Window);

It should also work with a form instead of a control.

Hope this helps.

Share this post


Link to post
Share on other sites
yeah it compiles now hehe, but when the movie plays it makes a new window for every frame lol, atleast now I can figure out something.
thanx

Share this post


Link to post
Share on other sites
lol I know why it was playing over and over in the onframerender lol, i just limited it to one time only now... works good... the size remains the same though for some reason (not 640x480)

Share this post


Link to post
Share on other sites
actually at further inspection im way off, its just creating a new window for the movie INSIDE the same dimensions as the game window grrrr

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!