Im now just having a problem displaying a view/label/button on top of the movieplayer video. In Apple's MoviePlayer sample project, you can add a view on top of the video with this code:
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];
}
The overlayview is a view that contains the requested label and button. However, when I apply the same code to a movie url containing the .m3u8 file it doesn't display the overlay view e.g.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");
The number of windows returned is just 1, as opposed to 2 in the previous example, even though the movie plays. When I check the url to see if it was ok, the movieURL returns null, but it still plays the streamed content. I tried removing the check for window count being greater than 1 but it still didnt display the overlay view.
Does anybody know a way around this? Thanks