I'm trying to set up an AVPlayerViewController completely through storyboards by embedding in a separate View Controller.
Steps:
- Create Single View Application in Xcode.
- Embed VC in navigation Controller.
- Add toolbar at the bottom.(pinned to superView (Leading, Trailing, Bottom Layout Guide, Height(44)).
- Add container View in parent View Controller.(pinned to superView (Leading, Trailing), Top Layout Guide, toolbar Top).
- Remove the default View Controller that comes with container view.
- Drag AV Player View Controller object from Object Library.
- Connect embed segue from Container View to AV Player View Controller.
NO CODE ADDED.
This is what my storyboard looks like:
View hierarchy:
Everything runs fine:
BUT THE PROBLEM IS:
As soon as i run it I get these warnings in the debugger:
2015-09-30 12:58:35.904 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>",
"<NSLayoutConstraint:0x7f932592bc70 H:|-(14)-[UILabel:0x7f9325925590'Hi-Speed Scrubbing'] (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592bcf0 H:[UILabel:0x7f9325925590'Hi-Speed Scrubbing']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f932592bcf0 H:[UILabel:0x7f9325925590'Hi-Speed Scrubbing']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-09-30 12:58:35.905 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>",
"<NSLayoutConstraint:0x7f932592bdd0 H:|-(14)-[UILabel:0x7f9325929bb0'Slide your finger up to a...'] (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592be50 H:[UILabel:0x7f9325929bb0'Slide your finger up to a...']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f932592be50 H:[UILabel:0x7f9325929bb0'Slide your finger up to a...']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-09-30 12:58:35.906 AVPlayerTest[9352:446772] 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)
(
"<NSLayoutConstraint:0x7f932592b5e0 V:|-(>=0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592b660 V:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592af50 V:[UIView:0x7f932585e830(44)]>",
"<NSLayoutConstraint:0x7f9325952c30 'UIView-Encapsulated-Layout-Height' V:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f932592b660 V:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-09-30 12:58:35.907 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>",
"<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0 )>",
"<NSLayoutConstraint:0x7f9325829f90 H:[AVButton:0x7f93258609b0]-(15)-[UILabel:0x7f932347dc20'--:--'](LTR)>",
"<NSLayoutConstraint:0x7f9325839550 H:[UILabel:0x7f932347dc20'--:--']-(12)-[AVScrubber:0x7f93234a4350](LTR)>",
"<NSLayoutConstraint:0x7f932585a2f0 AVScrubber:0x7f93234a4350.right == UILabel:0x7f932583a470'--:--'.left - 12>",
"<NSLayoutConstraint:0x7f932580b390 UILabel:0x7f932583a470'--:--'.right == AVButton:0x7f932585e480.left - 15>",
"<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>",
"<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>",
"<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>",
"<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9325829f90 H:[AVButton:0x7f93258609b0]-(15)-[UILabel:0x7f932347dc20'--:--'](LTR)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-09-30 12:58:35.909 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>",
"<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000 )>",
"<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830 )>",
"<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310 )>",
"<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0 )>",
"<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>",
"<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>",
"<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>",