Skip to content

Commit

Permalink
Fix 图片有时读取不到的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Apr 19, 2018
1 parent 061e586 commit 7df1696
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion SJVideoPlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = 'SJVideoPlayer'
s.version = '2.0.6.2'
s.version = '2.0.6.3'
s.summary = 'video player.'
s.description = 'https://github.com/changsanjiang/SJVideoPlayer/blob/master/README.md'
s.homepage = 'https://github.com/changsanjiang/SJVideoPlayer'
Expand Down
2 changes: 0 additions & 2 deletions SJVideoPlayer/Resource/SJVideoPlayerResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ UIKIT_EXTERN NSString *const SJVideoPlayer_OperationFailedPrompt;

+ (UIImage *)imageNamed:(NSString *)name;

+ (NSString *)bundleComponentWithImageName:(NSString *)imageName;

+ (NSString *)localizedStringForKey:(NSString *)key;

@end
8 changes: 2 additions & 6 deletions SJVideoPlayer/Resource/SJVideoPlayerResources.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ @implementation SJVideoPlayerResources

+ (NSBundle *)bundle {
static NSBundle *bundle = nil;
if ( bundle == nil ) {
if ( nil == bundle ) {
bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"SJVideoPlayer" ofType:@"bundle"]];
}
return bundle;
}

+ (UIImage *)imageNamed:(NSString *)name {
return [UIImage imageNamed:[self bundleComponentWithImageName:name]];
}

+ (NSString *)bundleComponentWithImageName:(NSString *)imageName {
return [@"SJVideoPlayer.bundle" stringByAppendingPathComponent:imageName];
return [UIImage imageNamed:name inBundle:[self bundle] compatibleWithTraitCollection:nil];
}

+ (NSString *)localizedStringForKey:(NSString *)key {
Expand Down
2 changes: 1 addition & 1 deletion SJVideoPlayer/SJLightweightControlLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ - (void)videoPlayer:(SJVideoPlayer *)videoPlayer prepareToPlay:(SJVideoPlayerURL
self.bottomControlView.progress = 0;
self.bottomControlView.bufferProgress = 0;
[self.bottomControlView setCurrentTimeStr:videoPlayer.currentTimeStr totalTimeStr:videoPlayer.totalTimeStr];
_rightControlView.hidden = asset.isM3u8;
self.propertyRecorder = [[SJVideoPlayerPropertyRecorder alloc] initWithVideoPlayer:videoPlayer];
self.enableFilmEditing = videoPlayer.enableFilmEditing;
_rightControlView.hidden = asset.isM3u8;
}

- (BOOL)controlLayerDisappearCondition {
Expand Down
3 changes: 2 additions & 1 deletion SJVideoPlayer/SJVideoPlayerDefaultControlView.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ - (void)videoPlayer:(SJVideoPlayer *)videoPlayer prepareToPlay:(SJVideoPlayerURL
self.topControlView.model.isPlayOnScrollView = videoPlayer.isPlayOnScrollView;
self.topControlView.model.fullscreen = videoPlayer.isFullScreen;
[self.topControlView update];
_rightControlView.hidden = asset.isM3u8;


self.bottomSlider.value = 0;
self.bottomControlView.progress = 0;
Expand All @@ -164,6 +164,7 @@ - (void)videoPlayer:(SJVideoPlayer *)videoPlayer prepareToPlay:(SJVideoPlayerURL
[self _promptWithNetworkStatus:videoPlayer.networkStatus];
self.propertyRecorder = [[SJVideoPlayerPropertyRecorder alloc] initWithVideoPlayer:videoPlayer];
self.enableFilmEditing = videoPlayer.enableFilmEditing;
_rightControlView.hidden = asset.isM3u8;
}

#pragma mark - Control layer appear / disappear
Expand Down
Binary file modified SJVideoPlayerProject/.DS_Store
Binary file not shown.
Binary file not shown.

0 comments on commit 7df1696

Please sign in to comment.