XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

XNA 3.1 Video Playback issue

Last post 1/21/2010 11:58 PM by David Amador. 2 replies.
  • 10/14/2009 8:00 PM

    XNA 3.1 Video Playback issue

    Hi there,

    I'm currently trying to playback a video, yet it doesn't as it should.

    The only thing I get is a black rectangle in my window.

    I load the video in a new project with Content.Load<Video>(@"MyVideo"); in "LoadContent" and immediately set the initialized VideoPlayer to play the video.

    In the Draw method I, then, draw it with (videoPlayer.GetTexture(), Vector.Zero, Color.White).
    If I make an if clause, that it should only draw if the video is playing, it "always" skips the drawing, even though the video should be playing.

    By the way, the video does compile without complaints and the black rectangle in my window is about the size of the video resolution.

    Debugging it, I get only "CrossThreadMessagingException" on "GetTexture" and also the state of the player. Obviously I'm doing something wrong here...?

    greetings

    Qudeid
  • 1/21/2010 11:33 PM In reply to
    • (182)
    • premium membership
    • Posts 67

    Re: XNA 3.1 Video Playback issue

    I'm getting this error too now. It used to work, but now I'm getting the exception you mention, on the State property of the VideoPlayer.

    I see this is a pretty old post, have you resolved it?
    Comming soon - Mars Revenge
  • 1/21/2010 11:58 PM In reply to

    Re: XNA 3.1 Video Playback issue

    It seems to be some kind of problem thread related. Like some thread, in this case the video that hasn't finished getting the texture and when you try to use it it crashes.
    Try to put this before your Main function

            [STAThread] // This is just a long shot, try it 
            static void Main(string[] args) 
            { 
            } 



Page 1 of 1 (3 items) Previous Next