youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.65k stars 684 forks source link

iOS 9 constraint issue while playing video in full screen #174

Open AlphaBetaDebug opened 8 years ago

AlphaBetaDebug commented 8 years ago

I am seeing "Unable to simultaneously satisfy constraints" error in Xcode console when running app on iOS9 device/simulator when videos are playing in full screen. I didn't see this issue on iOS8.

Update: It seems like a iOS 9 bug from apple where fullscreen videos played from UIWebView shows these warnings in console.

(
"<NSAutoresizingMaskLayoutConstraint:0x7fa51ea86cd0 h=-&- v=-&- _UIBackdropContentView:0x7fa51e92b600.width == _UIBackdropView:0x7fa51e9187f0.width>",
"<NSLayoutConstraint:0x7fa51defa670 H:|-(14)-[UILabel:0x7fa51ea4d030'Slide your finger down to...']   (Names: '|':_UIBackdropContentView:0x7fa51e92b600 )>",
"<NSLayoutConstraint:0x7fa51defa6c0 H:[UILabel:0x7fa51ea4d030'Slide your finger down to...']-(14)-|   (Names: '|':_UIBackdropContentView:0x7fa51e92b600 )>",
"<NSLayoutConstraint:0x7fa51def9e10 H:|-(0)-[_UIBackdropView:0x7fa51e9187f0]   (Names: '|':UIView:0x7fa51dddfd70 )>",
"<NSLayoutConstraint:0x7fa51def9e60 H:[_UIBackdropView:0x7fa51e9187f0]-(0)-|   (Names: '|':UIView:0x7fa51dddfd70 )>",
"<NSLayoutConstraint:0x7fa51defa110 H:|-(0)-[UIView:0x7fa51dddfd70]   (Names: '|':AVAlphaUpdatingView:0x7fa51dad7140 )>",
"<NSLayoutConstraint:0x7fa51defa160 H:[UIView:0x7fa51dddfd70]-(0)-|   (Names: '|':AVAlphaUpdatingView:0x7fa51dad7140 )>",
"<NSLayoutConstraint:0x7fa51ea8d1a0 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7fa51dad7140(0)]>"
)

(
    "<NSAutoresizingMaskLayoutConstraint:0x1604987d0 h=-&- v=-&- _UIBackdropContentView:0x1602d4570.width == _UIBackdropView:0x1605e3380.width>",
    "<NSLayoutConstraint:0x161101990 H:|-(14)-[UILabel:0x160257d00'Hi-Speed Scrubbing']   (Names: '|':_UIBackdropContentView:0x1602d4570 )>",
    "<NSLayoutConstraint:0x1611025a0 H:[UILabel:0x160257d00'Hi-Speed Scrubbing']-(14)-|   (Names: '|':_UIBackdropContentView:0x1602d4570 )>",
    "<NSLayoutConstraint:0x161101e50 H:|-(0)-[_UIBackdropView:0x1605e3380]   (Names: '|':UIView:0x1603e0aa0 )>",
    "<NSLayoutConstraint:0x1611020d0 H:[_UIBackdropView:0x1605e3380]-(0)-|   (Names: '|':UIView:0x1603e0aa0 )>",
    "<NSLayoutConstraint:0x161102500 H:|-(0)-[UIView:0x1603e0aa0]   (Names: '|':AVAlphaUpdatingView:0x15fb79da0 )>",
    "<NSLayoutConstraint:0x161102050 H:[UIView:0x1603e0aa0]-(0)-|   (Names: '|':AVAlphaUpdatingView:0x15fb79da0 )>",
    "<NSLayoutConstraint:0x16111ce20 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x15fb79da0(0)]>"
)
piotrros commented 8 years ago

I have the same issue, but warnings are a lot longer. Is it good to leave as it is?

shlomis commented 8 years ago

same issue:

        (
            "<NSLayoutConstraint:0x150e770a0 V:|-(0)-[ExternalPlaybackIndicator...]   (Names: ExternalPlaybackIndicator...:0x150e76840, '|':UIView:0x150e766d0 )>",
                "<NSLayoutConstraint:0x150e772f0 UILabel:0x150f7b360.firstBaseline == ExternalPlaybackIndicator....bottom + 24   (Names: ExternalPlaybackIndicator...:0x150e76840 )>",
                "<NSLayoutConstraint:0x150e77440 UILabel:0x150f7aba0.firstBaseline == UILabel:0x150f7b360.lastBaseline + 20>",
                "<NSLayoutConstraint:0x150e77590 UILabel:0x150f7aba0.lastBaseline == UIView:0x150e766d0.bottom>",
                "<NSLayoutConstraint:0x150cf79b0 UIView:0x150e766d0.centerY == AVExternalPlaybackIndicatorView:0x150f5f970.centerY - 22>",
                "<NSLayoutConstraint:0x150e6f7d0 V:|-(>=10)-[UIView:0x150e766d0]   (Names: '|':AVExternalPlaybackIndicatorView:0x150f5f970 )>",
                "<NSLayoutConstraint:0x150f84f70 V:|-(0)-[AVExternalPlaybackIndicatorView:0x150f5f970]   (Names: '|':UIView:0x150f446e0 )>",
                "<NSLayoutConstraint:0x150f84ff0 V:[AVExternalPlaybackIndicatorView:0x150f5f970]-(0)-|   (Names: '|':UIView:0x150f446e0 )>",
                "<NSLayoutConstraint:0x150f849a0 V:|-(0)-[UIView:0x150f446e0]   (Names: '|':AVPlayerView:0x150f43870 )>",
                "<NSLayoutConstraint:0x150f849f0 V:[UIView:0x150f446e0]-(0)-|   (Names: '|':AVPlayerView:0x150f43870 )>",
                "<NSLayoutConstraint:0x150f9b2c0 'UIView-Encapsulated-Layout-Height' V:[AVPlayerView:0x150f43870(57)]>"
        )
yudinm commented 8 years ago
Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
    (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x128575bd0 h=-&- v=-&- _UIBackdropContentView:0x12852ae60.width == _UIBackdropView:0x12861a5a0.width>",
    "<NSLayoutConstraint:0x1285238d0 H:|-(0)-[UIView:0x12851cf50]   (Names: '|':UIView:0x1274f7b90 )>",
    "<NSLayoutConstraint:0x128523920 H:[UIView:0x12851cf50]-(0)-|   (Names: '|':UIView:0x1274f7b90 )>",
    "<NSLayoutConstraint:0x128521390 H:|-(0)-[UIView:0x1274f7b90]   (Names: '|':UIView:0x1286103c0 )>",
    "<NSLayoutConstraint:0x12852f0a0 H:[UIView:0x1274f7b90]-(0)-|   (Names: '|':UIView:0x1286103c0 )>",
    "<NSLayoutConstraint:0x128634e20 H:|-(0)-[_UIBackdropView:0x12861a5a0]   (Names: '|':UIView:0x12861a430 )>",
    "<NSLayoutConstraint:0x128634eb0 H:[_UIBackdropView:0x12861a5a0]-(0)-|   (Names: '|':UIView:0x12861a430 )>",
    "<NSLayoutConstraint:0x128634b80 H:|-(0)-[UIView:0x12861a430]   (Names: '|':AVAlphaUpdatingView:0x12852b760 )>",
    "<NSLayoutConstraint:0x128634c00 H:[UIView:0x12861a430]-(0)-|   (Names: '|':AVAlphaUpdatingView:0x12852b760 )>",
    "<NSLayoutConstraint:0x128574440 H:|-(0)-[AVAlphaUpdatingView:0x12852b760]   (Names: '|':UIView:0x12851cf50 )>",
    "<NSLayoutConstraint:0x128577a00 H:[AVAlphaUpdatingView:0x12852b760]-(0)-|   (Names: '|':UIView:0x12851cf50 )>",
    "<NSLayoutConstraint:0x125ec8250 H:|-(15)-[UIView:0x12853cc90](LTR)   (Names: '|':_UIBackdropContentView:0x12852ae60 )>",
    "<NSLayoutConstraint:0x12864cd90 UIView:0x1285430b0.centerX == _UIBackdropContentView:0x12852ae60.centerX>",
    "<NSLayoutConstraint:0x1286255d0 UIView:0x12853cc90.right <= UIView:0x1285430b0.left - 55>",
    "<NSLayoutConstraint:0x128637e60 H:|-(0)-[AVForceButton:0x12862db70](LTR)   (Names: '|':UIView:0x1285430b0 )>",
    "<NSLayoutConstraint:0x12864f460 AVButton:0x128562ea0.centerX == AVForceButton:0x12862db70.right + 67>",
    "<NSLayoutConstraint:0x12864f4b0 AVButton:0x128562ea0.centerX == AVForceButton:0x128563c90.left - 67>",
    "<NSLayoutConstraint:0x12864f020 AVForceButton:0x128563c90.right == UIView:0x1285430b0.right>",
    "<NSLayoutConstraint:0x128525fc0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x1286103c0(200)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x128634eb0 H:[_UIBackdropView:0x12861a5a0]-(0)-|   (Names: '|':UIView:0x12861a430 )>

Issue while i try to exit from full screen mode on landscape when my app supports only portrait mode. Appears while using YTPlayerView and iframe embeded in HTML on WKWebView.

mengjang commented 7 years ago

See the same issue when exiting from full screen mode on landscape while the previous view controller is portrait only

I see this with iOS 10