Skip to content

Commit

Permalink
Release 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Jul 18, 2022
1 parent b133a9b commit c95cd90
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 276 deletions.
2 changes: 1 addition & 1 deletion SJBaseVideoPlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SJBaseVideoPlayer'
s.version = '3.7.1'
s.version = '3.7.2'
s.summary = 'video player.'
s.description = 'https://github.com/changsanjiang/SJBaseVideoPlayer/blob/master/README.md'
s.homepage = 'https://github.com/changsanjiang/SJBaseVideoPlayer'
Expand Down
19 changes: 3 additions & 16 deletions SJBaseVideoPlayer/Common/Implements/SJPlayerAutoplayConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,16 @@
NS_ASSUME_NONNULL_BEGIN
@protocol SJPlayerAutoplayDelegate;

typedef NS_ENUM(NSUInteger, SJAutoplayScrollAnimationType) {
SJAutoplayScrollAnimationTypeNone,
SJAutoplayScrollAnimationTypeTop,
SJAutoplayScrollAnimationTypeMiddle,
};

typedef NS_ENUM(NSUInteger, SJAutoplayPosition) {
SJAutoplayPositionTop,
SJAutoplayPositionMiddle,
};

@interface SJPlayerAutoplayConfig : NSObject
+ (instancetype)configWithPlayerSuperviewSelector:(nullable SEL)playerSuperviewSelector autoplayDelegate:(id<SJPlayerAutoplayDelegate>)delegate;

@property (nonatomic, nullable) SEL playerSuperviewSelector;

@property (nonatomic, weak, nullable, readonly) id<SJPlayerAutoplayDelegate> autoplayDelegate;

/// 滚动的动画类型
/// default is .Middle;
@property (nonatomic) SJAutoplayScrollAnimationType animationType;
/// default is .Middle;
@property (nonatomic) SJAutoplayPosition autoplayPosition;
/// 滑动方向默认为 垂直方向, 当 UICollectionView 水平滑动时, 记得设置此属性;
@property (nonatomic) UICollectionViewScrollDirection scrollDirection;

/// 可播区域的insets
@property (nonatomic) UIEdgeInsets playableAreaInsets;
@end
Expand Down
2 changes: 0 additions & 2 deletions SJBaseVideoPlayer/Common/Implements/SJPlayerAutoplayConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ + (instancetype)configWithPlayerSuperviewSelector:(nullable SEL)playerSuperviewS

SJPlayerAutoplayConfig *config = [[self alloc] init];
config->_autoplayDelegate = delegate;
config->_animationType = SJAutoplayScrollAnimationTypeMiddle;
config->_autoplayPosition = SJAutoplayPositionMiddle;
config->_playerSuperviewSelector = playerSuperviewSelector;
return config;
}
Expand Down
2 changes: 1 addition & 1 deletion SJBaseVideoPlayer/Common/Implements/SJRotationManager_4.m
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ - (void)setNeedsUpdateOfSupportedInterfaceOrientations {
[self.window.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
#else
[(id)UIApplication.sharedApplication.keyWindow.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
[(id)self.window setNeedsUpdateOfSupportedInterfaceOrientations];
[(id)self.window.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ - (CGRect)intersectionWithView:(UIView *)view insets:(UIEdgeInsets)insets {
if ( view == nil || view.window == nil || self.window == nil ) return CGRectZero;
CGRect rect1 = [view convertRect:view.bounds toView:self.window];
CGRect rect2 = [self convertRect:self.bounds toView:self.window];
rect1 = UIEdgeInsetsInsetRect(rect1, insets);
rect2 = UIEdgeInsetsInsetRect(rect2, insets);

CGRect intersection = CGRectIntersection(rect1, rect2);
return (CGRectIsEmpty(intersection) || CGRectIsNull(intersection)) ? CGRectZero : intersection;
}
Expand Down
2 changes: 1 addition & 1 deletion SJBaseVideoPlayer/SJBaseVideoPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ + (instancetype)player {
}

+ (NSString *)version {
return @"v3.7.1";
return @"v3.7.2";
}

- (void)setVideoGravity:(SJVideoGravity)videoGravity {
Expand Down
19 changes: 2 additions & 17 deletions SJBaseVideoPlayer/UIScrollView+ListViewAutoplaySJAdd.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, readonly) BOOL sj_enabledAutoplay;

///
/// 指定位置播放
///
- (void)sj_playAssetAtIndexPath:(NSIndexPath *)indexPath scrollAnimated:(BOOL)animated;

///
/// enable autoplay
/// 开启
Expand All @@ -33,12 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
///
/// 关闭
///
- (void)sj_disenableAutoplay;

///
/// 播放下一个(在已显示的cell中查找)
///
- (void)sj_playNextVisibleAsset;
- (void)sj_disableAutoplay;

///
/// 移除当前播放视图
Expand All @@ -49,13 +39,8 @@ NS_ASSUME_NONNULL_BEGIN

/// Developers don't need to care, this category is automatically maintained by the SJBaseVideoPlayer.
/// 开发者无需关心, 此分类由播放器自动维护
@interface UIScrollView (SJAutoplayPrivate)
@interface UIScrollView (SJAutoplayPlayerAssigns)
@property (nonatomic, strong, nullable, readonly) NSIndexPath *sj_currentPlayingIndexPath;
- (void)setSj_currentPlayingIndexPath:(nullable NSIndexPath *)sj_currentPlayingIndexPath;
@end


@interface UIScrollView (SJAutoplayDeprecated)
- (void)sj_needPlayNextAsset __deprecated_msg("use `sj_playNextVisibleAsset`");
@end
NS_ASSUME_NONNULL_END
Loading

0 comments on commit c95cd90

Please sign in to comment.