Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The embedded youtube video becomes unresponsive on the device (iphone) once after playback controls disappear.
User has to wait until playback is done to get the controls back.
This problem is holding up a product that is otherwise ready for submission to the app store! Please help!
Based on results from an iPad 3 (iOS 6.0) and iPhone 5 (iOS 6.1.4), it looks like the problem is somehow caused by the `GetSupportedInterfaceOrientations()` override in the `AppDelegate`. Commenting out this override fixes the problem for me.
Going the other direction, a minimal sample project that does not include a `GetSupportedInterfaceOrientations()` override does not show the problem. Adding the override introduces the problem. Example "Xamarin Test Case" attached.
Translating the example line-by-line to Objective-C, and then compiling and running with Xcode does *not* show the problem. Example "Xcode Test Case" attached.
Steps to reproduce:
1. Run the app.
2. Tap the YouTube video to start it playing.
3. Wait for the controls to disappear.
4. Tap anywhere on the screen to try to bring up the video playback controls.
The playback controls do not appear in the "Xamarin Test Case", but they do appear in the "Xcode Test Case". The result is the same on both the iPad and the iPhone.
Created attachment 4705 [details]
Xamarin Test Case
Created attachment 4706 [details]
Xcode Test Case
Another partial work-around: using the `Info.plist` to restrict the App-wide orientations does not cause the problem.
Has this bug been addressed in a later release. I'm not interested in a work around - that's not really fixing the problem.
This is a bug in iOS/Apple's code.
What happens is that when the app goes full-screen, iOS creates a temporary UIWindow covering the whole screen (which does not respond to tapping events, etc). This temporary UIWindow stays on top until it's freed, which happens quite quickly for normal iOS apps (since they usually don't retain it).
Xamarin.iOS will however create a managed wrapper for this temporary UIWindow when it's passed to GetSupportedInterfaceOrientations, and that managed wrapper will retain it.
Now this temporary UIWindow will stay on screen until the managed wrapper is freed by the GC. As an interesting consequence a (bad) workaround is to call GC.Collect a few times when the app goes fullscreen.
The bug is that iOS should not depend on the temporary UIWindow's lifetime, since user apps can in theory (and Xamarin.iOS apps do in practice) retain it and thus extend its lifetime.
For now adding this overload of GetSupportedInterfaceOrientations to your AppDelegate will work:
public UIInterfaceOrientationMask GetSupportedInterfaceOrientations (UIApplication application, IntPtr forWindow)
(and delete the existing overridden GetSupportedInterfaceOrientations implementation).
*** Bug 15244 has been marked as a duplicate of this bug. ***
Radar bug filed: 15206717
This may work but how would the user rotate the device to see the YouTube video in Landscape?
Also, once the video is exited, the app is non-responsive for several minutes. This is even after implementing the GC.Collect when the video loads. I don't think this bug is RESOLVED.
(In reply to comment #11)
> This may work but how would the user rotate the device to see the YouTube video
> in Landscape?
Sorry I wasn't clear, you can modify what the function returns as you wish, so this will work:
return UIInterfaceOrientationMask.All; // or any other value
The important part is the function signature, not the actual code within.
(In reply to comment #12)
> Also, once the video is exited, the app is non-responsive for several minutes.
> This is even after implementing the GC.Collect when the video loads. I don't
> think this bug is RESOLVED.
Did you implement the GetSupportedInterfaceOrientations method as I explained in comment #8, or did you just add GC.Collect? The test case provided works fine for me after tapping Done if I implement GetSupportedInterfaceOrientations as I've explained.
Unfortunately, the real, ideal fix for this will need to come from Apple. The Radar bug (15206717) is a bug that has been filed on Apple's bug tracking system, requesting that they fix this. That's why this bug has been marked as resolved upstream. The fix will need to come from Apple, "upstream" of Xamarin.
Rolf, feel free to correct me if I'm misstating this.
Brendan is entirely correct.
Since it's unlikely that Apple will fix their issue, I've implemented a workaround in Xamarin.iOS, so this should work in a future release (probably 7.0.4).
*** This bug has been marked as a duplicate of bug 21669 ***