[SOLVED]PlayMovie and compressed audio bugs

If I use PlayMovie, and let the movie play through to the end, two things occur:

  1. At the end of the movie, the player plays from the beginning again for the first few frames.

  2. Any compressed audio from that point onwards can’t be heard - even if I load in different scenes. The Instantiate() works fine, the game works as normal, just no music!

If I interrupt the video, however, everything works fine!

Anyone else seen this?

I’m using v1.5 Pro, btw.

Thanks!

You’re using ‘iPhone Advanced’ :slight_smile:

I’ve also noticed the video will replay whats left in buffer on reload.

Yeah, we’re aware of that few frames bug, but we can’t fix it since it is on Apple’s side. You may bugreport Apple about their videoplayer.

And again, I’ve double checked that compressed music plays OK after videos.

My system: OS 10.5.8, Xcode 3.1.3, SDK 3.0. iDevice - iPod 2nd gen, OS 3.0

Thanks Wozik - I’ll put together a demo project and see if the problem persists there as well.

Well, I personally have low expectations of the apple video player, so I wasn’t too put out by it :slight_smile:

Wow, I haven’t seen that, and Pogg is full of movies. My mp3 audio on the title screen is fine too afterwards too (a different scene, and you get to it by pressing a menu button rather than it appearing straight after the movie).

My movies finish properly on the final frame (on my iPhone 3G at least), but if you replay the exact same movie again, it fades up for a second showing the last frame before starting the playback properly at the begining… a bit annoying.

Aha! Cracked it!

If I write a routine in Obj-C :

extern "C" void EnableAudio( bool bEnable )
{
       UnitySetAudioSessionActive( bEnable );
}

…then wrap PlayVideo :

public void ShowVideo( string filename )
{
       EnableAudio( false );
       iPhoneUtils.PlayMovie( filename, Color.black, iPhoneMovieControlMode.CancelOnTouch );
       EnableAudio( true );
}

Things work normally!

Thanks to Rej, Oleg and John Grden for helping solve this one :smile: