[ASVideoNode] Addition of reset method to return to initial state (#2119)

* [ASVideoNode] Addition of reset method to allow video node to return to initial state of placeholder and play button

* Implemented pull request review comments for code style
This commit is contained in:
gazreese
2016-11-11 00:35:43 +00:00
committed by appleguy
parent 2ba8239ff5
commit 3cdbc63e31
4 changed files with 20 additions and 0 deletions

View File

@@ -671,6 +671,19 @@ static NSString * const kRate = @"rate";
return YES;
}
- (void)resetToPlaceholder
{
ASDN::MutexLocker l(__instanceLock__);
if (_playerNode != nil) {
[_playerNode removeFromSupernode];
_playerNode = nil;
}
[_player seekToTime:kCMTimeZero];
[self pause];
}
#pragma mark - Playback observers