Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

EXC_BAD_ACCESS with iOS 12 and Swift 4.2 #322

Open
g0ld2k opened this issue Sep 17, 2018 · 17 comments
Open

EXC_BAD_ACCESS with iOS 12 and Swift 4.2 #322

g0ld2k opened this issue Sep 17, 2018 · 17 comments

Comments

@g0ld2k
Copy link

g0ld2k commented Sep 17, 2018

I'm having an issue after migrating my code to Swift 4.2 and iOS 12 where after playing content using the youtube-ios-player-helper my app crashes after rotating the screen and interacting with some of the onscreen controls during playback.

I've created a sample project that is experiencing this. I've been able to consistently recreate the issue using the following steps:

  1. Launch the app
  2. Tap YouTube play icon
  3. Rotate the device left
  4. Rotate the device right
  5. Tap on the X in the top corner
  6. Tap on the native play button

Anyone else experiencing this?

@kunaljaypatel
Copy link

kunaljaypatel commented Sep 18, 2018

^^ I have the same problem, right now. Essentially, if I go in and out of fullscreen 1-2x, the app will crash with a EXC_BAD_ACCESS error or a memory issue.

@markotl88
Copy link

I have the same problem too.

@ghost
Copy link

ghost commented Sep 20, 2018

I have the same problem. Check error logs
[28337:1197415] [AudioHAL_Client] AudioHardware.cpp:666:AudioObjectGetPropertyData: AudioObjectGetPropertyData: no object with given ID 0
[28337:1197899] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for +[MRAVOutputContext sharedAudioPresentationContext]_block_invoke

Steps to perform:

  1. Play video.
  2. Open in full screen.
  3. Pause from full screen.
  4. Now close from full screen.
  5. Now play with current screen.
  6. It's crashed with above logs.

@kunaljaypatel
Copy link

kunaljaypatel commented Sep 20, 2018

Just noticed that this library hasn’t been updated in 2 years, despite it being an official YouTube product. I have doubts that this will be fixed in a reasonable time frame. Any recommendations for another similar YouTube library that is regularly maintained?

@GustavoVergara
Copy link

This happens using a UIWebView as well, it's probably an issue with iOS 12

@davidwahl
Copy link

I have the same problem :(

@g0ld2k
Copy link
Author

g0ld2k commented Oct 2, 2018

@kunaljaypatel it doesn't look like there are many YouTube libraries that are regulary maintained. I'm trying to transition to TRVideoView and it seems like it meets my needs and doesn't crash.

@davidwahl
Copy link

I'm actually just using iframe API in Cordova WebView, but solved this for now just by removing the player instance and initializing it again after each video playback.

@kunaljaypatel
Copy link

kunaljaypatel commented Oct 5, 2018

@g0ld2k TRVideoView looks promising. Thanks!

@kunaljaypatel
Copy link

kunaljaypatel commented Oct 5, 2018

@g0ld2k If you want to make minimal changes to your YTPlayerView code, I found a fork
#325 that works well. It uses WKWebView instead of UIWebView, which implies there's an issue with UIWebView and this library in iOS12.

@derekblank
Copy link

Getting this same behavior as well - user goes in and out of fullscreen video, throws EXC_BAD_ACCESS on iOS trying to reference the corrupt pointer.

Our crash logs reference PlaybackSessionModelMediaElement, and digging into Webkit bug reports, there's a recent issue titled "eliminate raw pointer usage in Fullscreen code" that seems like it's related to this. So, possibly, it's a bug with Webkit that could be resolved soon.

@2-D
Copy link

2-D commented Oct 18, 2018

Are there any plans to update this library to WKWebView in the near future? Apple has recommended that people use WKWebView since iOS 8. We are now on iOS 12 and clearly this library is not a viable solution anymore due to these crashes.

@mukeshydv
Copy link

With similar implementation I have ported this library into Swift here YoutubePlayerView

@YangPeiqiu
Copy link

I have the same problem too.
How to solve? Any Suggestions

@lexuanquynh
Copy link

I have same issue. How to slove?

@kunaljaypatel
Copy link

kunaljaypatel commented Feb 7, 2019

I've been using a fork,YoutubePlayer-in-WKWebView, since early October 2018 to get around this issue. It has a very similar implementation, and it's supported.

@iamdeadman
Copy link

I tried both the forks YoutubePlayer-in-WKWebView and https://github.com/mukeshydv/YoutubePlayerView but both of them return the same error with the avplayer feature. Inline play works well but the native avplayer breaks with this exception.
Does anyone have a solution or know how to fix this issue

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

No branches or pull requests