1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGModernGalleryVideoView.m

45 lines
735 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import "TGModernGalleryVideoView.h"
#import <AVFoundation/AVFoundation.h>
@interface TGModernGalleryVideoView ()
{
AVPlayerLayer *_playerLayer;
}
@end
@implementation TGModernGalleryVideoView
- (instancetype)initWithFrame:(CGRect)frame player:(AVPlayer *)player
{
self = [super initWithFrame:frame];
if (self != nil)
{
self.playerLayer.player = player;
}
return self;
}
2016-02-25 01:03:51 +01:00
- (void)dealloc
{
void (^deallocBlock)(void) = self.deallocBlock;
if (deallocBlock != nil)
deallocBlock();
}
- (void)cleanupPlayer
{
self.playerLayer.player = nil;
}
2015-10-01 18:19:52 +02:00
+ (Class)layerClass
{
return [AVPlayerLayer class];
}
- (AVPlayerLayer *)playerLayer
{
return (AVPlayerLayer *)self.layer;
}
@end