Skip to content

Commit

Permalink
iOS superPlayer 更新到 SDK 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xcoderliu committed Aug 9, 2021
1 parent b3b88c4 commit a930118
Show file tree
Hide file tree
Showing 49 changed files with 636 additions and 238 deletions.
7 changes: 6 additions & 1 deletion Demo/TXLiteAVDemo/App/AppCommon/CommonUtils/TCLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
*/

#import <Foundation/Foundation.h>
#ifndef LIVE
#import "TXLiveBase.h"

#endif
/**
* 获取RTMP SDK内部log,并保存到文件
* 1.实现ITXLiveBaseListener回调接口获取RTMPSDK的log
* 2.log保存到沙箱路径:Library/Caches/rtmpsdk_日期.log
* 其中日期以天为单位,每天保存一个文件,如rtmpsdk_20160901.log
* 3.app的log使用TXLog和RTMPSDK的log一起保存
*/
#ifdef LIVE
@interface TCLog : NSObject
#else
@interface TCLog : NSObject<TXLiveBaseDelegate>
#endif

+ (instancetype)shareInstance;

Expand Down
6 changes: 6 additions & 0 deletions Demo/TXLiteAVDemo/App/AppCommon/CommonUtils/TCUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bo

typedef void(^videoIsReadyBlock)(void);

static NSString * const kMainMenuDEBUGSwitch = @"kMainMenuDEBUGSwitch";

@interface TCUtil : NSObject

+ (NSData *)dictionary2JsonData:(NSDictionary *)dict;
Expand Down Expand Up @@ -54,6 +56,10 @@ typedef void(^videoIsReadyBlock)(void);

+ (void)dismissShareDialog;

+ (BOOL)getDEBUGSwitch;

+ (void)changeDEBUGSwitch;

@end


Expand Down
18 changes: 17 additions & 1 deletion Demo/TXLiteAVDemo/App/AppCommon/CommonUtils/TCUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
* Function: 实用函数
*/

#if !defined(UGC) && !defined(PLAYER)
#import "TXLiteAVDemo-Swift.h"
#endif

#import "TCUtil.h"
#import "NSData+Common.h"
#import "NSString+Common.h"
Expand All @@ -12,7 +16,6 @@
#import <mach/mach.h>
#import <sys/types.h>
#import <sys/sysctl.h>
#import "TXLiteAVDemo-Swift.h"
#import "AppLocalized.h"

//错误码
Expand All @@ -28,6 +31,19 @@

@implementation TCUtil

+ (BOOL)getDEBUGSwitch {
#ifdef ENTERPRISE
return [[NSUserDefaults standardUserDefaults] boolForKey:kMainMenuDEBUGSwitch];
#else
return YES;
#endif
}

+ (void)changeDEBUGSwitch {
BOOL menuSwitch = [TCUtil getDEBUGSwitch];
[[NSUserDefaults standardUserDefaults] setBool:!menuSwitch forKey:kMainMenuDEBUGSwitch];
}

+ (NSData *)dictionary2JsonData:(NSDictionary *)dict {
// 转成Json数据
if ([NSJSONSerialization isValidJSONObject:dict])
Expand Down
6 changes: 3 additions & 3 deletions Demo/TXLiteAVDemo/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>zh_CN</string>
<key>CFBundleDisplayName</key>
<string>腾讯云工具包</string>
<string>腾讯云视立方</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconName</key>
Expand All @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>8.9.1097</string>
<string>9.0.1111</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1097</string>
<string>1111</string>
<key>IMSDKCrashReporterEnable</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
27 changes: 8 additions & 19 deletions Demo/TXLiteAVDemo/App/Main/MainTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#import "MainTableViewCell.h"
#import "ColorMacro.h"


@interface CellInfo ()
@property (nonatomic, copy) NSString* controllerClassName;
@property (copy, nonatomic) UIViewController *(^controllerCreator)(void);
Expand Down Expand Up @@ -79,13 +78,6 @@ @interface MainTableViewCell () {

@implementation MainTableViewCell

- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}



- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
Expand Down Expand Up @@ -117,26 +109,23 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
- (void)layoutSubviews
{
[super layoutSubviews];
if (_cellData.subCells) {
_backgroundView.frame = CGRectMake(0, 10, self.frame.size.width, 55);
} else {
_backgroundView.frame = CGRectMake(0, 0, self.frame.size.width, 50);
}

_titleLabel.center = CGPointMake(_titleLabel.center.x, _titleLabel.superview.frame.size.height/2);
_titleLabel.frame = CGRectMake(10, _titleLabel.frame.origin.y, _titleLabel.frame.size.width, _titleLabel.frame.size.height);
_iconImageView.center = (CGPointMake(_backgroundView.frame.size.width-41, _backgroundView.frame.size.height/2));
_detailImageView.center = (CGPointMake(_backgroundView.frame.size.width-41, _backgroundView.frame.size.height/2));

if (_cellData.subCells != nil) {
if (_cellData.subCells.count > 0) {
_backgroundView.frame = CGRectMake(0, 10, self.frame.size.width, 55);
_iconImageView.hidden = NO;
_detailImageView.hidden = YES;
_titleLabel.font = [UIFont systemFontOfSize:18];
} else {
_backgroundView.frame = CGRectMake(0, 0, self.frame.size.width, 50);
_iconImageView.hidden = YES;
_detailImageView.hidden = NO;
_titleLabel.font = [UIFont systemFontOfSize:16];
}
[_titleLabel sizeToFit];
_titleLabel.center = CGPointMake(_titleLabel.center.x, _titleLabel.superview.frame.size.height/2);
_titleLabel.frame = CGRectMake(10, _titleLabel.frame.origin.y, _titleLabel.frame.size.width, _titleLabel.frame.size.height);
_iconImageView.center = (CGPointMake(_backgroundView.frame.size.width-41, _backgroundView.frame.size.height/2));
_detailImageView.center = (CGPointMake(_backgroundView.frame.size.width-41, _backgroundView.frame.size.height/2));
}

- (void)setCellData:(CellInfo*)cellInfo
Expand Down
Loading

0 comments on commit a930118

Please sign in to comment.