设置Apple TV视频JavaScript

时间:2015-09-11 08:12:13

标签: javascript apple-tv tvos

我有一个简单的功能,可以启动处理Apple TV视频播放的player

function launchPlayer() {
    var player = new Player();
    var playlist = new Playlist();
    var mediaItem = new MediaItem("video", "http://localhost:9001/videos/nsoperations.mp4");
    player.playlist = playlist;
    player.playlist.push(mediaItem);
    player.present();
}

根据Player Documentation,播放视频所需的全部内容包括播放器,播放列表(docs)和媒体项(docs)。我已经拥有了所有这些,但在运行我的代码时,我收到一个错误: Unable to simultaneously satisfy constraints.根据我的理解,我们不会为这些内置播放器处理自动布局。我是否错误地使用了播放器?

错误的全部细节如下:

(
    "<NSLayoutConstraint:0x7f8162e8f270 UIView:0x7f8162e964b0.leading == UIView:0x7f8162e9a640.leading>",
    "<NSLayoutConstraint:0x7f8162e945b0 H:|-(0)-[UIView:0x7f8162e964b0]   (Names: '|':TVRelatedContentView:0x7f8162e990a0 )>",
    "<NSLayoutConstraint:0x7f8162e930c0 H:|-(90)-[UIView:0x7f8162e9a640]   (Names: '|':TVRelatedContentView:0x7f8162e990a0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162e8f270 UIView:0x7f8162e964b0.leading == UIView:0x7f8162e9a640.leading>

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-11 07:35:59.886 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162e93a20 UIView:0x7f8162e964b0.trailing == UIView:0x7f8162e9a640.trailing>",
    "<NSLayoutConstraint:0x7f8162e92de0 UIView:0x7f8162e964b0.trailing == TVRelatedContentView:0x7f8162e990a0.trailing>",
    "<NSLayoutConstraint:0x7f8162e930c0 H:|-(90)-[UIView:0x7f8162e9a640]   (Names: '|':TVRelatedContentView:0x7f8162e990a0 )>",
    "<NSLayoutConstraint:0x7f8162e975e0 UIView:0x7f8162e9a640.width == TVRelatedContentView:0x7f8162e990a0.width>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162e93a20 UIView:0x7f8162e964b0.trailing == UIView:0x7f8162e9a640.trailing>

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-11 07:36:00.024 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162e93a20 UIView:0x7f8162e964b0.trailing == UIView:0x7f8162e9a640.trailing>",
    "<NSLayoutConstraint:0x7f8162e92de0 UIView:0x7f8162e964b0.trailing == TVRelatedContentView:0x7f8162e990a0.trailing>",
    "<NSLayoutConstraint:0x7f8162e930c0 H:|-(90)-[UIView:0x7f8162e9a640]   (Names: '|':TVRelatedContentView:0x7f8162e990a0 )>",
    "<NSLayoutConstraint:0x7f8162e975e0 UIView:0x7f8162e9a640.width == TVRelatedContentView:0x7f8162e990a0.width - 2010>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162e93a20 UIView:0x7f8162e964b0.trailing == UIView:0x7f8162e9a640.trailing>

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-11 07:36:00.092 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162e975e0 UIView:0x7f8162e9a640.width == TVRelatedContentView:0x7f8162e990a0.width - 2010>",
    "<NSLayoutConstraint:0x7f8162e23cd0 'UIView-Encapsulated-Layout-Width' H:[TVRelatedContentView:0x7f8162e990a0(1920)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162e975e0 UIView:0x7f8162e9a640.width == TVRelatedContentView:0x7f8162e990a0.width - 2010>

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-11 07:36:00.126 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162c8e520 H:|-(>=70)-[UIView:0x7f8162e1dbd0]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>",
    "<NSLayoutConstraint:0x7f8164266d40 UIView:0x7f8164226270.width == _UIAlertControllerCollectionViewCell:0x7f8164228e10.width>",
    "<NSLayoutConstraint:0x7f816423abd0 _UIAlertControllerActionView:0x7f8162ec3a30.width == UIView:0x7f8164226270.width>",
    "<NSLayoutConstraint:0x7f8164224720 'UIView-Encapsulated-Layout-Width' H:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>

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-11 07:36:00.127 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>",
    "<NSLayoutConstraint:0x7f816425a130 'UIView-Encapsulated-Layout-Height' V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>

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-11 07:36:00.127 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>",
    "<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>",
    "<NSLayoutConstraint:0x7f816425a130 'UIView-Encapsulated-Layout-Height' V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>

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-11 07:36:00.128 TestingTVML[3354:323153] 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. 
(
    "<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>",
    "<NSLayoutConstraint:0x7f8162c867b0 V:|-(>=6)-[UIImageView:0x7f8162e22190]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>",
    "<NSLayoutConstraint:0x7f816425a130 'UIView-Encapsulated-Layout-Height' V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>

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-11 07:36:00.138 TestingTVML[3354:323153] 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:0x7f8162f51c30 h=--& v=--& H:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c8e520 H:|-(>=70)-[UIView:0x7f8162e1dbd0]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>",
    "<NSLayoutConstraint:0x7f8164266d40 UIView:0x7f8164226270.width == _UIAlertControllerCollectionViewCell:0x7f8164228e10.width>",
    "<NSLayoutConstraint:0x7f816423abd0 _UIAlertControllerActionView:0x7f8162ec3a30.width == UIView:0x7f8164226270.width>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>

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-11 07:36:00.138 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>

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-11 07:36:00.139 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>",
    "<NSLayoutConstraint:0x7f8162c867b0 V:|-(>=6)-[UIImageView:0x7f8162e22190]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>

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-11 07:36:00.139 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c867b0 V:|-(>=6)-[UIImageView:0x7f8162e22190]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>

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-11 07:36:00.144 TestingTVML[3354:323153] 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:0x7f8162f51c30 h=--& v=--& H:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c8e520 H:|-(>=70)-[UIView:0x7f8162e1dbd0]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>",
    "<NSLayoutConstraint:0x7f8164266d40 UIView:0x7f8164226270.width == _UIAlertControllerCollectionViewCell:0x7f8164228e10.width>",
    "<NSLayoutConstraint:0x7f816423abd0 _UIAlertControllerActionView:0x7f8162ec3a30.width == UIView:0x7f8164226270.width>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c0b2f0 UIView:0x7f8162e1dbd0.trailing <= _UIAlertControllerActionView:0x7f8162ec3a30.trailing - 70>

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-11 07:36:00.145 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c87400 V:[_UIAlertControllerActionView:0x7f8162ec3a30(>=80)]>

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-11 07:36:00.145 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>",
    "<NSLayoutConstraint:0x7f8162c867b0 V:|-(>=6)-[UIImageView:0x7f8162e22190]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c88760 UIImageView:0x7f8162e22190.centerY == _UIAlertControllerActionView:0x7f8162ec3a30.centerY>

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-11 07:36:00.146 TestingTVML[3354:323153] 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:0x7f8162f51cd0 h=--& v=--& V:[_UIAlertControllerCollectionViewCell:0x7f8164228e10(0)]>",
    "<NSLayoutConstraint:0x7f8162c867b0 V:|-(>=6)-[UIImageView:0x7f8162e22190]   (Names: '|':_UIAlertControllerActionView:0x7f8162ec3a30 )>",
    "<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>",
    "<NSLayoutConstraint:0x7f8164266d90 UIView:0x7f8164226270.height == _UIAlertControllerCollectionViewCell:0x7f8164228e10.height>",
    "<NSLayoutConstraint:0x7f816425e320 _UIAlertControllerActionView:0x7f8162ec3a30.height == UIView:0x7f8164226270.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f8162c86800 UIImageView:0x7f8162e22190.bottom <= _UIAlertControllerActionView:0x7f8162ec3a30.bottom - 6>

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.      
  [2]: https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSPlaylist_Ref/index.html#//apple_ref/javascript/cl/Playlist
  [3]: https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSMediaItem_Ref/index.html#//apple_ref/javascript/cl/MediaItem

2 个答案:

答案 0 :(得分:3)

您的样品还可以,并且可以正常工作。即使有约束错误,但玩家也不是很宽容。

我认为您正在使用Python SimpleHTTPServer进行测试,它不适用于视频流,但如果您使用Apache或直接来自apple“http://trailers.apple.com/movies/focus_features/9/9-clip_480p.mov”的此文件,它将起作用。

答案 1 :(得分:1)

我遇到了同样的问题。事实证明,Python的SimpleHTTPServer无法流出视频,并且是一个糟糕的(极简主义)示例。我选择了http-server,它完美无缺。这是我使用的语法(在我的Mac上):

$ npm install http-server -g
$ http-server ./ -p 9001 -a 192.168.16.105

其中:

./是Web服务器根目录的路径

-p 9001是您要使用的端口

-a 192.168.16.105是您要通过

提供的IP地址

您可以通过打开网络浏览器并执行以下操作来检查它是否正常工作:

http://192.168.16.105:9001/myvideo.mp4

(只需确保您要播放该文件夹中的视频文件)