Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'MPMoviePlayerViewController is no longer available. Use AVPlayerViewController in AVKit.' #207

Open
phuoclinh opened this issue Oct 4, 2019 · 10 comments

Comments

@phuoclinh
Copy link

I'm using Xcode 11 and build to device iPhone X (iOS 13).
The log is:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'MPMoviePlayerViewController is no longer available. Use AVPlayerViewController in AVKit.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98a1c +[NSException raise:format:] + 188
3 MediaPlayer 0x00007fff276f18d5 -[MPMoviePlayerViewController initWithContentURL:] + 94

@mouness2020
Copy link

same problem here
crash

@nwkeeley
Copy link

@mouness2020 @phuoclinh any ideas for a fix?

@ferhatabd
Copy link

Since I had to use this Framework I migrated it to use a custom view with AVPlayerLayer as the backing layer.
Instead of subclassing MPMoviePlayerViewController, it now subclasses a standard UIViewController and works as expected.

Until there is an official revision, you can give it a look here

@phuoclinh @mouness2020 @nwkeeley

@nwkeeley
Copy link

nwkeeley commented Jan 7, 2020

Thats great thank you very much @ferhatabd

@SerxhioGugo
Copy link

Hey @ferhatabd I'm using your version, maybe it's just me but creating the MobilePlayerViewController doesn't allow me anymore to use contentURL as a parameter, is there any fixes to that?

@ferhatabd
Copy link

ferhatabd commented Jan 15, 2020

Hi @SerxhioGugo,
Since the MPMoviePlayerViewController is not there anymore, its initializer is unavailable too.
That's why what I did was to init thew MobileViewController with the convenience init, and then set all the config parameters with the setConfig method instead. Here is how I'm using it.

@KwesiCobbina
Copy link

can you share how you use it again? Thanks

@ferhatabd
Copy link

can you share how you use it again? Thanks

Hi @KwesiCobbina
The sample ViewController is here
I updated the link, I hope it helps.

@ELiTEGHANA
Copy link

ELiTEGHANA commented Aug 15, 2020 via email

@ELiTEGHANA
Copy link

ELiTEGHANA commented Aug 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants