Skip to content

Commit

Permalink
v1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Feb 1, 2018
1 parent efed1ad commit d0639ee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions SJVideoPlayer/Model/SJVideoPlayerURLAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ NS_ASSUME_NONNULL_BEGIN

@end

extern NSString * const kSJVideoPlayerAssetKey;

NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions SJVideoPlayer/Model/SJVideoPlayerURLAsset.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ - (instancetype)initWithAssetURL:(NSURL *)assetURL
}

@end

NSString * const kSJVideoPlayerAssetKey = @"asset";
8 changes: 5 additions & 3 deletions SJVideoPlayer/Player/SJVideoPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,9 @@ - (void)controlView:(SJVideoPlayerControlView *)controlView clickedBtnTag:(SJVid
_sjAnima(^{
if ( !self.isLockedScrren ) self.hideControl = NO;
});
[self play];
[self jumpedToTime:0 completionHandler:^(BOOL finished) {
[self play];
}];
}
break;
case SJVideoPlayControlViewTag_Preview: {
Expand Down Expand Up @@ -1316,7 +1318,7 @@ @implementation SJVideoPlayer (Play)

- (void)setURLAsset:(SJVideoPlayerURLAsset *)URLAsset {
objc_setAssociatedObject(self, @selector(URLAsset), URLAsset, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[self setAsset:[URLAsset valueForKey:@"asset"]];
[self setAsset:[URLAsset valueForKey:kSJVideoPlayerAssetKey]];
}

- (SJVideoPlayerURLAsset *)URLAsset {
Expand All @@ -1329,7 +1331,7 @@ - (void)playWithURL:(NSURL *)playURL {

// unit: sec.
- (void)playWithURL:(NSURL *)playURL jumpedToTime:(NSTimeInterval)time {
self.asset = [[SJVideoPlayerAssetCarrier alloc] initWithAssetURL:playURL beginTime:time];
self.URLAsset = [[SJVideoPlayerURLAsset alloc] initWithAssetURL:playURL beginTime:time];
}

- (void)setAssetURL:(NSURL *)assetURL {
Expand Down
Binary file modified SJVideoPlayerProject/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ - (void)clickedPlayOnTabCell:(SJVideoListTableViewCell *)cell playerParentView:(

// set asset
_videoPlayer.URLAsset =
[[SJVideoPlayerURLAsset alloc] initWithAssetURL:[NSURL URLWithString:@"http://hjzq54sgy3st45j8hub.exp.bcevod.com/mda-hkhjsv8110uk6kby/mda-hkhjsv8110uk6kby.m3u8"]
[[SJVideoPlayerURLAsset alloc] initWithAssetURL:[NSURL URLWithString:cell.model.playURLStr]
scrollView:self.tableView
indexPath:[self.tableView indexPathForCell:cell]
superviewTag:playerParentView.tag];
Expand Down

0 comments on commit d0639ee

Please sign in to comment.