Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd8b5b9dc6 | |||
| 5775bbc2af | |||
| 0a9707d68f | |||
| c1c2f93793 | |||
| 3454df7198 | |||
| 5545e1bc43 | |||
| 367b516abd |
@@ -9,7 +9,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = "VIMVideoPlayer"
|
||||
s.version = "5.5"
|
||||
s.version = "5.5.3"
|
||||
s.summary = "A simple wrapper around the AVPlayer and AVPlayerLayer classes."
|
||||
s.description = <<-DESC
|
||||
VIMVideoPlayer is a simple wrapper around the AVPlayer and AVPlayerLayer classes. Check out the README for details. And the Pegasus project for a demo.
|
||||
|
||||
@@ -702,14 +702,29 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
}
|
||||
case AVPlayerItemStatusFailed:
|
||||
{
|
||||
NSLog(@"Video player Status Failed: error = %@", self.player.currentItem.error);
|
||||
NSLog(@"Video player Status Failed: player item error = %@", self.player.currentItem.error);
|
||||
NSLog(@"Video player Status Failed: player error = %@", self.player.error);
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(videoPlayer:didFailWithError:)])
|
||||
{
|
||||
[self reset];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate videoPlayer:self didFailWithError:self.player.currentItem.error];
|
||||
|
||||
if (self.player.error)
|
||||
{
|
||||
[self.delegate videoPlayer:self didFailWithError:self.player.error];
|
||||
}
|
||||
else if (self.player.currentItem.error)
|
||||
{
|
||||
[self.delegate videoPlayer:self didFailWithError:self.player.currentItem.error];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSError *error = [NSError errorWithDomain:kVideoPlayerErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"unknown player error, status == AVPlayerItemStatusFailed"}];
|
||||
[self.delegate videoPlayer:self didFailWithError:error];
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,21 +40,39 @@
|
||||
[self detachPlayer];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super init];
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_player = [[VIMVideoPlayer alloc] init];
|
||||
_player.muted = YES;
|
||||
_player.looping = YES;
|
||||
|
||||
[self attachPlayer];
|
||||
[self commonInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
self = [super initWithCoder:aDecoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
[self commonInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)commonInit
|
||||
{
|
||||
_player = [[VIMVideoPlayer alloc] init];
|
||||
_player.muted = YES;
|
||||
_player.looping = YES;
|
||||
|
||||
[self attachPlayer];
|
||||
}
|
||||
|
||||
#pragma mark - Public API
|
||||
|
||||
- (void)setPlayer:(VIMVideoPlayer *)player
|
||||
|
||||
Reference in New Issue
Block a user