-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Blank YouTubePlayerView after return from 2 hours in background #4
Comments
Hi @jackpal, Thanks for your detailed bug report 👍 This seems like a very strange behaviour and I will try to check if I can reproduce this bug on my side too. But I think it might be the same scenario as in your last issue where no visible error is reported in the Xcode Debug Console, Simulator Console and JavaScript Console via Safari Developer Tools. Of course a possible solution would be to reload the entire YouTubePlayer when a |
I tried that (by updating the player configuration referrer), and it "may" have worked. I need to do some overnight tests to be sure. In past tests I noticed that when the app gets into that state, the YouTubePlayer.State is "ready" and the YouTubePlayer.PlaybackState is "cued". So maybe I can use a timer to determine that the PlaybackState is stuck in "cued" and then only reset the player when stuck mode is detected. I also tried registering for some of the more obscure error callbacks like WKNavigationDelegate webViewWebContentProcessDidTerminate, but as far as I can tell that's not being called in this situation. |
Follow-up - the "always reload on didBecomeActive" approach seems to be working. Thanks for the suggestion! |
Additionally, I have just pushed a feature branch Apple declares that the Therefore I switched back the way of receiving JavaScript events in the same way as the official Maybe this change could potentially resolve this issue 🤔 |
The feature branch As far as my own debugging I haven't experienced a blank YouTubePlayerView even after long background time so I'm closing this issue for now. Please feel free to re-open the issue at anytime ✌️ |
Unfortunately I can still reproduce the black screen bug using 1.1.3. If you want to see if you can repro it too, clone the https://github.com/jackpal/AmahTV project and sync to 6a4ab4c96cc3f552017b0cea09c3569862c03506 Run the app, pick any channel, switch to some other app, wait a day, and then rerun the app. It's not a huge deal, as the work-around still works. Feel free to close the bug as "can't repro"... or "has work around". |
Seems like there is some internal stuff going on inside the I will keep this issue closed for now and maybe try to find a fix for this issue in the near future 🤔 |
This bug is similar to my previous bug, but it happens on iPhones as well, not just an iPad in portrait mode. So I think it's more serious.
I've seen this bug in my own app that uses YouTubePlayerKit, but I figure you'd prefer a repro that uses your own example app.
I tried a bunch of things to get around the issue, but as you can imagine it takes a while to run each test. I haven't found a work-around that I am sure works yet.
configuration
Xcode 15, iOS 15.0.2, YouTubePlayerKit 1.1.1
Repros on iPad 2018, iPad Mini 2021, iPhone 13 Pro
Repro steps:
Build and install WWDCKeynote app on iPhone
Run app
Lock screen
Wait a couple of hours (Sorry I haven't nailed down the minimum time for this repro. Waiting overnight has always reproduced the issue, I think two hours has also always reproduced the issue.. 30 minutes is usually not enough.)
Unlock screen
Expected:
See WWDC video
Actual:
Blank view for the Video, need to force-quit the app to get it to work again
I can also reproduce this by putting the WWDC app into the background, and doing "stuff" with my phone, such as playing videos in the YouTube app, surfing the web in Safari, and then switching back to the app. But it doesn't always reproduce this way, so it's harder to use it as a test case.
The text was updated successfully, but these errors were encountered: