// // SellyRTCSession.h // SellyCloudSDK // // Created by Caleb on 17/11/25. // #import #import "SellyRTCVideoConfiguration.h" #import "SellyRTCSessionDelegate.h" #import #import "SellyRtcVideoCanvas.h" NS_ASSUME_NONNULL_BEGIN @interface SellyRTCSession : NSObject /** @param isP2p 是否单聊 */ - (instancetype)initWithType:(BOOL)isP2p; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; /** @brief 发起通话 */ - (void)startWithChannelId:(NSString *)channelId token:(NSString *)token; /// 结束通话 - (void)end; //是否开启本地视频,默认不开启 - (void)enableLocalVideo:(BOOL)enable; //是否开启本地音频采集,默认开启 - (void)enableLocalAudio:(BOOL)enable; //切换前后摄像头 - (void)switchCamera; /** * Starts the local video preview before joining a channel. * * Once you call this method to start the local video preview, if you leave * the channel by calling \ref leaveChannel: leaveChannel, the local video * preview remains until you call \ref stopPreview to disable it. */ - (void)startPreview; /** * Stops the local video preview and the video. */ - (void)stopPreview; /** 屏蔽对方的声音,单聊不用传userId */ - (void)muteRemoteAudioStream:(NSString *)userId mute:(BOOL)mute; /** @brief 设置声音输出通道 如果没有外接设备(蓝牙,耳机)等,可以直接调用这个方法在听筒和扬声器直接来回切换 如果有外接设备,建议直接使用AVRoutePickerView 有外接设备的情况下,无法切换为听筒播放,但是可以切换为扬声器播放 */ - (void)setAudioOutput:(AVAudioSessionPortOverride)port; /** 发送自定义消息给对方 */ - (void)sendMessage:(NSString *)message completion:(nonnull void (^)(NSError * _Nullable))completion; //本地localView - (void)setLocalCanvas:(SellyRtcVideoCanvas *)localCanvas; //远程remoteView - (void)setRemoteCanvas:(SellyRtcVideoCanvas *)remoteCanvas; //更新token - (void)renewToken:(NSString * _Nonnull)token; //Starts screen sharing. - (void)startScreenCapture; //外部推流,不使用sdk默认的视频采集 - (void)pushExternalVideoFrame:(CVPixelBufferRef)pixelBuffer; // @property (nonatomic, weak)id delegate; //视频编码设置 需要在startWithChannelId之前调用 @property (nonatomic, strong)SellyRTCVideoConfiguration *videoConfig; ////通话连接状态 @property (nonatomic, assign, readonly)SellyRoomConnectionState connectionState; @end NS_ASSUME_NONNULL_END