Невозможно одновременно удовлетворить ограничения Предупреждения с AVPlayerViewController, встроенным в раскадровку

Я пытаюсь полностью настроить AVPlayerViewController через раскадровки, встроив в отдельный контроллер представления.

Шаги:

  1. Создайте приложение с одним представлением в Xcode.
  2. Встроить VC в навигационный контроллер.
  3. Добавить панель инструментов внизу (прикреплена к superView (Ведущий, Конечный, Нижняя направляющая макета, Высота (44)).
  4. Добавьте представление контейнера в родительский контроллер представления (закреплено в superView (ведущий, завершающий), руководство по верхнему макету, верхняя панель инструментов).
  5. Удалите контроллер представления по умолчанию, который поставляется с представлением контейнера.
  6. Перетащите объект AV Player View Controller из библиотеки объектов.
  7. Подключите переход от Container View к AV Player View Controller.

КОД НЕ ДОБАВЛЯЕТСЯ.

Вот как выглядит моя раскадровка:

введите описание изображения здесь

Просмотреть иерархию:

введите описание изображения здесь

Все работает нормально: НО ПРОБЛЕМА: Как только я запускаю его, я получаю эти предупреждения в отладчике:

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>",
    "<NSLayoutConstraint:0x7f9325859740 H:[AVButton:0x7f93258609b0]-(>=15)-[UILabel:0x7f93234e53f0'Live Broadcast'](LTR)>",
    "<NSLayoutConstraint:0x7f932583bea0 UILabel:0x7f93234e53f0'Live Broadcast'.right <= AVButton:0x7f932585e480.left - 15>",
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9325859740 H:[AVButton:0x7f93258609b0]-(>=15)-[UILabel:0x7f93234e53f0'Live Broadcast'](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.910 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:0x7f9323520650 H:|-(0)-[UIActivityIndicatorView:0x7f93234e6ee0]   (Names: '|':UIView:0x7f93234e6120 )>",
    "<NSLayoutConstraint:0x7f93235206a0 H:[UIActivityIndicatorView:0x7f93234e6ee0]-(10)-[UILabel:0x7f93235203b0'Loading\U2026']>",
    "<NSLayoutConstraint:0x7f9323520740 H:[UILabel:0x7f93235203b0'Loading\U2026']-(0)-|   (Names: '|':UIView:0x7f93234e6120 )>",
    "<NSLayoutConstraint:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120]   (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0 )>",
    "<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX>",
    "<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>",
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>",
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>",
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f93235206a0 H:[UIActivityIndicatorView:0x7f93234e6ee0]-(10)-[UILabel:0x7f93235203b0'Loading…']>

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.912 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:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120]   (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0 )>",
    "<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX>",
    "<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>",
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>",
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>",
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX>

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.912 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:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120]   (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0 )>",
    "<NSLayoutConstraint:0x7f9323510d10 H:[UIView:0x7f93234e6120]-(>=0)-|   (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0 )>",
    "<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>",
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>",
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>",
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9323510d10 H:[UIView:0x7f93234e6120]-(>=0)-|   (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0 )>

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.913 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>",
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>",
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>",
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](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.

Извините за длинный журнал, но все сразу появляется, так что в том числе. Что мне не хватает? Автоматическая раскладка работает отлично. Даже в ротации. Почему я вижу эти предупреждения?

Добавлен пример проекта.

P.S.: использование Xcode версии 7.0

ОБНОВЛЕНИЕ

Снятие флажка Shows Playback Controls с AVPlayerViewController в инспекторе атрибутов каким-то образом исправляет это, и я не вижу предупреждений. Но мне нужен контроль. Все больше похоже на баг.


person Ishan Handa    schedule 30.09.2015    source источник
comment
Вы сказали, что авторазметка работает отлично. Вы запустили этот код на всех возможных устройствах/размерах экрана, чтобы увидеть, действительно ли он не сломается ни для одного из них? В Interface Builder есть режим предварительного просмотра.   -  person Nicolas Miari    schedule 30.09.2015
comment
Предварительный просмотр показывает только пустой вид контейнера. На симуляторе работает нормально.   -  person Ishan Handa    schedule 30.09.2015
comment
Добавлен пример проекта.   -  person Ishan Handa    schedule 30.09.2015
comment
Ммм, без понятия. Пытался запустить ваш код. IB не выдает предупреждений об авторазметке во время редактирования. Удаление вертикальных ограничений AVPlayer приводит к появлению белого экрана (вместо черного), а предупреждения во время выполнения по-прежнему появляются. В прошлый раз, когда я использовал видеоплееры, автомакета или раскадровки еще не было...   -  person Nicolas Miari    schedule 30.09.2015
comment
У меня точно такая же проблема, и я почти уверен, что она связана с ios9, так как до обновления все работало нормально.   -  person jalone    schedule 04.10.2015
comment
@jalone Да. Снятие флажка Shows Playback Controls, кажется, позаботится о предупреждениях. Я добавил это к вопросу. Все равно не исправление.   -  person Ishan Handa    schedule 05.10.2015
comment
У меня тоже есть эта проблема, иногда на панели iPad нет элементов управления воспроизведением из-за этой проблемы с ограничениями после выхода из полноэкранного режима. Цель развертывания была 9.3, изменена на 10, нет проблем с исчезновением элементов управления воспроизведением, но все еще есть предупреждения.   -  person Anton    schedule 19.12.2016


Ответы (6)


На самом деле, я думаю, что это ошибка на стороне Apple.

Я нашел обходной путь: установите для showPlaybackControls значение YES после установки AVPlayerViewController.player.

Я изменяю ваш образец следующими строками, и ошибка Constraint больше не появляется:

@interface ViewController ()

@property(weak, nonatomic) AVPlayerViewController * playerViewController;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mp4"];
    NSURL *url = [[NSURL alloc] initFileURLWithPath: path];
    AVPlayer * player = [AVPlayer playerWithURL:url];

    self.playerViewController.player = player;
    self.playerViewController.showsPlaybackControls = YES;
}


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"AVPlayerSegue"]) {
        self.playerViewController = segue.destinationViewController;
    }
}


@end

Обратите внимание, что в проект добавлен файл test.mp4.

person gbitaudeau    schedule 09.10.2015
comment
Я не уверен в использовании свойства showsPlaybackControls. В документах говорится: «Не используйте это свойство для изменения видимости элементов управления воспроизведением, когда контроллер представления проигрывателя находится на экране, поскольку это создает или уничтожает элементы пользовательского интерфейса». А также это не работает, если я не предоставляю URL-адрес ресурса AVPlayer. Что делать, если мне нужно динамически загружать AVAsset во время выполнения? В этом случае мне придется настроить пользовательский интерфейс прежде всего. Согласно вашему ответу, предоставление фиктивного файла может быть решением на данный момент. Это немного помогает. - person Ishan Handa; 10.10.2015
comment
Мне не помогло (исключение все равно видно) на iPhone6s Plus, iOS9.2. - person Vladimír Slavík; 08.02.2016
comment
у меня тоже не сработало, я получаю ряд предупреждений о ограничениях, все горизонтально, как только я нажимаю кнопку полноэкранного режима. iOS 9.3. - person Mojo66; 23.04.2016
comment
Если вы создаете AVPlayerViewController из кода, не забудьте установить showsPlaybackControls в NO сразу после создания. Это помогло мне (вместе с приведенным выше фрагментом). - person skensell; 04.05.2016
comment
Установка для showPlaybackControls значения false во время инициализации и значения true, когда носитель готов к воспроизведению, устранило предупреждение об ограничении макета. Однако это также приводит к сбою деинициализации AVPlayer, когда AVPlayerViewController уходит. - person picciano; 07.07.2016
comment
@gbitaudeau Я проверил, что вышеизложенное не работает на iOS 10 и xcode 8.2. Любая помощь будет оценена. - person The iCoder; 23.06.2017
comment
@PavanMore Я просто попробовал это на своем iPhone 6 с iOS 10.3.2 с Xcode 8.2, и он работает очень хорошо без каких-либо предупреждений. Вы заметили, что вам нужен файл test.mp4? - person gbitaudeau; 23.06.2017
comment
@gbitaudeau Да, я добавил видеофайл. Я проверяю xcode 8.2 и iOS 10.2 с симулятором iPhone 6. Что я заметил, когда я нажимаю кнопку воспроизведения видео и делаю полноэкранный режим, он выдает предупреждения. - person The iCoder; 23.06.2017

Я скачал ваш код и посмотрел на него. Вы не делаете ничего плохого. Тот факт, что вы можете снять флажок «Показать управление воспроизведением», по-видимому, указывает на то, что проблема связана с платформой AVKit. Я даже пытался установить значение false в файле XIB, а затем вызывать [self setShowsPlaybackControls:YES]; после viewDidAppear: с теми же результатами. Это определенно ошибка Apple, и вы должны создать отчет об ошибке.

person Danny Bravo    schedule 06.10.2015

В моем случае я разрешаю на iPhone только портретный режим, в то время как я хочу, чтобы AVPlayerViewController имел все направления.

В AppDelegate у меня есть код, который выглядит так:

public func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {

    if self.window?.rootViewController?.presentedViewController is AVPlayerViewController {

        return .All
    }
    return Device.current.contains(.iPhone) ? [.Portrait, .PortraitUpsideDown] : .All
}

Когда AVPlayerViewController представлен модально, повернут в альбомную ориентацию и закрыт, я получу очень улыбчивый стек ошибок, который нарушил некоторые ограничения.

В качестве обходного пути я добавил этот код в свой RootViewController, который также представляет любой экземпляр AVPlayerViewController в моем приложении:

public override func dismissViewControllerAnimated(flag: Bool, completion: (() -> Void)?) {

    if let playerViewController = self.presentedViewController as? AVPlayerViewController {

        playerViewController.showsPlaybackControls = false
    }

    super.dismissViewControllerAnimated(flag, completion: completion)
}

По сути, я ловлю момент, когда пользователь нажимает кнопку «Отклонить» и использует обходной путь, найденный в исходном сообщении с вопросом.

person DevAndArtist    schedule 18.08.2016

К сожалению, эта ошибка все еще присутствует в iOS 10.1. Во всяком случае, я заметил, что если я представляю контроллер представления с seekTime, установленным на 0, ошибка отсутствует. Итак, мое решение состояло в том, чтобы приостановить проигрыватель, сохранить текущее время, найти проигрыватель до 0, предъявить контроллер и по завершении сделать следующее: перейти к сохраненному времени и воспроизвести снова.

AVPlayer *player;
AVPlayerViewController *avPlayerController;
CMTime currentTime;

- (void)viewDidLoad {
    [super viewDidLoad];

    NSURL *videoURL = [NSURL URLWithString:@"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"];
    player = [AVPlayer playerWithURL:videoURL];
    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player];
    [self.playerView.layer addSublayer:playerLayer];
    playerLayer.frame = self.playerView.bounds;
    avPlayerController = [[AVPlayerViewController alloc] init];
    avPlayerController.player = player;

}

- (IBAction)fullScreen:(id)sender {
    [player pause];
    currentTime = player.currentTime;
    [player seekToTime:CMTimeMake(0, 1)];

    [self presentViewController:avPlayerController animated:YES completion:^{
        [avPlayerController.player seekToTime:currentTime];
        [avPlayerController.player play];
    }];
}
person Marius Tanasoiu    schedule 02.12.2016
comment
После двух дней борьбы с этой ошибкой ваш единственный обходной путь, который работает для меня (iOS 10.3). - person José Pereda; 07.07.2017

Я понял, что это происходит, когда вы пытаетесь представить один и тот же экземпляр AVPlayerViewController (используя сильное свойство ссылки) во второй, третий и т. д. раз, и элементы управления плеером не сбрасываются (т.е. прогресс не в начале).

Полоса прогресса не в 0:00

На самом деле, если вы столкнулись с тем же сценарием, прежде чем нажимать «Готово», попробуйте перетащить индикатор выполнения в начало и снова представить AVPlayerViewController. Тогда проблема с автомакетом должна исчезнуть!

Таким образом, в основном проблема Autolayout (кстати, проблема Apple) может быть решена, если вы сбросите элементы управления перед закрытием AVPlayerViewController. Но что, если вы хотите представить то же самое видео? В моем случае я хочу сохранить ссылку на AVPlayerItem:

@property (strong, nonatomic) AVPlayerItem *playerItem;

Но я не хочу, чтобы этот сбой произошел:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'
*** First throw call stack:
(0x184035900 0x1836a3f80 0x18a254958 0x18a23fc14 0x100054a2c 0x188d5fe50 0x188d5fdcc 0x188d47a88 0x188d5f6e4 0x188d18294 0x188d58820 0x188d57e1c 0x188d284cc 0x188d26794 0x183fecefc 0x183fec990 0x183fea690 0x183f19680 0x185428088 0x188d90d90 0x1000eea78 0x183aba8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

Поэтому мой обходной путь заключался в том, чтобы создавать копию AVPLayerItem каждый раз, когда я нажимаю AVPlayerViewController. Таким образом, проблема сбоя и автоматической компоновки исчезла. Однако видео сбрасывается каждый раз, когда вы нажимаете на плеер.

AVPlayerViewController *playerViewController = [AVPlayerViewController new];
playerViewController.player = [[AVPlayer alloc] initWithPlayerItem:self.playerItem.copy];
person jomafer    schedule 22.01.2016
comment
выглядит многообещающим решением - person elliotrock; 09.03.2016

Это предупреждение говорит о том, что вы использовали одно дополнительное ограничение, которое не нужно было использовать.

ToolBarHeight по умолчанию составляет 44 для всех устройств iphone, здесь вы использовали ограничение высоты для UIToolBar. Таким образом, ограничение высоты панели инструментов здесь является дополнительным. Удалите это ограничение, предупреждение будет удалено автоматически.

person baydi    schedule 02.10.2015
comment
Я понимаю, что означает предупреждение. Но это не из-за ограничения высоты панели инструментов. Хотя высота по умолчанию равна 44, при необходимости ее можно увеличить или уменьшить. Поэтому добавление ограничения на него не должно быть проблемой. Более того, я не вижу панели инструментов нигде в зарегистрированных конфликтующих ограничениях. Но все же я попытался удалить ограничение, и это не помогает. Я получаю точно такие же предупреждения. - person Ishan Handa; 02.10.2015