我正在尝试在我的应用中播放来自Youtube的视频 代码:
videoView = [[UIWebView alloc] initWithFrame:self.frame];
videoView.backgroundColor = [UIColor clearColor];
videoView.opaque = NO;
videoView.delegate = self;
videoView.mediaPlaybackRequiresUserAction=NO;
videoView.scrollView.scrollEnabled=NO;
NSURL *url=[NSURL URLWithString:str];
NSURLRequest *request=[NSURLRequest requestWithURL:url];
[videoView loadRequest:request];
[self addSubview:videoView];
videoView=nil;
但它显示了一些错误,如:
CGContextSaveGState: invalid context 0x0 error.
CGContextSetBlendMode: invalid context 0x0.
CGContextSetAlpha: invalid context 0x0
CGContextScaleCTM: invalid context 0x0.
CGContextClipToRect: invalid context 0x0.
CGContextDrawTiledImage: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0
CGContextGetCTM: invalid context 0x0.
CGContextClipToRect: invalid context 0x0.
CGContextDrawTiledImage: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0.
CGContextGetCTM: invalid context 0x0.