Skip to content

Commit

Permalink
Release 2.4.7
Browse files Browse the repository at this point in the history
- 实时直播时, 将会隐藏进度时间相关的 item, 增加了一个实时直播的 `文本 item`.
- 完善 Adapter, 减少容器中的视图层次
  • Loading branch information
changsanjiang committed Mar 14, 2019
1 parent 067e90a commit 002bd0c
Show file tree
Hide file tree
Showing 31 changed files with 779 additions and 702 deletions.
4 changes: 2 additions & 2 deletions 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.4.6'
s.version = '2.4.7'
s.summary = 'video player.'
s.description = 'https://github.com/changsanjiang/SJVideoPlayer/blob/master/README.md'
s.homepage = 'https://github.com/changsanjiang/SJVideoPlayer'
Expand All @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/changsanjiang/SJVideoPlayer.git', :tag => "v#{s.version}" }
s.requires_arc = true
s.dependency 'Masonry'
s.dependency 'SJBaseVideoPlayer', '>= 2.2.1'
s.dependency 'SJBaseVideoPlayer', '>= 2.2.2'
s.dependency 'SJAttributesFactory'

s.source_files = 'SJVideoPlayer/*.{h,m}'
Expand Down
30 changes: 0 additions & 30 deletions SJVideoPlayer/Adapters/Core/SJButtonItemCollectionViewCell.h

This file was deleted.

118 changes: 0 additions & 118 deletions SJVideoPlayer/Adapters/Core/SJButtonItemCollectionViewCell.m

This file was deleted.

5 changes: 4 additions & 1 deletion SJVideoPlayer/Adapters/Core/SJEdgeControlButtonItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ UIKIT_STATIC_INLINE SJEdgeInsets SJEdgeInsetsMake(CGFloat front, CGFloat rear) {
return (SJEdgeInsets){front, rear};
}

UIKIT_EXTERN NSNotificationName const SJEdgeControlButtonItemPerformedActionNotification;

NS_ASSUME_NONNULL_BEGIN
@interface SJEdgeControlButtonItem : NSObject
/// 49 * 49
Expand All @@ -45,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) SJEdgeControlButtonItemTag tag;
@property (nonatomic, strong, nullable) __kindof UIView *customView;
@property (nonatomic, strong, nullable) NSAttributedString *title;
@property (nonatomic) NSInteger numberOfLines;
@property (nonatomic) NSInteger numberOfLines; // default is 1.0
@property (nonatomic, strong, nullable) UIImage *image;
@property (nonatomic, getter=isHidden) BOOL hidden;
@property (nonatomic, weak, nullable) id target;
Expand All @@ -56,6 +58,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak, nullable) id<SJEdgeControlButtonItemDelegate> delegate;

- (void)addTarget:(id)target action:(nonnull SEL)action;
- (void)performAction;
@end

@protocol SJEdgeControlButtonItemDelegate <NSObject>
Expand Down
14 changes: 14 additions & 0 deletions SJVideoPlayer/Adapters/Core/SJEdgeControlButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#import <objc/message.h>

NS_ASSUME_NONNULL_BEGIN
NSNotificationName const SJEdgeControlButtonItemPerformedActionNotification = @"SJEdgeControlButtonItemPerformedActionNotification";

@implementation SJEdgeControlButtonItem {
SJButtonItemPlaceholderType _placeholderType;
CGFloat _size;
Expand Down Expand Up @@ -48,13 +50,25 @@ - (instancetype)initWithTag:(NSInteger)tag {
self = [super init];
if ( !self ) return nil;
_tag = tag;
_numberOfLines = 1;
return self;
}

- (void)addTarget:(id)target action:(nonnull SEL)action {
_target = target;
_action = action;
}

- (void)performAction {
if ( !_action ) return;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
if ( [_target respondsToSelector:_action] ) {
[_target performSelector:_action withObject:self];
[NSNotificationCenter.defaultCenter postNotificationName:SJEdgeControlButtonItemPerformedActionNotification object:self];
}
#pragma clang diagnostic pop
}
@end


Expand Down
22 changes: 22 additions & 0 deletions SJVideoPlayer/Adapters/Core/SJEdgeControlButtonItemCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SJEdgeControlButtonItemCell.h
// SJVideoPlayer
//
// Created by BlueDancer on 2018/10/20.
// Copyright © 2018 畅三江. All rights reserved.
//

#import <UIKit/UIKit.h>
@class SJEdgeControlButtonItem;

NS_ASSUME_NONNULL_BEGIN
@interface SJEdgeControlButtonItemCell : UICollectionViewCell
+ (NSString *)reuseIdentifier;
+ (void)registerWithCollectionView:(UICollectionView *)collectionView;
+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView
forIndexPath:(NSIndexPath *)indexPath
willSetItem:(SJEdgeControlButtonItem *)item;
@property (nonatomic, strong, nullable) SJEdgeControlButtonItem *item;
- (void)setItem:(SJEdgeControlButtonItem * _Nullable)item NS_REQUIRES_SUPER;
@end
NS_ASSUME_NONNULL_END
Loading

0 comments on commit 002bd0c

Please sign in to comment.