thumbnailImageAtTime: now deprecated - What's the alternative?

后端 未结 7 1260
小鲜肉
小鲜肉 2020-12-04 20:27

Until iOS7 update I was using...

UIImage *image = [moviePlayer thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNea         


        
相关标签:
7条回答
  • 2020-12-04 20:51

    I've just looked for a solution for this problem myself and got good help from your question. Got your code above to work with one small change, removed a colon...

    Change

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerThumbnailImageRequestDidFinishNotification::) name:MPMoviePlayerThumbnailImageRequestDidFinishNotification object:moviePlayer];
    

    to

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerThumbnailImageRequestDidFinishNotification:) name:MPMoviePlayerThumbnailImageRequestDidFinishNotification object:moviePlayer];
    

    Got this to work nicely. Also, I've found that you can't call a method the rely on NotificationCenter if you're already in a notification selector. Something I tried at first - I tried calling requestThumbnailImagesAtTimes inside the notification selector for MPMoviePlayerPlaybackDidFinishNotification - something that won't work. I think because the notification won't fire.

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