Hello, I ran into a problem related to adding subview; I follow the code:
NSString *urlStr = [NSString stringWithFormat:@"http:x/iphone0.m3u8"];
NSURL *videoURL = [NSURL URLWithString:urlStr];
MPMoviePlayerController *iVideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:videoURL];
[self.view addSubview:iVideoPlayer.view ];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
iVideoPlayer.view.frame = CGRectMake(353,258,320,240);
}
else
{
iVideoPlayer.view.frame = CGRectMake(156,96,168,148);
}
[iVideoPlayer play];
In this code, I like to add a video player as a subtitle. I successfully added videoPlayer.but the problem is that during video playback, if I click on the specified area (CGRectMake (353,258,320,240), the video stops. I like to use the VideoPlayer function (hereinafter, Pause, Volume up / down), which are not executed How to resolve this.?
source
share