开发者

Mediaplayer: Is it possible to distinguish finish from 'Done' with myMovieFinishedCallback?

开发者 https://www.devze.com 2022-12-11 00:07 出处:网络
I am using the MediaPlayer framework to play a movie on the iPhone.There is a notification:- myMovieFinishedCallback

I am using the MediaPlayer framework to play a movie on the iPhone. There is a notification:-

myMovieFinishedCallback

to capture the end of play, but there doesn't appear to be any way to distinguish between the player coming to the end of the movie, and the user pressing 'Done' to terminate mid-play.

Is it possible to tell the condition of the finish?

I have managed to create a log of all notifications sent by the player, and I have seen this and some other notification candidates, which I believe are triggered by clicking 'Done', that might be useful:-

NSConcreteNotification 0x45534d0 
    {name = 开发者_如何学编程AVController_TimeHasJumped; object = <AVController: 0x4525620>; 
    userInfo = {"AVController_Time" = 31.02737777777778;
    }}

Having managed to view the notification however, I'm not sure how I can use the log information to fire the right handling in my app. Can anyone clarify how, having managed to view it, I can exploit NSNotification information and fire events based on notices passing through?

Thanks in advance for any hints in this area!!


I'm drawing the conclusion that it isn't possible! The notification trace for both a premature finish initiated by the user and the player naturally reaching the end of the clip appear to be the same, the only clue is that you do get access to the timecode at the end of play, so if you know the duration of your movie, you can make a pretty good guess.

0

精彩评论

暂无评论...
验证码 换一张
取 消