views:

267

answers:

3

I was trying to go through the iPhone's sample code for mediaplayer.

I want to be able to capture the amount of time the media player has played the video. The duration at which the media player has stopped. Is there a method or property that will tell me the duration of play of the media??

A: 

Unfortunately the current API for MPMoviePlayerController allows basically no control. You can tell it to play and stop... otherwise where's a delegate method so you can be notified when the movie finishes playing and that's it, there's no additional controls. (a real bummer)

However, while we cant discuss the new 3.2 SDK yet, I'll give you a tip and say go look at the documentation of MPMoviePlayer in 3.2 and I think you'll be happy.

http://developer.apple.com/iphone/prerelease/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html

So its available in iPhone SDK 3.2 version. that will be okay.
Nareshkumar
A: 

check this link it may help u

http://cocoabugs.blogspot.com/2010/08/how-to-get-time-duration-of-played.html

jeeva
duration is not equal to current time
Shivan Raptor