複製步驟: 1.調用playMovieAtURL。使用此網址:(http://nov8rixstorage.blob.core.windows.net/searchpad/tutorial_portrait.mov) 2.讓電影開始,然後按完成。 3.再次使用相同的URL調用playMovieAtURL。MPMoviePlayerViewController/MPMoviePlayerController不會播放兩次相同的電影嗎?
結果:MPMoviePlayerViewController動畫中;閃爍幾次;並關閉通知對象中的錯誤。 (「服務器配置不正確」。)
這很奇怪。讓事情變得陌生;電影播放器將不會再播放任何東西,直到應用程序從設備(模擬器或iPhone)中刪除。重新部署後,它會再次完美地播放電影;但唉第二次玩它會重複上述行爲。
我在做什麼錯?任何人都可以重現嗎?
- (void) playMovieAtURL: (NSURL*) theURL {
[theURL retain];
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:theURL];
if (mp)
{
[self presentMoviePlayerViewControllerAnimated:mp];
[[NSNotificationCenter defaultCenter] addObserver:self
selector: @selector(playbackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:mp.moviePlayer];
[mp release];
}
[theURL release];
}
-(void) playbackDidFinish:(NSNotification*)aNotification
{
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self dismissMoviePlayerViewControllerAnimated];
}
編輯:誰能複製這個?任何人?
還沒有想出這一個。這是SDK的錯誤還是我錯過了什麼?奇怪的是,這部電影將播放一次,但無法再播放。 – user852740 2010-07-12 14:03:50
@jeeva你的鏈接是垃圾郵件和煩人的。 – 2011-03-21 20:41:25