iOS13 + tvOS13 error: MPMoviePlayerController is no longer available

iOS13 + tvOS13 error: MPMoviePlayerController is no longer available
0

Apple no longer supports MPMoviePlayerController in iOS13 + tvOS13 causing the following error when running on xcode11:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'MPMoviePlayerController is no longer available. Use AVPlayerViewController in AVKit.'

I believe the error is associted with the cocos2dx UIVideoPlayer classes refered in the wrapper files: UIVideoPlayer-iOS.mm, UIVideoPlayer-mac.mm and UIVideoPlayer-iOS.h.

I know that @minggo from cocos 2dx dev team is working on this issue: https://github.com/cocos2d/cocos2d-x/pull/20085

  1. Do you know when will a version fixing this bug will be released?
  2. (kind of stupid question) is it ok just to replace the UIVideoPlayer files (UIVideoPlayer-iOS.mm, UIVideoPlayer-mac.mm and UIVideoPlayer-iOS.h) instead of migrating the entire project?

Thanks

It looks like the pull request is merged so just have to pull latest cocos2d-x from github and it should be fine.

Is it ‘safe’ to do so or should I wait for the next version release?

Well, you should ask the devs. In theory, it’s better to wait for the next release.

@FelixFox it is more secure just modify the codes according to the PR as the file may has other modification compared to your engine version. We are considering releasing a version recently but it may take weeks.

I think I’ll better wait for the next stable release.
Thanks