您好,我遇到了与添加子视图相关的问题;我正在遵循代码:
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)
{
// The device is an iPad running iPhone 3.2 or later.
iVideoPlayer.view.frame = CGRectMake(353,258,320,240);
}
else
{
iVideoPlayer.view.frame = CGRectMake(156,96,168,148);
}
[iVideoPlayer play];
在这段代码中,我喜欢将视频播放器添加为 subview 。我已经成功添加了videoPlayer。但是问题是在视频播放过程中,如果我点击指定区域(CGRectMake(353,258,320,240);视频停止。我喜欢应用videoPlayer功能(下一个,暂停,音量上/下)没有完成。如何解决这个问题。?