Skip to content

Commit

Permalink
iOS 更新8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
abyyxwang committed May 24, 2021
1 parent e24db23 commit 0ff967f
Show file tree
Hide file tree
Showing 96 changed files with 5,688 additions and 1,040 deletions.
2 changes: 1 addition & 1 deletion iOS/Demo/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ SPEC CHECKSUMS:
Toast-Swift: 9b6a70f28b3bf0b96c40d46c0c4b9d6639846711
TXIMSDK_iOS: 587e25fa8b42c9f228bb9065084270fa6990190f

PODFILE CHECKSUM: 0b906c44c4bdbbd9e56cc31a85da3944c818ae5c
PODFILE CHECKSUM: e558a7638e67ff2cb5707e9b7d96270e21eada35

COCOAPODS: 1.9.3
4 changes: 2 additions & 2 deletions iOS/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.5.670</string>
<string>8.7.1003</string>
<key>CFBundleVersion</key>
<string>670</string>
<string>1003</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
ReplayKitLocalized.strings
TXLiteAVDemo

Created by adams on 2021/3/22.
Copyright © 2021 Tencent. All rights reserved.
*/
29 changes: 29 additions & 0 deletions iOS/Demo/ReplaykitUpload/Localized/ReplayKitLocalized.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// ReplayKitLocalized.h
// TXLiteAVDemo
//
// Created by adams on 2021/3/22.
// Copyright © 2021 Tencent. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
#pragma mark - Base

extern NSString *ReplayKitLocalizeFromTable(NSString *key, NSString *table);
extern NSString *ReplayKitLocalizeFromTableAndCommon(NSString *key, NSString *common, NSString *table);

#pragma mark - Replace String
extern NSString *ReplayKitLocalizeReplaceXX(NSString *origin, NSString *xxx_replace);
extern NSString *ReplayKitLocalizeReplace(NSString *origin, NSString *xxx_replace, NSString *yyy_replace);
extern NSString *ReplayKitLocalizeReplaceThreeCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace);
extern NSString *ReplayKitLocalizeReplaceFourCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace, NSString *mmm_replace);
extern NSString *ReplayKitLocalizeReplaceFiveCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace, NSString *mmm_replace, NSString *nnn_replace);

#pragma mark - ReplayKit
extern NSString *const ReplayKit_Localize_TableName;
extern NSString *ReplayKitLocalize(NSString *key);


NS_ASSUME_NONNULL_END
51 changes: 51 additions & 0 deletions iOS/Demo/ReplaykitUpload/Localized/ReplayKitLocalized.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// ReplayKitLocalized.m
// TXLiteAVDemo
//
// Created by adams on 2021/3/22.
// Copyright © 2021 Tencent. All rights reserved.
//

#import "ReplayKitLocalized.h"

#pragma mark - Base
NSString *ReplayKitLocalizeFromTable(NSString *key, NSString *table) {
return [NSBundle.mainBundle localizedStringForKey:key value:@"" table:table];
}

NSString *ReplayKitLocalizeFromTableAndCommon(NSString *key, NSString *common, NSString *table) {
return ReplayKitLocalizeFromTable(key, table);
}

#pragma mark - Replace String
NSString *ReplayKitLocalizeReplaceXX(NSString *origin, NSString *xxx_replace) {
return [origin stringByReplacingOccurrencesOfString:@"xxx" withString:xxx_replace];
}

NSString *ReplayKitLocalizeReplace(NSString *origin, NSString *xxx_replace, NSString *yyy_replace) {
return [[origin stringByReplacingOccurrencesOfString:@"xxx" withString:xxx_replace] stringByReplacingOccurrencesOfString:@"yyy" withString:yyy_replace];
}

NSString *ReplayKitLocalizeReplaceThreeCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace) {
return [[[origin stringByReplacingOccurrencesOfString:@"xxx" withString:xxx_replace] stringByReplacingOccurrencesOfString:@"yyy" withString:yyy_replace]
stringByReplacingOccurrencesOfString:@"zzz" withString:zzz_replace];
}

NSString *ReplayKitLocalizeReplaceFourCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace, NSString *mmm_replace) {
return [[[[origin stringByReplacingOccurrencesOfString:@"xxx" withString:xxx_replace] stringByReplacingOccurrencesOfString:@"yyy" withString:yyy_replace]
stringByReplacingOccurrencesOfString:@"zzz" withString:zzz_replace]
stringByReplacingOccurrencesOfString:@"mmm" withString:mmm_replace];
}

NSString *ReplayKitLocalizeReplaceFiveCharacter(NSString *origin, NSString *xxx_replace, NSString *yyy_replace, NSString *zzz_replace, NSString *mmm_replace, NSString *nnn_replace) {
return [[[[[origin stringByReplacingOccurrencesOfString:@"xxx" withString:xxx_replace] stringByReplacingOccurrencesOfString:@"yyy" withString:yyy_replace]
stringByReplacingOccurrencesOfString:@"zzz" withString:zzz_replace]
stringByReplacingOccurrencesOfString:@"mmm" withString:mmm_replace]
stringByReplacingOccurrencesOfString:@"nnn" withString:nnn_replace];
}

#pragma mark - ReplayKit
NSString *const ReplayKit_Localize_TableName = @"ReplayKitLocalized";
NSString *ReplayKitLocalize(NSString *key) {
return ReplayKitLocalizeFromTable(key, ReplayKit_Localize_TableName);
}
9 changes: 9 additions & 0 deletions iOS/Demo/ReplaykitUpload/Localized/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
InfoPlist.strings
TXLiteAVDemo

Created by adams on 2021/3/24.
Copyright © 2021 Tencent. All rights reserved.
*/

CFBundleDisplayName = "TRTC";
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
ReplayKitLocalized.strings
TXLiteAVDemo

Created by adams on 2021/3/22.
Copyright © 2021 Tencent. All rights reserved.
*/

"ReplayKitUpload.SampleHandler.tencentcloudpushstream" = "Stream Screen Recording";
"ReplayKitUpload.SampleHandler.pushstreamstop" = "Push stopped";
"ReplayKitUpload.SampleHandler.exchangeerror" = "Switch failed";
"ReplayKitUpload.SampleHandler.replaystart" = "Screen recording has started. Return to Cloud Video Toolkit -> MLVB -> Push (Screen Recording) to set the push URL, page orientation, and definition. ";
"ReplayKitUpload.SampleHandler.replaystop" = "Screen recording paused";
"ReplayKitUpload.SampleHandler.replayrestored" = "Screen recording resumed";
"ReplayKitUpload.SampleHandler.replayend" = "Screen recording ended";
"ReplayKitUpload.SampleHandler.replayfailed" = "Push failed. Please try again.";
"ReplayKitUpload.SampleHandler.connectsuccess" = "Connected. Start pushing.";
"ReplayKitUpload.SampleHandler.networkuplink" = "Insufficient upstream bandwidth";
"ReplayKitUpload.SampleHandler.screenshareend" = "Screen sharing ended";
"ReplayKitUpload.SampleHandler.applicationtodisconnect" = "Disconnected";
"ReplayKitUpload.SampleHandler.integrationerror" = "Integration error (inconsistent SDK version)";
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
InfoPlist.strings
TXLiteAVDemo

Created by adams on 2021/3/24.
Copyright © 2021 Tencent. All rights reserved.
*/

CFBundleDisplayName = "TRTC多人会议录屏";
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
ReplayKitLocalized.strings
TXLiteAVDemo

Created by adams on 2021/3/22.
Copyright © 2021 Tencent. All rights reserved.
*/

"ReplayKitUpload.SampleHandler.tencentcloudpushstream" = "腾讯云录屏推流";
"ReplayKitUpload.SampleHandler.pushstreamstop" = "推流已停止";
"ReplayKitUpload.SampleHandler.exchangeerror" = "切换失败";
"ReplayKitUpload.SampleHandler.replaystart" = "录屏已开始,请从这里点击回到Demo->直播->录屏推流->设置推流URL与横竖屏和清晰度";
"ReplayKitUpload.SampleHandler.replaystop" = "录屏已暂停";
"ReplayKitUpload.SampleHandler.replayrestored" = "录屏已恢复";
"ReplayKitUpload.SampleHandler.replayend" = "录屏已结束";
"ReplayKitUpload.SampleHandler.replayfailed" = "推流失败!请换个姿势再来一次";
"ReplayKitUpload.SampleHandler.connectsuccess" = "连接成功!开始推流";
"ReplayKitUpload.SampleHandler.networkuplink" = "网络上行带宽不足";
"ReplayKitUpload.SampleHandler.screenshareend" = "屏幕共享已结束";
"ReplayKitUpload.SampleHandler.applicationtodisconnect" = "应用断开";
"ReplayKitUpload.SampleHandler.integrationerror" = "集成错误(SDK 版本号不相符合)";
25 changes: 13 additions & 12 deletions iOS/Demo/ReplaykitUpload/SampleHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#import <UserNotifications/UserNotifications.h>
#import <ReplayKit/ReplayKit.h>
#import "SimpleIPC.h"
#import "ReplayKitLocalized.h"

#if TRTC_EXT
#import <TXLiteAVSDK_ReplayKitExt/TXLiteAVSDK_ReplayKitExt.h>
Expand Down Expand Up @@ -204,14 +205,14 @@ - (void)handleReplayKit2PushStartNotification:(NSNotification*)noti
- (void)handleReplayKit2PushStopNotification:(NSNotification*)noti
{
[self stop];
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"推流已停止" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.pushstreamstop") userInfo:nil];
}

- (void)handleReplayKit2RotateChangeNotification:(NSNotification*)noti
{
NSString *rotate = [self _getConfigForKey:kReplayKit2RotateKey fromConfig:noti.userInfo];
if (!rotate) {
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"切换失败" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.exchangeerror") userInfo:nil];
return;
}
if ([rotate isEqualToString:kReplayKit2Lanscape]) {
Expand Down Expand Up @@ -440,7 +441,7 @@ - (void)start {
}

- (void)broadcastStartedWithSetupInfo:(NSDictionary<NSString *,NSObject *> *)setupInfo {
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"录屏已开始,请从这里点击回到Demo->直播->录屏推流->设置推流URL与横竖屏和清晰度" userInfo:@{kReplayKit2UploadingKey: kReplayKit2Uploading}];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.replaystart") userInfo:@{kReplayKit2UploadingKey: kReplayKit2Uploading}];
#if TRTC_EXT
[[TXReplayKitExt sharedInstance] setupWithAppGroup:kReplayKit2AppGroupId delegate:self];
#endif
Expand All @@ -450,20 +451,20 @@ - (void)broadcastPaused {
// User has requested to pause the broadcast. Samples will stop being delivered.
NSLog(@"broadcastPaused");
[self pause];
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"录屏已暂停" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.replaystop") userInfo:nil];
}

- (void)broadcastResumed {
// User has requested to resume the broadcast. Samples delivery will resume.
NSLog(@"broadcastResumed");
[self resume];
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"录屏已恢复" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.replayrestored") userInfo:nil];
}

- (void)broadcastFinished {
// User has requested to finish the broadcast.
NSLog(@"broadcastFinished");
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"录屏已结束" userInfo:@{kReplayKit2UploadingKey: kReplayKit2Stop}];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.replayend") userInfo:@{kReplayKit2UploadingKey: kReplayKit2Stop}];
[self stop];
#if TRTC_EXT
[[TXReplayKitExt sharedInstance] finishBroadcast];
Expand Down Expand Up @@ -542,11 +543,11 @@ -(void) onPushEvent:(int)EvtID withParam:(NSDictionary*)param {
NSLog(@"onPushEvent %d", EvtID);
#if !defined(TRTC) || defined(TRTC_APPSTORE)
if (EvtID == PUSH_ERR_NET_DISCONNECT) {
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"推流失败!请换个姿势再来一次" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.replayfailed") userInfo:nil];
} else if (EvtID == PUSH_EVT_PUSH_BEGIN) {
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"连接成功!开始推流" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.connectsuccess") userInfo:nil];
} else if (EvtID == PUSH_WARNING_NET_BUSY) {
[self sendLocalNotificationToHostAppWithTitle:@"腾讯云录屏推流" msg:@"网络上行带宽不足" userInfo:nil];
[self sendLocalNotificationToHostAppWithTitle:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.tencentcloudpushstream") msg:ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.networkuplink") userInfo:nil];
}
#endif
}
Expand Down Expand Up @@ -577,13 +578,13 @@ - (void)broadcastFinished:(TXReplayKitExt *)broadcast reason:(TXReplayKitExtReas
NSString *tip = @"";
switch (reason) {
case TXReplayKitExtReasonRequestedByMain:
tip = @"屏幕共享已结束";
tip = ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.screenshareend");
break;
case TXReplayKitExtReasonDisconnected:
tip = @"应用断开";
tip = ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.applicationtodisconnect");
break;
case TXReplayKitExtReasonVersionMismatch:
tip = @"集成错误(SDK 版本号不相符合)";
tip = ReplayKitLocalize(@"ReplayKitUpload.SampleHandler.integrationerror");
break;
}

Expand Down
4 changes: 2 additions & 2 deletions iOS/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.5.670</string>
<string>8.7.1003</string>
<key>CFBundleVersion</key>
<string>670</string>
<string>1003</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
8 changes: 8 additions & 0 deletions iOS/Demo/ReplaykitUpload/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
File.strings
TXLiteAVDemo

Created by adams on 2021/3/24.
Copyright © 2021 Tencent. All rights reserved.
*/
CFBundleDisplayName = "TCToolkit";
8 changes: 8 additions & 0 deletions iOS/Demo/ReplaykitUpload/zh-Hans.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
File.strings
TXLiteAVDemo

Created by adams on 2021/3/24.
Copyright © 2021 Tencent. All rights reserved.
*/
CFBundleDisplayName = "腾讯云工具包";
Loading

0 comments on commit 0ff967f

Please sign in to comment.