mobileplayer-ios icon indicating copy to clipboard operation
mobileplayer-ios copied to clipboard

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

Open phuoclinh opened this issue 6 years ago • 10 comments

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

phuoclinh avatar Oct 04 '19 06:10 phuoclinh

same problem here crash

mouness2020 avatar Oct 23 '19 13:10 mouness2020

@mouness2020 @PhuocLinh any ideas for a fix?

nwkeeley avatar Nov 10 '19 15:11 nwkeeley

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

ferhatabd avatar Jan 07 '20 05:01 ferhatabd

Thats great thank you very much @ferhatabd

nwkeeley avatar Jan 07 '20 13:01 nwkeeley

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?

SerxhioGugo avatar Jan 15 '20 00:01 SerxhioGugo

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.

ferhatabd avatar Jan 15 '20 04:01 ferhatabd

can you share how you use it again? Thanks

KwesiCobbina avatar Aug 14 '20 15:08 KwesiCobbina

can you share how you use it again? Thanks

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

ferhatabd avatar Aug 15 '20 06:08 ferhatabd

Thanks

On Sat, 15 Aug 2020 at 6:57 AM, Ferhat Abdullahoglu < [email protected]> wrote:

can you share how you use it again? Thanks

Hi @KwesiCobbina https://github.com/KwesiCobbina

The sample ViewController is here https://github.com/ferhatabd/MobilePlayer/blob/bd3c197db56ad85c3c57706e9a551b3f3396f299/Sources/MobilePlayer/Example/ExampleVC.swift

I updated the link, I hope it helps.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sahin/mobileplayer-ios/issues/207#issuecomment-674359487, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBUELQZQZK52GYKEKSTJWDSAYWXFANCNFSM4I5LSPNA .

ELiTEGHANA avatar Aug 15 '20 06:08 ELiTEGHANA

It helped a lot. But the controls don’t show any more. It that intentional?

On Sat, 15 Aug 2020 at 6:59 AM, Kewsi Cobbina [email protected] wrote:

Thanks

On Sat, 15 Aug 2020 at 6:57 AM, Ferhat Abdullahoglu < [email protected]> wrote:

can you share how you use it again? Thanks

Hi @KwesiCobbina https://github.com/KwesiCobbina

The sample ViewController is here https://github.com/ferhatabd/MobilePlayer/blob/bd3c197db56ad85c3c57706e9a551b3f3396f299/Sources/MobilePlayer/Example/ExampleVC.swift

I updated the link, I hope it helps.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sahin/mobileplayer-ios/issues/207#issuecomment-674359487, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBUELQZQZK52GYKEKSTJWDSAYWXFANCNFSM4I5LSPNA .

ELiTEGHANA avatar Aug 15 '20 08:08 ELiTEGHANA