Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin King committed Feb 25, 2016
1 parent eb6dbdf commit a979a07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion VIMVideoPlayer/VIMVideoPlayerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

@property (nonatomic, strong) VIMVideoPlayer *player;

- (void)resetPlayer;
- (void)setPlayer:(VIMVideoPlayer *)player;

- (void)setVideoFillMode:(NSString *)fillMode;

Expand Down
23 changes: 9 additions & 14 deletions VIMVideoPlayer/VIMVideoPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,13 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder
}

- (void)commonInit
{
[self resetPlayer];
}

#pragma mark - Public API

- (void)resetPlayer
{
VIMVideoPlayer *player = [[VIMVideoPlayer alloc] init];

[self setPlayer:player];
}

- (void)setVideoFillMode:(NSString *)fillMode
{
AVPlayerLayer *playerLayer = (AVPlayerLayer*)[self layer];
playerLayer.videoGravity = fillMode;
}

#pragma mark - Private API
#pragma mark - Public API

- (void)setPlayer:(VIMVideoPlayer *)player
{
Expand All @@ -100,6 +87,14 @@ - (void)setPlayer:(VIMVideoPlayer *)player
[self attachPlayer];
}

- (void)setVideoFillMode:(NSString *)fillMode
{
AVPlayerLayer *playerLayer = (AVPlayerLayer*)[self layer];
playerLayer.videoGravity = fillMode;
}

#pragma mark - Private API

- (void)attachPlayer
{
if (_player)
Expand Down

0 comments on commit a979a07

Please sign in to comment.