MPMoviePlayerContentPreloadDidFinishNotification does not fire [iPhone]

别来无恙 提交于 2019-12-23 19:07:30

问题


I'm running into a problem with the MPMoviePlayerContentPreloadDidFinishNotification notification. I've regisered to recieve the MPMoviePlayerContentPreloadDidFinishNotification notification and MPMoviePlayerPlaybackDidFinishNotification but the first one never fires. Is this bug in Firmware OS 3.0 ? maybe fixed in 3.1 ? or ? Because my divice and similator is 3.0 maybe this is a bug ?

My code :

...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerContentPreloadDidFinishNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
...
-(void)MovieDidLoad:(NSNotification*)notification
{
    UIAlertView *alert = [[UIAlertView alloc] 
                          initWithTitle:@"Notification Listener" 
                          message:@"Notification Listener invoked" 
                          cancelButtonTitle:@"Ok dude!" 
                          otherButtonTitles:nil];   
    [alert show]; 
    [alert release];    

}

The MPMoviePlayerPlaybackDidFinishNotification is always fired but MPMoviePlayerContentPreloadDidFinishNotification is never fired. Any ideas ?


回答1:


I answered a similar question here with a workaround. It's not ideal but may be worth a look if no other solution can be found?



来源:https://stackoverflow.com/questions/1838681/mpmovieplayercontentpreloaddidfinishnotification-does-not-fire-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!