Skip to content

Commit 9e1ff28

Browse files
authored
Merge pull request #18 from githubliuqi/main
【LiveKit】4.0.1 update
2 parents fd2dce3 + 3af4114 commit 9e1ff28

141 files changed

Lines changed: 6020 additions & 1362 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

application/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ android {
2424
applicationId = "com.trtc.uikit.livekit.example"
2525
// You can update the following values to match your application needs.
2626
// For more information, see: https://flutter.dev/to/review-gradle-config.
27-
minSdkVersion = 23
27+
minSdk = 23
2828
targetSdk = flutter.targetSdkVersion
2929
versionCode = flutter.versionCode
3030
versionName = flutter.versionName

application/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>13.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

application/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 284 additions & 4 deletions
Large diffs are not rendered by default.

application/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47-
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4847
shouldUseLaunchSchemeArgsEnv = "YES">
4948
<MacroExpansion>
5049
<BuildableReference
@@ -73,13 +72,11 @@
7372
buildConfiguration = "Debug"
7473
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7574
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76-
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
7775
launchStyle = "0"
7876
useCustomWorkingDirectory = "NO"
7977
ignoresPersistentStateOnLaunch = "NO"
8078
debugDocumentVersioning = "YES"
8179
debugServiceExtension = "internal"
82-
enableGPUValidationMode = "1"
8380
allowLocationSimulation = "YES">
8481
<BuildableProductRunnable
8582
runnableDebuggingMode = "0">
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSExtension</key>
6+
<dict>
7+
<key>NSExtensionPointIdentifier</key>
8+
<string>com.apple.broadcast-services-upload</string>
9+
<key>NSExtensionPrincipalClass</key>
10+
<string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
11+
<key>RPBroadcastProcessMode</key>
12+
<string>RPBroadcastProcessModeSampleBuffer</string>
13+
</dict>
14+
</dict>
15+
</plist>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//
2+
// SampleHandler.swift
3+
// LiveKitReplayExtension
4+
//
5+
// Created by liuqi on 2026/2/27.
6+
//
7+
8+
import ReplayKit
9+
import TXLiteAVSDK_ReplayKitExt
10+
11+
private let APPGROUP = "group.com.tencent.fx.livekit"
12+
13+
14+
class SampleHandler: RPBroadcastSampleHandler, TXReplayKitExtDelegate {
15+
16+
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
17+
// User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional.
18+
TXReplayKitExt.sharedInstance().setup(withAppGroup: APPGROUP, delegate: self)
19+
}
20+
21+
override func broadcastPaused() {
22+
// User has requested to pause the broadcast. Samples will stop being delivered.
23+
}
24+
25+
override func broadcastResumed() {
26+
// User has requested to resume the broadcast. Samples delivery will resume.
27+
}
28+
29+
override func broadcastFinished() {
30+
// User has requested to finish the broadcast.
31+
TXReplayKitExt.sharedInstance().broadcastFinished()
32+
}
33+
34+
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
35+
switch sampleBufferType {
36+
case RPSampleBufferType.video:
37+
// Handle video sample buffer
38+
TXReplayKitExt.sharedInstance().send(sampleBuffer, with: sampleBufferType)
39+
break
40+
case RPSampleBufferType.audioApp:
41+
// Handle audio sample buffer for app audio
42+
break
43+
case RPSampleBufferType.audioMic:
44+
// Handle audio sample buffer for mic audio
45+
break
46+
@unknown default:
47+
// Handle other sample buffer types
48+
fatalError("Unknown type of sample buffer")
49+
}
50+
}
51+
52+
// MARK: - TXReplayKitExtDelegate
53+
func broadcastFinished(_ broadcast: TXReplayKitExt, reason: TXReplayKitExtReason) {
54+
let tip: String
55+
switch reason {
56+
case .requestedByMain:
57+
tip = "liveStop"
58+
case .disconnected:
59+
tip = "appReset"
60+
case .versionMismatch:
61+
tip = "sdkError"
62+
@unknown default:
63+
tip = ""
64+
}
65+
66+
let error = NSError(domain: NSStringFromClass(self.classForCoder), code: 0, userInfo: [NSLocalizedFailureReasonErrorKey:tip])
67+
finishBroadcastWithError(error)
68+
}
69+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (c) 2023 Tencent. All Rights Reserved.
3+
*
4+
*/
5+
// Author: *
6+
#import <TXLiteAVSDK_ReplayKitExt/TXReplayKitExt.h>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Module: TXReplayKitExt @ TXLiteAVSDK
3+
*
4+
* Function: The main interface class of Tencent Cloud ReplayKit screen recording function in Extension
5+
*
6+
* Version: <:Version:>
7+
*/
8+
9+
// Author: *
10+
11+
/// @defgroup TXReplayKitExt_ios TXReplayKitExt
12+
/// The main interface class of Tencent Cloud ReplayKit screen recording function in Extension
13+
/// @{
14+
15+
#import <CoreMedia/CoreMedia.h>
16+
#import <Foundation/Foundation.h>
17+
#import <ReplayKit/ReplayKit.h>
18+
19+
NS_ASSUME_NONNULL_BEGIN
20+
21+
typedef NS_ENUM(NSUInteger, TXReplayKitExtReason) {
22+
/// Main process request ends
23+
TXReplayKitExtReasonRequestedByMain,
24+
/// The link is broken and the main process exits
25+
TXReplayKitExtReasonDisconnected,
26+
/// The version does not match the main process SDK
27+
TXReplayKitExtReasonVersionMismatch
28+
};
29+
30+
@protocol TXReplayKitExtDelegate;
31+
32+
/// Screen sharing main entrance class
33+
API_AVAILABLE(ios(11.0))
34+
__attribute__((visibility("default"))) @interface TXReplayKitExt : NSObject
35+
36+
/// Get singleton
37+
+ (instancetype)sharedInstance;
38+
39+
/// Initialization method
40+
///
41+
/// Needs to be called in the broadcastStartedWithSetupInfo method in the implementation class of RPBroadcastSampleHandler
42+
/// @param appGroup App group ID
43+
/// @param delegate Callback object
44+
- (void)setupWithAppGroup:(NSString *)appGroup delegate:(id<TXReplayKitExtDelegate>)delegate;
45+
46+
/// Method of screen recording paused
47+
///
48+
/// When stopping screen recording through the system control center, RPBroadcastSampleHandler.broadcastPaused
49+
/// will be called back, which is called in the broadcastPaused method.
50+
- (void)broadcastPaused;
51+
52+
/// Method of screen recording resumed
53+
///
54+
/// When stopping screen recording through the system control center, RPBroadcastSampleHandler.broadcastPaused
55+
/// will be called back, which is called in the broadcastPaused method.
56+
- (void)broadcastResumed;
57+
58+
/// Method of screen recording finished
59+
///
60+
/// When stopping screen recording through the system control center, RPBroadcastSampleHandler.broadcastPaused
61+
/// will be called back, which is called in the broadcastPaused method.
62+
- (void)broadcastFinished;
63+
64+
/// Media data (audio and video) sending method
65+
///
66+
/// Need to be called in the processSampleBuffer: method in the implementation class of RPBroadcastSampleHandler
67+
///
68+
/// @param sampleBuffer Video or audio frame for system callback
69+
/// @param sampleBufferType media input type
70+
/// @note
71+
/// - sampleBufferType currently supports data frame processing of RPSampleBufferTypeVideo and RPSampleBufferTypeAudioApp types.
72+
/// - RPSampleBufferTypeAudioMic is not supported. Please process the microphone collection data in the main app.
73+
- (void)sendSampleBuffer:(CMSampleBufferRef)sampleBuffer
74+
withType:(RPSampleBufferType)sampleBufferType;
75+
76+
/// Video sending method
77+
/// Deprecated, please use - (void)sendSampleBuffer:(CMSampleBufferRef)sampleBuffer
78+
/// withType:(RPSampleBufferType)sampleBufferType; instead,Need to be called in the
79+
/// processSampleBuffer: method in the implementation class of RPBroadcastSampleHandler.
80+
///
81+
/// @param sampleBuffer System callback video frame
82+
- (void)sendVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer
83+
__attribute__((deprecated("use sendSampleBuffer:withType instead")));
84+
85+
@end
86+
87+
API_AVAILABLE(ios(11.0))
88+
@protocol TXReplayKitExtDelegate <NSObject>
89+
90+
/// Screen recording completion callback
91+
///
92+
/// @param broadcast The instance that issues the callback
93+
/// @param reason End reason code, see TXReplayKitExtReason
94+
- (void)broadcastFinished:(TXReplayKitExt *)broadcast reason:(TXReplayKitExtReason)reason;
95+
96+
@end
97+
98+
NS_ASSUME_NONNULL_END
99+
/// @}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>21G83</string>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en</string>
9+
<key>CFBundleExecutable</key>
10+
<string>TXLiteAVSDK_ReplayKitExt</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>com.tencent.TXLiteAVSDK.ReplayKitExt</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>TXLiteAVSDK_ReplayKitExt</string>
17+
<key>CFBundlePackageType</key>
18+
<string>FMWK</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>11.1.0.14143</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleSupportedPlatforms</key>
24+
<array>
25+
<string>iPhoneSimulator</string>
26+
</array>
27+
<key>CFBundleVersion</key>
28+
<string>1.0</string>
29+
<key>DTCompiler</key>
30+
<string>com.apple.compilers.llvm.clang.1_0</string>
31+
<key>DTPlatformBuild</key>
32+
<string></string>
33+
<key>DTPlatformName</key>
34+
<string>iphonesimulator</string>
35+
<key>DTPlatformVersion</key>
36+
<string>15.2</string>
37+
<key>DTSDKBuild</key>
38+
<string>19C51</string>
39+
<key>DTSDKName</key>
40+
<string>iphonesimulator15.2</string>
41+
<key>DTXcode</key>
42+
<string>1321</string>
43+
<key>DTXcodeBuild</key>
44+
<string>13C100</string>
45+
<key>MinimumOSVersion</key>
46+
<string>9.0</string>
47+
<key>NSPrincipalClass</key>
48+
<string></string>
49+
<key>UIDeviceFamily</key>
50+
<array>
51+
<integer>1</integer>
52+
<integer>2</integer>
53+
</array>
54+
</dict>
55+
</plist>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
framework module TXLiteAVSDK_ReplayKitExt {
2+
umbrella header "TXLiteAVSDK_ReplayKitExt.h"
3+
4+
export *
5+
module * { export * }
6+
}

0 commit comments

Comments
 (0)