iOS: Handheld.PlayFullScreenMovie

the filename is right (as verified by a call to System.IO.File.Exists( fileName ) - which fails if I give bad filenames) and I've tried movies shot on the iPhone, movies from Apple's owan site, labelled as transcoded for iPod, etc, so I'm sure the format is right.

However, I continually get a crash on:

playmovie(4953,0x1e03000) malloc: error for object 0x1c849b8: pointer being freed was not allocated set a breakpoint in malloc_error_break to debug

If I give it a bad filename, the movieplayer starts then closes again (without crashing). As far as I can tell, I'm giving it a good filename and file.

I'm testing on devices running iOS 5.1

Any suggestions? Does anybody have a working movie file / demo project I could see with this all working? I'm amazed a one-liner that should Just Work is proving so problematic.

2 Replies

In the end, I realised that I was using the developer preview of Unity 3.5, and went back to Unity 3.43 (at the time, the most recent fully-stable build).

This did mean that I had to recreate my scene entirely (lost about half a day to doing that) but the calls worked and I got my product made on time in the end.

Here's my code - the bit that finds the path is very hacky, I suspect you don't need all that (there are other articles on this subject), but all I can say is that it worked, so perhaps it could form part of a solution for you.

I also used iExplorer to go on my device, into the directory of my app and check for absolutely certain that the movie file had been copied into the directory on the device (though while I deploy, you could usually see the status in Xcode change when it was copying the bigger resources, so I was pretty sure).

I had the same problem, where the player in the iPad closes on its own, but I was able to fix it. The reason, I had an incompatible file type (.ogv). Here

Unity iOS supports any movie file types that play correctly on an iOS device, implying files with the extensions .mov, .mp4, .mpv, and .3gp and using one of the following compression standards:

H.264 Baseline Profile Level 3.0 video

- MPEG-4 Part 2 video [Source here][1] I used
iPhoneUtils.PlayMovieURL by the way. It still seems to work (using Unity iPhone Pro 3.5.0f5) even though it does not appear in the autocomplete or marked as [Obsolete] when I type it in MonoDevelop. Took me a while to fix this one as well, but I hope it helped out. [1]:
http://docs.unity3d.com/Documentation/Manual/VideoFiles.html