Video blacked out in screenshot of UIWebView
I am having trouble capturing a screenshot of a UIWebView
while it plays a video file.
I can capture when the video file is not playing and it is perfect but when the video file is playing in UIWebView开发者_运维百科
, if I take a screenshot the video area is black and shows a QuickTime logo.
Can any body help me on this? I am totally frustrated. Any kind of help or suggestion is highly appreciated.
Thanks in Advance.
Sorry, I don't think this is possible. It's a form of copyright protection either in the codec or the video library.
So I did a little researching and maybe this is the way you are doing it however I would suggest maybe
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
And maybe this is causing your video to go black, I am not a hundred percent sure however I would suggest maybe refreshing the web page if you take a screen shot inside of your application? It might look junker though depending on why the screen shot is being taken. Anyways hope this helps:)
精彩评论