Merge pull request #1478 from lappp9/muting-video-nodes

[ASVideoNode] Ensure mute property is passed onto the internal player
This commit is contained in:
appleguy
2016-04-05 22:10:43 -07:00
2 changed files with 27 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
@interface ASVideoNode () {
ASDisplayNode *_playerNode;
AVPlayer *_player;
}
@property (atomic) ASInterfaceState interfaceState;
@property (atomic) ASDisplayNode *spinner;
@@ -37,6 +38,11 @@
_playerNode = playerNode;
}
- (void)setPlayer:(AVPlayer *)player
{
_player = player;
}
@end
@implementation ASVideoNodeTests
@@ -185,4 +191,23 @@
XCTAssertTrue(_videoNode.shouldBePlaying);
}
- (void)testMutingShouldMutePlayer
{
[_videoNode setPlayer:[[AVPlayer alloc] init]];
_videoNode.muted = YES;
XCTAssertTrue(_videoNode.player.muted);
}
- (void)testUnMutingShouldUnMutePlayer
{
[_videoNode setPlayer:[[AVPlayer alloc] init]];
_videoNode.muted = YES;
_videoNode.muted = NO;
XCTAssertFalse(_videoNode.player.muted);
}
@end