tags:

views:

154

answers:

2

What I have to do is play a video file in mp4 format. If the device is in portrait mode then it should display the video, but when the user changes the device to landscape mode it should just show an image.

But currently when I play a video, it takes control of the whole app; I can't send a notification to any event, and control only returns to my code after playing the full length video.

How can we can access another things while we are playing the video on the device?

Thanks for the help Balraj Verma

A: 

Try spawning a new thread and then call the code to play the video from the new thread. This should leave the rest of your code free to do what it needs, unless I am misunderstanding your question.

gburgoon
A: 

You can use the shouldAutorotateToInterfaceOrientation: to check what orientation the device is in, and then do the logic in there.

Eg, if the orientation is portrait, start the MPMoviePlayerController playing the movie, then when the orientation changes to landscape, dismiss the moviePlayer.

Jasarien