is there any way to take a screenshot when MPMoviePlayerController is playing

前端 未结 1 2015
滥情空心
滥情空心 2020-12-19 18:57

I tried below steps to capture screenshot but got black backround for MPMoviePlayerController

-(UIImage*)screenshot
{
 CGSize imageSize = [[UIScreen mainSc         


        
相关标签:
1条回答
  • 2020-12-19 19:54

    get image from MPMoviePlayerController like this on action of button:

    -(void)getScreenShotOfMPMoviePlayerController:(MPMoviePlayerController *)mpPlayer
    {
       UIImage *thumbnail = [mpPlayer thumbnailImageAtTime:yourMoviePlayerObject.currentPlaybackTime 
                           timeOption:MPMovieTimeOptionNearestKeyFrame];
    }
    

    EDIT : Merge both images as one image taken from MPMoviePlayerController with the ScreenShot taken from UIWindow.

    Refer ios-merging-two-images-of-different-size link for merging.

    0 讨论(0)
提交回复
热议问题