question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS 13 support for YouTubeStandaloneIOS

See original GitHub issue

When using YouTubeStandaloneIOS on iOS 13, the app crashes with error: MPMoviePlayerViewController is no longer available. Use AVPlayerViewController in AVKit. Looks like MPMoviePlayerViewController was deprecated and completely removed on iOS 13.

Example code:

YouTubeStandaloneIOS.playVideo(youtube_id)
	.then(() => Orientation.lockToPortrait())
	.catch(errorMessage => {
		Orientation.lockToPortrait();
		StatusBar.setHidden(false);
		Linking.openURL('https://www.youtube.com/watch?v=' + youtube_id);
	})

Related issue?: https://github.com/0xced/XCDYouTubeKit/issues/157 https://github.com/0xced/XCDYouTubeKit/issues/157#issuecomment-208328872

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
thanhcuong1990commented, Oct 15, 2019

@davidohayon669 Please take a look my PR for this issue. #408

1reaction
davidohayon669commented, Oct 15, 2019

@thanhcuong1990 had to change your code a bit in bae6948ed77f2a0371b1ee9d38cb13756445f89a, the older implementation (MPMoviePlayer) was resolving the Promise on each dismissing of the player. Using the AVPlayer I’m not sure how to achieve that, there is no point in resolving the Promise only if the video actually finishes playing (which is what AVPlayerItemDidPlayToEndTimeNotification is for) this might never happen with regular use.

If you can improve that implementation it would be great. My idea is to resolve with the promise when the playing is dismissed (The modal is dismissed) and reject if anything wrong happened between launching the modal and finishing playing the video (by dismissing the modal). AVPlayer errors should also dismiss the modal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 13 support for YouTubeStandaloneIOS #404 - GitHub
When using YouTubeStandaloneIOS on iOS 13, the app crashes with error: MPMoviePlayerViewController is no longer available.
Read more >
About iOS 13 Updates - Apple Support
iOS 13.6 adds support for digital car keys, introduces audio stories in Apple News+, and contains a new symptoms category in the Health...
Read more >
Install and set up Office on an iPhone or iPad - Microsoft Support
On your iPhone or iPad, open any standalone mobile Office app (for example, Excel). Sign in with your Microsoft account, or Microsoft 365...
Read more >
Update Google Chrome - iPhone & iPad
To make sure you're protected by the latest security updates, Google Chrome can automatically update when a new version of the browser is...
Read more >
iOS 13 - Wikipedia
Obsolete, because all devices that supported iOS 13 support iOS 14 and iOS 15 as well. Widespread third party app support. Drops support...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found