Skip to content

Commit

Permalink
iOS 更新8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
abyyxwang committed Mar 18, 2021
1 parent e445306 commit 3d15c55
Show file tree
Hide file tree
Showing 178 changed files with 9,066 additions and 217 deletions.
4 changes: 2 additions & 2 deletions Demo/ReplaykitUpload/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>8.4.672</string>
<string>8.5.670</string>
<key>CFBundleVersion</key>
<string>672</string>
<string>670</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions Demo/ReplaykitUpload/TRTCInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>8.4.672</string>
<string>8.5.670</string>
<key>CFBundleVersion</key>
<string>672</string>
<string>670</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
514 changes: 433 additions & 81 deletions Demo/TXLiteAVDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Demo/TXLiteAVDemo/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>8.4.672</string>
<string>8.5.670</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>672</string>
<string>670</string>
<key>IMSDKCrashReporterEnable</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 2 additions & 0 deletions Demo/TXLiteAVDemo/App/Main/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,11 @@ - (void)initCellInfos
controllerClassName:@"PlayViewController"];
[subCells addObject:scellInfo];
#endif
#ifndef SMART
scellInfo = [CellInfo cellInfoWithTitle:@"连麦演示(新方案)"
controllerClassName:@"V2MainViewController"];
[subCells addObject:scellInfo];
#endif

scellInfo = [CellInfo cellInfoWithTitle:@"连麦演示(旧方案)"
controllerClassName:@"LiveRoomListViewController"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
4 changes: 2 additions & 2 deletions Demo/TXLiteAVDemo/App/TRTC-Appstore-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>8.4.672</string>
<string>8.5.670</string>
<key>CFBundleSignature</key>
<string>BNDL</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>672</string>
<string>670</string>
<key>IMSDKCrashReporterEnable</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
5 changes: 5 additions & 0 deletions Demo/TXLiteAVDemo/App/TXLiteAVDemo-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
#import "TCAnchorViewController.h"
#import "TCAudienceViewController.h"
#import "TRTCMeeting.h"
// VocieRoom
#import "TRTCVoiceRoomDef.h"
#import "TRTCVoiceRoom.h"
// ChatSalon
#import "TRTCChatSalon.h"
#import "TRTCChatSalonDef.h"

#import "TRTCLiveRoom.h"
#import "TRTCCalling.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
40E25FB6248029F8005EB543 /* ASNSLayoutConstraint+MASDebugAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E25F9D248029F8005EB543 /* ASNSLayoutConstraint+MASDebugAdditions.m */; };
40E25FB924803F68005EB543 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 401A9A47247FB78F00C0763B /* libc++.tbd */; };
40E25FBE24804490005EB543 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
F8AEE9CB13995851D47C3C9E /* TXLiteAVSDK_Professional.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C82D50F8BE5417AD502422B /* TXLiteAVSDK_Professional.framework */; };
FBADCDA2B8C83A504A84A058 /* TXLiteAVSDK_Professional.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD423571D49C3A35675C70E8 /* TXLiteAVSDK_Professional.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -130,7 +130,7 @@
40E25F9B248029F8005EB543 /* ASMASLayoutConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASMASLayoutConstraint.h; sourceTree = "<group>"; };
40E25F9C248029F8005EB543 /* ASViewController+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASViewController+MASAdditions.h"; sourceTree = "<group>"; };
40E25F9D248029F8005EB543 /* ASNSLayoutConstraint+MASDebugAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASNSLayoutConstraint+MASDebugAdditions.m"; sourceTree = "<group>"; };
6C82D50F8BE5417AD502422B /* TXLiteAVSDK_Professional.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TXLiteAVSDK_Professional.framework; path = ../../../SDK/TXLiteAVSDK_Professional.framework; sourceTree = "<group>"; };
BD423571D49C3A35675C70E8 /* TXLiteAVSDK_Professional.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TXLiteAVSDK_Professional.framework; path = ../../../SDK/TXLiteAVSDK_Professional.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -142,7 +142,7 @@
40E25FBE24804490005EB543 /* BuildFile in Frameworks */,
40E25FB924803F68005EB543 /* libc++.tbd in Frameworks */,
40D08707249C9D460055F9A6 /* AssetsLibrary.framework in Frameworks */,
F8AEE9CB13995851D47C3C9E /* TXLiteAVSDK_Professional.framework in Frameworks */,
FBADCDA2B8C83A504A84A058 /* TXLiteAVSDK_Professional.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -199,7 +199,7 @@
40D08706249C9D460055F9A6 /* AssetsLibrary.framework */,
40D08703249C9C130055F9A6 /* Accelerate.framework */,
401A9A47247FB78F00C0763B /* libc++.tbd */,
6C82D50F8BE5417AD502422B /* TXLiteAVSDK_Professional.framework */,
BD423571D49C3A35675C70E8 /* TXLiteAVSDK_Professional.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
79 changes: 58 additions & 21 deletions Demo/TXLiteAVDemo/LiveLinkMicDemoNew/V2PlayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "V2PlayerSettingViewController.h"
#import "V2LiveUtils.h"
#import "MBProgressHUD.h"
#import "PhotoUtil.h"


#define V2LogSimple() \
Expand Down Expand Up @@ -212,6 +213,7 @@ - (V2TXLiveCode)startPlayInner:(BOOL)start {
self.hasRecvFirstFrame = NO;
result = [self.player startPlay:self.url];
if (result == V2TXLIVE_OK) {
[self showLoading:@"加载中..." withDetailText:@"请等待"];
// [self.settingContainer clearSettingVC];
/// 开始播放后,超过5秒未收到首帧视频,则提示播放失败,并退出播放。
if (self.delayBlock) {
Expand All @@ -223,6 +225,7 @@ - (V2TXLiveCode)startPlayInner:(BOOL)start {
if (!weakSelf.hasRecvFirstFrame) {
[weakSelf showText:@"获取视频帧超时" withDetailText:nil];
[weakSelf startPlayInner:NO];
[weakSelf hiddeLoading];
}
});
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(6 * NSEC_PER_SEC)), dispatch_get_main_queue(), self.delayBlock);
Expand Down Expand Up @@ -426,12 +429,36 @@ - (void)hiddeLoading {
}

#pragma mark - V2TXLivePlayerObserver
- (void)onRecvFirstAudioFrame:(id<V2TXLivePlayer>)player {
self.hasRecvFirstFrame = YES;
- (void)onAudioPlayStatusUpdate:(id<V2TXLivePlayer>)player status:(V2TXLivePlayStatus)status reason:(V2TXLiveStatusChangeReason)reason extraInfo:(NSDictionary *)extraInfo {
switch (status) {
case V2TXLivePlayStatusPlaying:
self.hasRecvFirstFrame = YES;
[self hiddeLoading];
V2LogSimple()
break;
case V2TXLivePlayStatusLoading:
[self showLoading:@"加载中..." withDetailText:@"请等待"];
V2LogSimple()
break;
default:
break;
}
}

- (void)onRecvFirstVideoFrame:(id<V2TXLivePlayer>)player {
self.hasRecvFirstFrame = YES;
- (void)onVideoPlayStatusUpdate:(id<V2TXLivePlayer>)player status:(V2TXLivePlayStatus)status reason:(V2TXLiveStatusChangeReason)reason extraInfo:(NSDictionary *)extraInfo {
switch (status) {
case V2TXLivePlayStatusPlaying:
self.hasRecvFirstFrame = YES;
[self hiddeLoading];
V2LogSimple()
break;
case V2TXLivePlayStatusLoading:
[self showLoading:@"加载中..." withDetailText:@"请等待"];
V2LogSimple()
break;
default:
break;
}
}

- (void)onPlayoutVolumeUpdate:(id<V2TXLivePlayer>)player
Expand All @@ -458,25 +485,20 @@ - (void)onWarning:(id<V2TXLivePlayer>)player code:(V2TXLiveCode)code message:(NS
V2Log(@"code:%ld msg:%@ extraInfo:%@", (long)code, msg, extraInfo);
}

- (void)onPlayBegin:(id<V2TXLivePlayer>)player {
[self hiddeLoading];
V2LogSimple()
- (void)onSnapshotComplete:(id<V2TXLivePlayer>)player image:(TXImage *)image {
if (!image) {
[self showText:@"获取截图失败"];
} else {
[PhotoUtil saveDataToAlbum:UIImagePNGRepresentation(image) completion:^(BOOL success, NSError * _Nullable error) {
if (success) {
[self showText:@"截图已保存到相册"];
} else {
[self showText:@"截图保存失败"];
}
}];
}
}

- (void)onLoading:(id<V2TXLivePlayer>)player {
[self showLoading:@"加载中..." withDetailText:@"请等待"];
V2LogSimple()
}

- (void)onConnectionBroken:(id<V2TXLivePlayer>)player
reason:(NSInteger)reason {
V2Log(@"reason:%ld", (long)reason);
dispatch_async(dispatch_get_main_queue(), ^{
[self showText:@"连接断开" withDetailText:nil];
[self startPlayInner:NO];
[self hiddeLoading];
});
}

#pragma mark - UIGestureRecognizerDelegate

Expand All @@ -487,4 +509,19 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
return YES;
}

#pragma mark - Util

- (void)showText:(NSString *)text {
dispatch_async(dispatch_get_main_queue(), ^{
MBProgressHUD *hud = [MBProgressHUD HUDForView:[UIApplication sharedApplication].delegate.window];
if (hud == nil) {
hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].delegate.window animated:NO];
}
hud.mode = MBProgressHUDModeText;
hud.label.text = text;
[hud showAnimated:YES];
[hud hideAnimated:YES afterDelay:1];
});
}

@end
34 changes: 32 additions & 2 deletions Demo/TXLiteAVDemo/LiveLinkMicDemoNew/V2PusherViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "V2LiveUtils.h"
#import "V2QRGenerateViewController.h"
#import "MBProgressHUD.h"
#import "PhotoUtil.h"

#define V2LogSimple() \
NSLog(@"[%@ %p %s %d]", NSStringFromClass(self.class), self, __func__, __LINE__);
Expand Down Expand Up @@ -368,13 +369,27 @@ - (void)onStatisticsUpdate:(V2TXLivePusherStatistics *)statistics {
// V2Log(@"statistics:%@", statistics)
}

- (void)onConnectionStateUpdate:(V2TXLiveConnectionState)state message:(NSString *)msg extraInfo:(NSDictionary *)extraInfo {
if (state == V2TXLiveConnectionStateDisconnected && self.settingContainer.isStart) {
- (void)onPushStatusUpdate:(V2TXLivePushStatus)state message:(NSString *)msg extraInfo:(NSDictionary *)extraInfo {
if (state == V2TXLivePushStatusDisconnected && self.settingContainer.isStart) {
[self showText:@"连接已断开" withDetailText:nil];
[self stopPush];
}
}

-(void)onSnapshotComplete:(TXImage *)image {
if (!image) {
[self showText:@"获取截图失败"];
} else {
[PhotoUtil saveDataToAlbum:UIImagePNGRepresentation(image) completion:^(BOOL success, NSError * _Nullable error) {
if (success) {
[self showText:@"截图已保存到相册"];
} else {
[self showText:@"截图保存失败"];
}
}];
}
}

#pragma mark - UIGestureRecognizerDelegate

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
Expand All @@ -384,5 +399,20 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
return YES;
}

#pragma mark - Util

- (void)showText:(NSString *)text {
dispatch_async(dispatch_get_main_queue(), ^{
MBProgressHUD *hud = [MBProgressHUD HUDForView:[UIApplication sharedApplication].delegate.window];
if (hud == nil) {
hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].delegate.window animated:NO];
}
hud.mode = MBProgressHUDModeText;
hud.label.text = text;
[hud showAnimated:YES];
[hud hideAnimated:YES afterDelay:1];
});
}

@end

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "V2TXLiveDef.h"
#import "MBProgressHUD.h"

@interface V2PlayerSettingViewController () <V2SettingBottomBarDelegate, V2TXLiveSnapshotObserver>
@interface V2PlayerSettingViewController () <V2SettingBottomBarDelegate>
@property (nonatomic, weak) UIViewController *hostVC;

@property (nonatomic, strong) V2SettingBottomBar *settingBar;
Expand Down Expand Up @@ -213,7 +213,7 @@ - (void)onClickFeatureSettingsButton {
}
}],
[[V2SettingsButtonItem alloc] initWithTitle:@"视频截图" buttonTitle:@"截图" action:^{
[wSelf.player snapshot:wSelf];
[wSelf.player snapshot];
}],
].mutableCopy;
}
Expand All @@ -228,29 +228,6 @@ - (void)onClickStartSettingsButton {
}
}

#pragma mark - snapshot

- (void)onSnapshotComplete:(TXImage *)image {
if ([NSThread isMainThread]) {
[self handleSnapshot:image];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self handleSnapshot:image];
});
}
}

- (void)handleSnapshot:(TXImage *)image {
if (image == nil) {
[self showText:@"获取截图失败"];
return;
}
UIActivityViewController *vc = [[UIActivityViewController alloc]
initWithActivityItems:@[image]
applicationActivities:nil];
[self.settingsVC presentViewController:vc animated:YES completion:nil];
}

#pragma mark - Settings ViewController Embeding

- (void)toggleEmbedVC:(UIViewController *)vc {
Expand Down
Loading

0 comments on commit 3d15c55

Please sign in to comment.