主頁(yè) > 服務(wù)與支持 > 開發(fā)平臺(tái) > 客戶端SDK參考 > iOS UI SDK > 業(yè)務(wù)開發(fā) 會(huì)議中屏幕共享
更新時(shí)間:2019-11-20
iOS端屏幕共享需要進(jìn)行iOS Extension的開發(fā)進(jìn)行實(shí)現(xiàn),以下步驟用于說(shuō)明如何集成SDK進(jìn)行屏幕共享Extension的開發(fā),另外由于相關(guān)特性對(duì)系統(tǒng)能力的依賴,因此需要iOS12及以上版本才能支持屏幕共享功能。
ReplayKit.framework:系統(tǒng)庫(kù)
CloudLinkMeetingScreenShare.framework:SDK提供的庫(kù)
#import "SampleHandler.h" #import <CLoudLinkMeetingScreenShare/ScreenShareManager.h> @interface SampleHandler()<ScreenShareManagerDelegate> @property (strong, nonatomic) ScreenShareManager *screenShareManager; @end @implementation SampleHandler - (instancetype)init { if (self = [super init]) { self.screenShareManager = [[ScreenShareManager alloc] initWithAppGroupIdentifier:自己申請(qǐng)的appGroupIdentifier]; self.screenShareManager.delegate = self; } return self; } - (void)broadcastStartedWithSetupInfo:(NSDictionary<NSString *,NSObject *> *)setupInfo { // User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional. [self.screenShareManager broadcastStartedWithSetupInfo:setupInfo]; } - (void)dealloc { self.screenShareManager = nil; } - (void)broadcastPaused { // User has requested to pause the broadcast. Samples will stop being delivered. [self.screenShareManager broadcastPaused]; } - (void)broadcastResumed { // User has requested to resume the broadcast. Samples delivery will resume. [self.screenShareManager broadcastResumed]; } - (void)broadcastFinished { // User has requested to finish the broadcast. [self.screenShareManager broadcastFinished]; } - (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType { switch (sampleBufferType) { case RPSampleBufferTypeVideo: // Handle video sample buffer [self.screenShareManager processSampleBuffer:sampleBuffer withType:RPSampleBufferTypeVideo]; break; case RPSampleBufferTypeAudioApp: // Handle audio sample buffer for app audio break; case RPSampleBufferTypeAudioMic: // Handle audio sample buffer for mic audio break; default: break; } } - (void)screenShareManagerFinishBroadcastWithError:(NSError *)error { [self finishBroadcastWithError: error]; } @end
CloudLinkMeeting *clm = [CloudLinkMeeting sharedInstance]; clm.screenShareGroupId = 跟extension中相同的groupId; //開始ClooudLinkMeeting的其他接口調(diào)用