이제는 영화 플레이어 비디오 위에보기/레이블/버튼을 표시하는 데 문제가 있습니다. 애플의 MoviePlayer 샘플 프로젝트에서는이 코드를 사용하여 비디오의 상단에 뷰를 추가 할 수 있습니다
MoviePlayerAppDelegate *appDelegate = (MoviePlayerAppDelegate *)[[UIApplication sharedApplication] delegate];
// initialize a new MPMoviePlayerController object with the specified URL, and play the movie
[appDelegate initAndPlayMovie:[self localMovieURL]];
NSArray *windows = [[UIApplication sharedApplication] windows];
if ([windows count] > 1) {
// Locate the movie player window
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
// Add our overlay view to the movie player's subviews so it is displayed above it.
[moviePlayerWindow addSubview:self.overlayView];
}
수 있도록 OverlayView는 요청 된 라벨과 버튼을 포함하는 도면이다. 그러나 .m3u8 파일이 포함 된 영화 URL에 동일한 코드를 적용하면 오버레이보기가 표시되지 않습니다. 예 : 동영상이 재생에도 불구하고, 앞의 예에서이 반대 http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8
NSURL *newMovieURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8">];
if (movieURL) {
NSLog(@"movieURL");
if ([movieURL scheme]) // sanity check on the URL
{ NSLog(@"[movieURL scheme]");
[appDelegate initAndPlayMovie:newMovieURL];
NSArray *windows = [[UIApplication sharedApplication] windows];
NSLog(@"windows count:%d", [windows count]);
if ([windows count] > 1) {
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayerWindow addSubview:self.overlayView];
}
}
else NSLog(@"![movieURL scheme]"); } else
NSLog(@"!movieURL");
반환 창문의 수는 단지 1입니다. url이 ok인지 확인하기 위해 movieURL이 null을 반환하지만 여전히 스트리밍 된 콘텐츠를 재생합니다. 나는 1보다 큰 창 수를위한 수표를 제거하는 것을 시도했다 그러나 아직도 overlay 전망을 표시하지 않았다.
아무도이 문제를 해결할 방법을 알고 있습니까? 감사합니다.