Skip to content

Commit

Permalink
1、Upgrade SDK to solve experience problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ianyanzhang committed Jun 2, 2023
1 parent 357ca4d commit 0b5ab08
Show file tree
Hide file tree
Showing 43 changed files with 1,126 additions and 565 deletions.
2 changes: 1 addition & 1 deletion Demo/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def common_pods_all
pod 'AFNetworking'
pod 'BlocksKit', '~> 2.2.5'
pod 'CWStatusBarNotification', '~> 2.3.5'
pod 'TXLiteAVSDK_Player', '~> 11.1.14125'
pod 'TXLiteAVSDK_Player', '~> 11.2.14217'
end

def common_pods_smart
Expand Down
2 changes: 2 additions & 0 deletions Demo/TXLiteAVDemo/App/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN

@property(strong, nonatomic) UIWindow * window;
@property(strong, nonatomic, nullable) NSData *deviceToken;
///页面支持的旋转方向
@property(nonatomic, assign)UIInterfaceOrientationMask interfaceOrientationMask;

- (void)clickHelp:(UIButton *)sender;

Expand Down
4 changes: 4 additions & 0 deletions Demo/TXLiteAVDemo/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,8 @@ - (void)openAppStore:(NSString *)appID {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/us/app/id%@?ls=1&mt=8", appID]];
[[UIApplication sharedApplication] openURL:url];
}
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return self.interfaceOrientationMask ?: UIInterfaceOrientationMaskPortrait;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import "FeedHeadModel.h"
#import "FeedVideoModel.h"

#import "SuperPlayer.h"
NS_ASSUME_NONNULL_BEGIN

@interface FeedDetailViewController : UIViewController
Expand All @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, strong) FeedVideoModel *videoModel;

@property (nonatomic, strong) UIView *superPlayView;
@property (nonatomic, strong) SuperPlayerView *superPlayView;

@property (nonatomic, strong) NSMutableArray *detailListData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
#import "FeedVideoPlayMem.h"
#import "SuperPlayer.h"
#import "AppLocalized.h"
#import <Masonry/Masonry.h>
#import "AppDelegate.h"

@interface FeedDetailViewController ()
@interface FeedDetailViewController ()<SuperPlayerDelegate,FeedDetailViewDelegate>

@property (nonatomic, strong) FeedDetailView *detailView;

Expand Down Expand Up @@ -46,18 +48,26 @@ - (void)viewWillAppear:(BOOL)animated {
gradientLayer.frame = self.view.bounds;
[self.view.layer insertSublayer:gradientLayer atIndex:0];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear: animated];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.

[self.view addSubview:self.detailView];
[self.detailView setModel:self.headModel];
[self.detailView setVideoModel:self.videoModel];
[self.detailView setSuperPlayView:(SuperPlayerView *)self.superPlayView];
[self.detailView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view.mas_left);
if (@available(iOS 11.0, *)) {
make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop);
} else {
make.top.equalTo(self.view.mas_top);
}
make.right.equalTo(self.view.mas_right);
make.bottom.equalTo(self.view.mas_bottom);
}];



dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.detailView setListData:self.detailListData];
});
}

- (void)backClick {
Expand All @@ -69,9 +79,61 @@ - (void)backClick {
- (FeedDetailView *)detailView {
if (!_detailView) {
_detailView = [FeedDetailView new];
_detailView.frame = CGRectMake(0, kNavBarAndStatusBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT - kNavBarAndStatusBarHeight);
_detailView.delegate = self;
}
return _detailView;
}

#pragma mark - setter
-(void)setDetailListData:(NSMutableArray *)detailListData {
_detailListData = detailListData;
[self.detailView setListData:detailListData];
}
-(void)setHeadModel:(FeedHeadModel *)headModel{
_headModel = headModel;
[self.detailView setModel:self.headModel];
}
-(void)setVideoModel:(FeedVideoModel *)videoModel{
_videoModel = videoModel;
[self.detailView setVideoModel:self.videoModel];
}
-(void)setSuperPlayView:(SuperPlayerView *)superPlayView {
_superPlayView = superPlayView;
[self.detailView setSuperPlayView:self.superPlayView];
self.superPlayView.delegate = self;
}

#pragma mark - SuperPlayerDelegate
- (void)screenRotation:(BOOL)fullScreen {
AppDelegate *delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
if (fullScreen) {
delegate.interfaceOrientationMask = UIInterfaceOrientationMaskLandscapeRight;
} else {
delegate.interfaceOrientationMask = UIInterfaceOrientationMaskPortrait;
}
[self movSetNeedsUpdateOfSupportedInterfaceOrientations];
}

- (void)movSetNeedsUpdateOfSupportedInterfaceOrientations {

if (@available(iOS 16.0, *)) {

dispatch_async(dispatch_get_main_queue(), ^{

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000
[self setNeedsUpdateOfSupportedInterfaceOrientations];
#else

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
SEL supportedInterfaceSelector = NSSelectorFromString(@"setNeedsUpdateOfSupportedInterfaceOrientations");
[self performSelector:supportedInterfaceSelector];
#pragma clang diagnostic pop

#endif
});

}

}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
//

#import <UIKit/UIKit.h>

#import "SuperPlayer.h"
NS_ASSUME_NONNULL_BEGIN

@interface FeedPlayViewController : UIViewController

@end

///全屏窗口
@interface FeedBaseFullScreenViewController : UIViewController
///视频窗口
@property (nonatomic, strong) SuperPlayerView *playerView;
@end
NS_ASSUME_NONNULL_END
Loading

0 comments on commit 0b5ab08

Please sign in to comment.