0

我一直在使用 3.0 SDK 的 MPMediaPlayer 框架。有时媒体播放器响应缓慢,或根本不响应。我在控制台中收到警告消息,但用户永远不会看到这些消息(因此将超时归咎于我的应用程序)。

有没有办法从这些超时中恢复?我也可以设置不重试吗?

4

1 回答 1

0

您的应用程序是否注册以接收来自 MPMediaPlayer 的通知?我没有看到这些超时,所以我不知道他们返回的 MPMoviePlayerContentPreloadDidFinishNotification 是否包含您的错误信息。

从 MPMoviePlayerController.h:

MP_EXTERN NSString *const MPMoviePlayerContentPreloadDidFinishNotification; // userInfo contains NSError for @"error" key if preloading fails

从 MoviePlayer 示例代码:

// Register to receive a notification that the movie is now in memory and ready to play
[[NSNotificationCenter defaultCenter] addObserver:self 
                 selector:@selector(moviePreloadDidFinish:) 
                 name:MPMoviePlayerContentPreloadDidFinishNotification 
                 object:nil];

// Register to receive a notification when the movie has finished playing. 
[[NSNotificationCenter defaultCenter] addObserver:self 
                selector:@selector(moviePlayBackDidFinish:) 
                name:MPMoviePlayerPlaybackDidFinishNotification 
                object:nil];

// Register to receive a notification when the movie scaling mode has changed. 
[[NSNotificationCenter defaultCenter] addObserver:self 
                selector:@selector(movieScalingModeDidChange:) 
                name:MPMoviePlayerScalingModeDidChangeNotification 
                object:nil];
于 2009-08-02T22:28:40.880 回答