Iam嘗試播放來自遠程位置的視頻,並嘗試在整個屏幕上覆蓋一個窗口,該窗口或多或少都是透明的,邊緣上的圖像很少。一旦電影預先加載,我就播放視頻。第一次發生這種情況。但是,如果我嘗試重播視頻,它不會播放視頻,我也無法點擊播放器控件上的播放按鈕。我猜覆蓋窗口已經超過了控件。我如何獲得覆蓋窗口的控件?MPMoviePlayerController和覆蓋窗口
// - (空)moviePlayerContentPreloadDidFinish:(NSNotification *)通知{
NSLog(@"content preloaded");
NSDictionary *userInfo = [notification userInfo];
if ([userInfo valueForKey:@"error"]) {
NSLog(@"*** An error occurred preloading the movie");
return;
}
[self.spinner stopAnimating];
// Add the overlay view to the movie, so we can catch the clicks
OverlayViewController *ovc = [[OverlayViewController alloc] initWithNibName:@"OverlayView" bundle:nil];
self.overlayController = ovc;
[ovc release];
[self.overlayController setNextResponder:self];
MPMoviePlayerController *moviePlayer = [notification object];
[moviePlayer play];
// Locate the movie player window
NSArray *windows = [[UIApplication sharedApplication] windows];
NSLog(@"window count= %d",[windows count]);
if ([windows count] < 2) {
NSLog(@"*** Window for movie player is missing");
return;
}
UIWindow *moviePlayerWindow = [windows objectAtIndex:1];
[moviePlayerWindow addSubview:self.overlayController.view];
}
,我用的是
我是不是做錯了什麼的代碼。是否有可能通過覆蓋控制或自動播放它。