Issue with VideoPlayer on iOS

Hi all, first post here. I’m having some issues with Media.VideoPlayer.

In XNA I could load my video content, play the video, and then capture the footage to a texture and do what I like. For example:

        VideoPlayer videoPlayer;
        Video video = Content().Load<Video>(@"video/something");           
        videoPlayer.IsLooped = false;
        videoPlayer.Volume = 0;
        videoPlayer.Play(video);

and then later, in my draw method:

         Texture2D videoTexture = videoPlayer.GetTexture();

After which I could do whatever I like with the Texture2D. I could stretch it, flip it, run logic on top, pause/resume, etc. Unfortunately, on iOS all I can do Play() and then the entire solution freezes while the video plays. I have zero control over it, and half the time .IsLooped and .Volume give me an error, something about not yet being implemented. It doesn’t even respect the Update/Draw structure of the project. It literally feels like it is minimizing my game and running a separate app.

Is there any way around this? The video plays back smoothly and looks right, I just can’t work with it like this.

I should be clear that originally, in XNA, the videoPlayer.Play() method didn’t actually result in any visuals. You had to manage that yourself. I want to do the same on iOS, vs whatever it’s doing now. Thanks.

On some platforms we use the OS-provided video playback. On some platforms we can get this as a texture, but on other platforms it is more difficult. We can take a look into it, but it won’t be soon.

Many thanks, I appreciate the information. I’m nearing the end of this port so I may be able to ship in this state (though only in English as subtitles won’t work), but I’d love to update the build with proper playback when available.

If there’s anything I can do (provide code, assist financing, etc) please let me know, thanks.

I’ve discovered another issue with the OS-provided video playback solution on iOS, this one being a bit more serious.

For detecting input I’m using:

        TouchCollection touchCollection = TouchPanel.GetState();

If the GetState() is returning any input when the videoplayer begins, TouchPanel.GetState() will retain these inputs from that point on when the app retains focus.

Basically, if you are touching the screen when a video starts you are stuck with a permanent touch gesture. Somehow the TouchPanel needs to be cleared, though ideally the iOS version wouldn’t use the OS video player. Having this looked into would be appreciated.

Edit: I’ve come up with a simple solution by logging each touch ID just as a video begins playing, and then invalidating those IDs from that point afterwards, but it’s not the most elegant solution, particularly if you have to play a lot of video.