views:

585

answers:

1

I'm adding a subview/overlay starting from the MediaPlayer example project. The difference is that I'm trying to loop using the following code in the moviePlaybackDidFinish notification:

moviePlayer.initialPlaybackTime = -1.0;
[moviePlayer play];

That weird initialPlaybackTime property keeps the video from flickering on subsequent loops. If someone has a better idea, please let me know.

There seems to be some kind of race condition at work in the moviePlaybackDidFinish notification. If I try to re-add the subview directly following "[moviePlayer play]" nothing happens. Stepping through the code, it seems like the subview is still there until after the play message is sent but is gone when the video starts to replay.

Anyone have an idea how can I re-add the subview upon subsequent loops? Is there a way to detect if a subview is still the subview of its superview? If so, what would be the best way to do that in this scenario?

Thanks for your help.

A: 

Thanks for your quickie workaround!!! It solves my immediate problem.

Good luck with solving your problem!

Brian