mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-24 03:45:58 +08:00
Merge pull request #1478 from lappp9/muting-video-nodes
[ASVideoNode] Ensure mute property is passed onto the internal player
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user