mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-12 09:19:52 +00:00
Rename lock instance variable to be consistent with ASControlNode and ASImageNode lock variable naming
This commit is contained in:
parent
06bdcd0049
commit
545b3e7e5f
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
@interface ASVideoNode ()
|
@interface ASVideoNode ()
|
||||||
{
|
{
|
||||||
ASDN::RecursiveMutex _lock;
|
ASDN::RecursiveMutex _videoLock;
|
||||||
|
|
||||||
__weak id<ASVideoNodeDelegate> _delegate;
|
__weak id<ASVideoNodeDelegate> _delegate;
|
||||||
|
|
||||||
@ -209,7 +209,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
_currentItem = [[AVPlayerItem alloc] initWithAsset:_asset];
|
_currentItem = [[AVPlayerItem alloc] initWithAsset:_asset];
|
||||||
[_currentItem addObserver:self forKeyPath:NSStringFromSelector(@selector(status)) options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:NULL];
|
[_currentItem addObserver:self forKeyPath:NSStringFromSelector(@selector(status)) options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:NULL];
|
||||||
|
|
||||||
@ -227,7 +227,7 @@
|
|||||||
[super clearFetchedData];
|
[super clearFetchedData];
|
||||||
|
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
((AVPlayerLayer *)_playerNode.layer).player = nil;
|
((AVPlayerLayer *)_playerNode.layer).player = nil;
|
||||||
_player = nil;
|
_player = nil;
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@
|
|||||||
|
|
||||||
- (void)visibilityDidChange:(BOOL)isVisible
|
- (void)visibilityDidChange:(BOOL)isVisible
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
if (_shouldAutoplay && _playerNode.isNodeLoaded) {
|
if (_shouldAutoplay && _playerNode.isNodeLoaded) {
|
||||||
[self play];
|
[self play];
|
||||||
@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
- (void)setPlayButton:(ASButtonNode *)playButton
|
- (void)setPlayButton:(ASButtonNode *)playButton
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
_playButton = playButton;
|
_playButton = playButton;
|
||||||
|
|
||||||
@ -272,14 +272,14 @@
|
|||||||
|
|
||||||
- (ASButtonNode *)playButton
|
- (ASButtonNode *)playButton
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
return _playButton;
|
return _playButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setAsset:(AVAsset *)asset
|
- (void)setAsset:(AVAsset *)asset
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
if (ASObjectIsEqual(((AVURLAsset *)asset).URL, ((AVURLAsset *)_asset).URL)) {
|
if (ASObjectIsEqual(((AVURLAsset *)asset).URL, ((AVURLAsset *)_asset).URL)) {
|
||||||
return;
|
return;
|
||||||
@ -295,19 +295,19 @@
|
|||||||
|
|
||||||
- (AVAsset *)asset
|
- (AVAsset *)asset
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _asset;
|
return _asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (AVPlayer *)player
|
- (AVPlayer *)player
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _player;
|
return _player;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setGravity:(NSString *)gravity
|
- (void)setGravity:(NSString *)gravity
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
if (_playerNode.isNodeLoaded) {
|
if (_playerNode.isNodeLoaded) {
|
||||||
((AVPlayerLayer *)_playerNode.layer).videoGravity = gravity;
|
((AVPlayerLayer *)_playerNode.layer).videoGravity = gravity;
|
||||||
}
|
}
|
||||||
@ -316,21 +316,21 @@
|
|||||||
|
|
||||||
- (NSString *)gravity
|
- (NSString *)gravity
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
return _gravity;
|
return _gravity;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)muted
|
- (BOOL)muted
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
return _muted;
|
return _muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setMuted:(BOOL)muted
|
- (void)setMuted:(BOOL)muted
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
_muted = muted;
|
_muted = muted;
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@
|
|||||||
|
|
||||||
- (void)play
|
- (void)play
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
if (!_spinner) {
|
if (!_spinner) {
|
||||||
_spinner = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
|
_spinner = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
|
||||||
@ -389,7 +389,7 @@
|
|||||||
|
|
||||||
- (void)pause
|
- (void)pause
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
[_player pause];
|
[_player pause];
|
||||||
[((UIActivityIndicatorView *)_spinner.view) stopAnimating];
|
[((UIActivityIndicatorView *)_spinner.view) stopAnimating];
|
||||||
@ -401,7 +401,7 @@
|
|||||||
|
|
||||||
- (BOOL)isPlaying
|
- (BOOL)isPlaying
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
|
|
||||||
return (_player.rate > 0 && !_player.error);
|
return (_player.rate > 0 && !_player.error);
|
||||||
}
|
}
|
||||||
@ -410,31 +410,31 @@
|
|||||||
|
|
||||||
- (ASDisplayNode *)spinner
|
- (ASDisplayNode *)spinner
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _spinner;
|
return _spinner;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (AVPlayerItem *)curentItem
|
- (AVPlayerItem *)curentItem
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _currentItem;
|
return _currentItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setCurrentItem:(AVPlayerItem *)currentItem
|
- (void)setCurrentItem:(AVPlayerItem *)currentItem
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
_currentItem = currentItem;
|
_currentItem = currentItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (ASDisplayNode *)playerNode
|
- (ASDisplayNode *)playerNode
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _playerNode;
|
return _playerNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)shouldBePlaying
|
- (BOOL)shouldBePlaying
|
||||||
{
|
{
|
||||||
ASDN::MutexLocker l(_lock);
|
ASDN::MutexLocker l(_videoLock);
|
||||||
return _shouldBePlaying;
|
return _shouldBePlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user