小编Tan*_*han的帖子

在iphone上获取流媒体视频的屏幕截图

如何在iphone上获取流媒体视频的屏幕截图.我尝试了几种方法.

  1. UIGetScreenImage() - >这是私有的.如果我使用该应用程序将被拒绝.

  2. UIGraphicsBeginImageContext(CGSizeMake(1024,768)); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage*viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();

    The code above cannot take the screenshot of video layer.
    
    Run Code Online (Sandbox Code Playgroud)
  3. MPMoviePlayerController*movie = [[MPMoviePlayerController alloc] initWithContentURL [NSURL URLWithString:@"myMovie.mp4"]]; UIImage*singleFrameImage = [movie thumbnailImageAtTime:10 timeOption:MPMovieTimeOptionExact];

    The code above does not work on a streaming video.
    
    Run Code Online (Sandbox Code Playgroud)

除了AVFoundation,我还能尝试什么?谢谢.

iphone objective-c ipad

7
推荐指数
1
解决办法
5711
查看次数

标签 统计

ipad ×1

iphone ×1

objective-c ×1