Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzy-volc committed May 24, 2022
2 parents 6caa506 + 632f3ed commit 9ef5618
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 84 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion VOLCDemo/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source 'https://github.com/volcengine/volcengine-specs.git'
platform :ios, '9.0'

target 'VOLCDemo' do
pod 'TTSDK', '1.27.2.1-premium', :subspecs => ['Player']
pod 'TTSDK', '1.28.1.1-premium', :subspecs => ['Player']
pod 'Masonry'
pod 'SDWebImage'
pod 'MBProgressHUD', '~> 1.2.0'
Expand Down
4 changes: 2 additions & 2 deletions VOLCDemo/VOLCDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
"$(PROJECT_DIR)/VOLCDemo/Utils/OneKit/StartUp",
"$(PROJECT_DIR)/VOLCDemo/Utils/OneKit/BaseKit",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.bytedance.volc.voddemo;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -759,7 +759,7 @@
"$(PROJECT_DIR)/VOLCDemo/Utils/OneKit/StartUp",
"$(PROJECT_DIR)/VOLCDemo/Utils/OneKit/BaseKit",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.bytedance.volc.voddemo;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
32 changes: 15 additions & 17 deletions VOLCDemo/VOLCDemo/Base/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,47 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.rootViewController = mainController;
[self.window makeKeyAndVisible];

/// global config
/// Deme全局设置,业务不要设置
[VEUserGlobalConfiguration sharedInstance];

/// init ttsdk
/// 初始化SDK
[self initTTSDKWithOptions:launchOptions];

return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
/// Don’t forget, this code must be added !!!
[TTVideoEngine stopOpenGLESActivity];
/// TTSDK 1.28.1 以下版本需要设置,否则会出现有声音没画面问题
// [TTVideoEngine stopOpenGLESActivity];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
/// Don’t forget, this code must be added !!!
[TTVideoEngine startOpenGLESActivity];
/// TTSDK 1.28.1 以下版本需要设置,否则会出现有声音没画面问题
// [TTVideoEngine startOpenGLESActivity];
}


#pragma mark - TTSDK init

- (void)initTTSDKWithOptions:(NSDictionary *)launchOptions {
#ifdef DEBUG
/// 建议Debug期间打开Log开关
[TTVideoEngine setLogFlag:TTVideoEngineLogFlagEngine];
/// 建议Debug期间打开,监听 license 是否加载成功,
[self addLicenseObserver];
#endif

NSString *appId = @"229234";

/// initialize ttsdk, configure Lisence ,this step cannot be skipped !!!!!
TTSDKConfiguration *configuration = [TTSDKConfiguration defaultConfigurationWithAppID:appId licenseName:@"VOLC-PlayerDemo"];

/// config vod cache size
/// 播放器CacheSize,默认100M,建议设置 300M
TTSDKVodConfiguration *vodConfig = [[TTSDKVodConfiguration alloc] init];
vodConfig.cacheMaxSize = 100 * 1024 *1024;
vodConfig.cacheMaxSize = 300 * 1024 *1024; // 300M
configuration.vodConfiguration = vodConfig;

#if DEBUG
/// add lisence observer,suggest debug open
[self addLicenseObserver];
#endif
[TTSDKManager startWithConfiguration:configuration];

#ifdef DEBUG
// print debug log,suggest debug open
[TTVideoEngine setLogFlag:TTVideoEngineLogFlagEngine];
#endif
}


Expand Down
4 changes: 3 additions & 1 deletion VOLCDemo/VOLCDemo/Base/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>VOLCDemo</string>
<string>VEVodDemo</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down Expand Up @@ -48,5 +48,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
case VESettingTypeH265:
[globalConfigs setSwitch:model.isSwitchOn forType:UserGlobalConfigH265];
break;
case VESettingTypeEngineReportLog:
[globalConfigs setSwitch:model.isSwitchOn forType:UserGlobalConfigEngineReportLog];
break;
case VESettingTypeMDLReportLog: {
[globalConfigs setSwitch:model.isSwitchOn forType:UserGlobalConfigMDLReportLog];
[TTVideoEngine ls_localServerConfigure].reportNetLogEnable = model.isSwitchOn;
}
break;
case VESettingTypeCommonStrategy:
[globalConfigs setSwitch:model.isSwitchOn forType:UserGlobalConfigCommonStrategy];
break;
case VESettingTypePreloadStrategy:
[globalConfigs setSwitch:model.isSwitchOn forType:UserGlobalConfigPreloadStrategy];
break;
Expand Down Expand Up @@ -239,11 +228,6 @@ - (UIView *)footerView {
if (!_datasource) {
VEUserGlobalConfiguration *globalConfig = [VEUserGlobalConfiguration sharedInstance];

VEGlobalConfigModel *commonStrategy = [[VEGlobalConfigModel alloc] init];
commonStrategy.title = NSLocalizedString(@"Setting_Strategy_Common", nil);
commonStrategy.isSwitchOn = globalConfig.commonStrategyEnabled;
commonStrategy.settingType = VESettingTypeCommonStrategy;

VEGlobalConfigModel *preloadStrategy = [[VEGlobalConfigModel alloc] init];
preloadStrategy.title = NSLocalizedString(@"Setting_Strategy_Preload", nil);
preloadStrategy.isSwitchOn = globalConfig.preloadStrategyEnabled;
Expand All @@ -266,35 +250,22 @@ - (UIView *)footerView {
h265Config.isSwitchOn = globalConfig.isH265Enabled;
h265Config.settingType = VESettingTypeH265;

// engine report log
VEGlobalConfigModel *engineLog = [[VEGlobalConfigModel alloc] init];
engineLog.title = NSLocalizedString(@"Setting_Engine_ReportLog", nil);
engineLog.isSwitchOn = globalConfig.isEngineReportLog;
engineLog.settingType = VESettingTypeEngineReportLog;

// mdl report log
VEGlobalConfigModel *mdlLog = [[VEGlobalConfigModel alloc] init];
mdlLog.title = NSLocalizedString(@"Setting_MDL_ReportLog", nil);
mdlLog.isSwitchOn = globalConfig.isMDLReportLog;
mdlLog.settingType = VESettingTypeMDLReportLog;

// copy device id
VEGlobalConfigModel *deviceId = [[VEGlobalConfigModel alloc] init];
deviceId.title = NSLocalizedString(@"Setting_Device_Id", nil);
deviceId.deviceId = [[BDAutoTrack sharedTrack] rangersDeviceID] ?: @"null";
deviceId.deviceId = [[BDAutoTrack trackWithAppID:@"229234"] rangersDeviceID] ?: @"null";
deviceId.settingType = VESettingTypeCopyDeviceId;


// section 1
NSArray *sectionSource = nil;
if (self.sence == VESenceType_SmallVideo) {
sectionSource = @[commonStrategy, preloadStrategy, preRenderStrategy];
sectionSource = @[preloadStrategy, preRenderStrategy];
}

// section 2
NSArray *sectionSource2 = nil;
if (self.sence == VESenceType_SmallVideo) {
sectionSource2 = @[hardDecode, h265Config, engineLog, mdlLog, deviceId];
sectionSource2 = @[hardDecode, h265Config, deviceId];
}

_datasource = @[sectionSource, sectionSource2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ - (void)configuratoinCustomView {
#pragma mark - Engine Strategy

- (void)enableVideoEngineStategy {
if ([[VEUserGlobalConfiguration sharedInstance] commonStrategyEnabled]) {
[TTVideoEngine enableEngineStrategy:TTVideoEngineStrategyTypeCommon scene:TTVEngineStrategySceneSmallVideo];
}
if ([[VEUserGlobalConfiguration sharedInstance] preloadStrategyEnabled]) {
[TTVideoEngine enableEngineStrategy:TTVideoEngineStrategyTypePreload scene:TTVEngineStrategySceneSmallVideo];
}
Expand Down
14 changes: 0 additions & 14 deletions VOLCDemo/VOLCDemo/Player/VEVideoPlayerViewController+Options.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@ + (void)setVideoEngineOptions:(TTVideoEngine *)videoEngine {

/// h265 option
[videoEngine setOptionForKey:VEKKeyPlayerh265Enabled_BOOL value:@(globalConfigs.isH265Enabled)];

/// render engine, suggest use TTVideoEngineRenderEngineMetal
[videoEngine setOptionForKey:VEKKeyViewRenderEngine_ENUM value:@(TTVideoEngineRenderEngineMetal)];

/// optimize seek time-consuming, suggest open
[videoEngine setOptionForKey:VEKKeyPlayerPreferNearestSampleEnable value:@(YES)];

[videoEngine setOptionForKey:VEKKeyProxyServerEnable_BOOL value:@(YES)];

/// Can optimize video id to play the first frame
[videoEngine setOptionForKey:VEKKeyModelCacheVideoInfoEnable_BOOL value:@(YES)];

/// report engine log
videoEngine.reportLogEnable = globalConfigs.isEngineReportLog;
}

@end
6 changes: 0 additions & 6 deletions VOLCDemo/VOLCDemo/Utils/Settings/VEUserGlobalConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,25 @@

typedef NS_ENUM(NSUInteger, UserGlobalConfigType) {
// strategy
UserGlobalConfigCommonStrategy,
UserGlobalConfigPreloadStrategy,
UserGlobalConfigPreRenderStrategy,

// common
UserGlobalConfigH265,
UserGlobalConfigHardDecode,
UserGlobalConfigEngineReportLog,
UserGlobalConfigMDLReportLog,
};

NS_ASSUME_NONNULL_BEGIN

@interface VEUserGlobalConfiguration : NSObject<NSCoding>

// strategy
@property (nonatomic, assign, readonly) BOOL commonStrategyEnabled;
@property (nonatomic, assign, readonly) BOOL preloadStrategyEnabled;
@property (nonatomic, assign, readonly) BOOL preRenderStrategyEnabled;

// common
@property (nonatomic, assign, readonly) BOOL isH265Enabled;
@property (nonatomic, assign, readonly) BOOL isHardDecodeOn;
@property (nonatomic, assign, readonly) BOOL isEngineReportLog;
@property (nonatomic, assign, readonly) BOOL isMDLReportLog;

+ (VEUserGlobalConfiguration *)sharedInstance;

Expand Down
8 changes: 0 additions & 8 deletions VOLCDemo/VOLCDemo/Utils/Settings/VEUserGlobalConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ + (VEUserGlobalConfiguration *)sharedInstance {
- (void)setSwitch:(BOOL)isOn forType:(UserGlobalConfigType)type {
//make sure here is no warnning
switch (type) {
case UserGlobalConfigCommonStrategy:
self.commonStrategyEnabled = isOn;
break;
case UserGlobalConfigPreloadStrategy:
self.preloadStrategyEnabled = isOn;
break;
Expand All @@ -69,11 +66,6 @@ - (void)setSwitch:(BOOL)isOn forType:(UserGlobalConfigType)type {
case UserGlobalConfigHardDecode:
self.isHardDecodeOn = isOn;
break;
case UserGlobalConfigEngineReportLog:
self.isEngineReportLog = isOn;
break;
case UserGlobalConfigMDLReportLog:
self.isMDLReportLog = isOn;
break;
}
}
Expand Down

0 comments on commit 9ef5618

Please sign in to comment.