You need to enable JavaScript to run this app.
文档中心
实时音视频

实时音视频

复制全文
下载 pdf
SDK 升级指南
macOS 客户端升级指南
复制全文
下载 pdf
macOS 客户端升级指南

如果你希望从此前版本的 macOS 客户端 SDK 升级到最新的客户端 SDK,请在工程文件中,替换最新的客户端 SDK 文件,并参考本文完成 API,回调,参数类型等的替换。

升级过程中,你可能需要参考历史版本文档归档。

本文同时记录升级时需要适配的变更和新版本提供的新增能力。标题中标注“按需使用”的内容,不使用对应能力时无需修改现有代码。SDK 回调或返回的枚举新增取值时,建议检查现有的 switch、白名单和兜底逻辑是否能够处理新值。

3.60.107

错误码变更

如果你的业务使用单流转推,并且会穷举处理 ByteRTCSingleStreamTaskErrorCode,升级后需要补充以下错误码;其他业务无需修改。

ByteRTCSingleStreamTaskErrorCode 新增以下枚举值:

枚举值数值说明
ByteRTCSingleStreamTaskErrorCodePushToCDN1098转推到 CDN 失败。
ByteRTCSingleStreamTaskErrorCodeTaskCountOverLimit1099超过单流转推任务数限制,单个主播同时运行的转推任务不能超过 20 个。

3.60.105

本版本以下内容均为新增能力。不使用直播模式切换、自定义视频前处理范围、关键帧间隔或 SEI 发送能力时,无需修改现有代码。

新增类型和属性(按需使用)

类型

说明

ByteRTCRoomLiveMode(新增枚举)

新增枚举,定义直播模式,包含取值:

  • ByteRTCRoomLiveModeCoHost(1) 多人直播连麦
  • ByteRTCRoomLiveModeSoloHost(2) 单人直播

ByteRTCProcessorActionDomain(新增枚举)

新增枚举,定义视频前处理作用范围,包含取值:

  • ByteRTCProcessorActionDomainPreviewAndEncode(0)
  • ByteRTCProcessorActionDomainPreview(1)
  • ByteRTCProcessorActionDomainEncode(2)

ByteRTCRoomConfig

新增 liveMode 属性(ByteRTCRoomLiveMode 类型),用于进房时指定直播模式。

ByteRTCVideoPreprocessorConfig

新增 actionDomain 属性(ByteRTCProcessorActionDomain 类型),指定视频前处理作用范围。

ByteRTCVideoEncoderConfig

新增 keyFrameIntervalMS 属性(NSInteger 类型),关键帧间隔,单位毫秒

新增接口(按需使用)

接口

说明

- (int)setLiveMode:(ByteRTCRoomLiveMode)liveMode

设置房间直播模式,加入房间后调用。

- (int)sendLivePushSEIMessage:(NSString *)jsonString count:(int)count isKeyFrameOnly:(BOOL)isKeyFrameOnly allowOverwrite:(BOOL)allowOverwrite

以 Key-Value JSON 格式发送 SEI 数据,需先设为单人直播模式。

3.60.104

新增回调(License 计费场景)

仅 AI 音视频互动方案中使用 License 计费的业务需要关注该回调,并建议按下表说明处理。其他业务无需适配。

回调

说明

onLicenseQuotaExceeded

AI 音视频互动方案使用 License 计费时,License 配额用尽后,SDK 会触发此回调并中止服务。收到回调后,请及时续费并离开房间、销毁 SDK;续费成功后,再重新加入房间。

3.60.102

API 变更

头文件和基础类名

变更类型

V3.58

V3.60

头文件名称变更

../ByteRTCVideo.h

../ByteRTCEngine.h

基础类名变更(所有模块)

ByteRTCVideo

ByteRTCEngine

基础类名变更(所有模块)

ByteRTCVideoDelegate

ByteRTCEngineDelegate

新增加头文件

无

../ByteRTCRTSRoom.h
../ByteRTCGameRoom.h

引擎管理

功能

V3.58

V3.60

变更说明

创建引擎对象

createRTCVideo:(NSString * _Nonnull)appId delegate:(id_Nullable)delegate parameters:(NSDictionary * _Nonnull)parameters;

createRTCEngine:(ByteRTCEngineConfig * _Nonnull) config delegate:(id_Nullable)delegate

  • 名称变更:createRTCVideo改为 createRTCEngine
  • 参数变更:
    • parameters、appId:被移入新增的 ByteRTCEngineConfig 类中,且 appId 名称改为 appID
    • ByteRTCVideoDelegate:改名为ByteRTCEngineDelegate

销毁引擎

destroyRTCVideo

destroyRTCEngine

方法名称变更

引擎事件回调

ByteRTCVideoDelegate

ByteRTCEngineDelegate

协议名称变更

房间管理

功能

V3.58

V3.60

变更说明

加入房间

joinRoom:(NSString *_Nullable)token userInfo:(ByteRTCUserInfo *_Nonnull)userInfo roomConfig:(ByteRTCRoomConfig *Nonnull)roomConfig NS_SWIFT_NAME(joinRoom(:userInfo:roomConfig:));

joinRoom:(NSString *_Nullable)token userInfo:(ByteRTCUserInfo *_Nonnull)userInfo userVisibility:(BOOL)userVisibility roomConfig:(ByteRTCRoomConfig *Nonnull)roomConfig NS_SWIFT_NAME(joinRoom(:userInfo:userVisibility:roomConfig:));

  1. 参数变更:
    1. 新增参数 userVisibility:指定用户可见性。
      建议在进房时将用户可见性都设置为 false,并在用户需要发送音视频流时再通过 setUserVisibility: 设置为 true。由于单个房间的不可见用户容量远高于可见用户容量,按需开启用户可见性可以最大程度利用 RTC 通话房间资源,避免了 RTC 房间内的可见用户达到上限后,后续用户进房失败的情况。
    2. ByteRTCRoomConfig 中的参数:isAutoPublish 拆分为视频 isAutoPublishVideo 和音频 isAutoPublishAudio。
    3. ByteRTCRoomConfig 中的参数 ByteRTCRoomProfile(房间模式)的枚举有增减,具体参见下面的iOS*。***
  2. 行为变更:
    • V3.58:
      • 进房默认自动发布主流,进房时是否发布音频流或视频流由调用 publishVideoStream(false) 和 publishAudioStream(false) 决定
    • publishVideoStream/publishAudioStream 进房前后都有效
    • V3.60:
      • 进房自动发布音视频流(主流),流是否发布出去,由RTCRoomConfig的 isPublishVideo 和 isPublishAudio决定。
      • publishVideoStream/publishAudioStream 单流版本作用域范围只限进房后,进房前调用无效

创建房间实例

createRTCRoom:(NSString * _Nonnull)roomId

createRTCRoom:(NSString * _Nonnull)roomId

行为变更:
使用已存在 roomId 创建房间实例时,将返回上次创建的房间实例,不再触发错误码 ByteRTCWarningCodeOldRoomBeenReplaced = -2016

创建房间失败回调

rtcEngine:onCreateRoomStateChanged:errorCode:

rtcRoom:onRoomStateChanged:withUid:state:extraInfo:

接口替换:
创建房间失败由 rtcRoom:onRoomStateChanged:withUid:state:extraInfo: 进行通知。不再通过 onCreateRoomStateChanged 回调。

设置房间附加信息结果的回调

onSetRoomExtraInfoResult:(NSInteger)taskId error:(ByteRTCSetRoomExtraInfoResult)error;

onSetRoomExtraInfoResult:(NSInteger)taskId result:(ByteRTCSetRoomExtraInfoResult)result;

参数变更:error 更名为 result。

远端可见用户加入房间,或房内不可见用户切换为可见的回调

onUserJoined:(ByteRTCUserInfo *_Nonnull)userInfo elapsed:(NSInteger)elapsed;

onUserJoined:(ByteRTCUserInfo*_Nonnull)userInfo;

参数变更:删除无效参数 elapsed。

发布和订阅 Simulcast 流

变更类型

V3.58

V3.60

说明

开启/关闭推送多路视频流

enableSimulcastMode:(BOOL) enabled
开启后会发布所有已设置的 Simulcast 流。

setLocalSimulcastMode:(ByteRTCVideoSimulcastMode)mode

  • 接口重命名
  • 功能扩展、参数变更:移除旧方法中的 boolean enabled,替换为 (ByteRTCVideoSimulcastMode)mode,允许通过参数 ByteRTCVideoSimulcastMode 指定具体的多路流模式类型。
  • 默认行为调整:
    • 旧接口:当 enabled 为 true 时会发布所有已设置的 Simulcast 流
    • 新接口:将 mode 参数设置为 ByteRTCVideoSimulcastModeAlwaysSimulcast = 2 时会发布所有已设置的 Simulcast 流。
  • 调用时机变更:旧方法在进房前或进房后但未发布流时调用,新方法需在进房前调用。

设置期望订阅的远端视频流的参数

setRemoteVideoConfig:(NSString * _Nonnull) userId remoteVideoConfig:(ByteRTCRemoteVideoConfig *_Nonnull) remoteVideoConfig

setRemoteSimulcastStreamType:(NSString * _Nonnull) streamId streamType:(ByteRTCVideoSimulcastStreamType)streamType

  • 接口重命名
  • 参数变更:
    • 将参数userId改为streamId,追踪流而非用户。
    • 将参数remoteVideoConfig替换为 streamType,不再需要指定具体数值,你可以通过传入枚举值指定订阅偏好。

设置或更新 Simulcast 流的编码参数

setVideoEncoderConfig:(NSArray <ByteRTCVideoEncoderConfig *> * _Nullable) encoderConfigs

setLocalSimulcastMode:(ByteRTCVideoSimulcastMode)mode config:(NSArray <ByteRTCVideoEncoderConfig *> * _Nullable)streamConfig

  • 接口替换
  • 参数变更:
    • 形参 encoderConfigs 变更为 streamConfig
    • 新增参数 mode,用户指定流类型(大流或者小流)
  • 设置一路视频流参数
  • 设置多路视频流参数

setMaxVideoEncoderConfig:(ByteRTCVideoEncoderConfig * _Nullable) max_solution;

setVideoEncoderConfig:(ByteRTCVideoEncoderConfig * _Nullable) encoderConfig;

  • 接口合并
  • 功能变更:​新方法仅用于设置大流编码参数。
  • 参数变更:​形参变更为 encoderConfig

发布和订阅主流(摄像头/麦克风采集的流)

功能

V3.58

V3.60

详情

  1. 发布/取消音视频流

API:

  • 发布音视频流
  • 取消发布音视频流
  • publishStream:(ByteRTCMediaStreamType)type
  • unpublishStream:(ByteRTCMediaStreamType)type
  • publishStreamVideo:(BOOL)publish
  • publishStreamAudio:(BOOL)publish
  • 接口拆分、功能扩展:
    • 按照音频和视频拆分:2 个新方法分别用于控制视频流和音频流的发布
    • 合并发布与取消发布:新接口通过 (BOOL)publish 参数处理发布和取消发布操作
  • 参数变更:
    • 移除 (ByteRTCMediaStreamType)type,新方法直接通过方法名直接区分视频和音频流
    • 新增 (BOOL)publish
  • 行为变更:
    • V3.58:进房前后都有效
    • V3.60:作用域范围只限进房后,进房前调用无效

音视频流发布状态改变回调

  • rtcRoom:( ByteRTCRoom * _Nonnull)rtcRoom onUserPublishStream:(NSString *_Nonnull)userId type:(ByteRTCMediaStreamType)type;
  • rtcRoom:( ByteRTCRoom * _Nonnull)rtcRoom onUserUnpublishStream:(NSString *_Nonnull)userId type:(ByteRTCMediaStreamType)type reason:(ByteRTCStreamRemoveReason)reason;
  • rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamAudio:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish
  • rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamVideo:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish
  • 接口拆分重命名、功能扩展:
    • 按照音频和视频拆分:2 个新方法分别用于控制音频流和视频流订阅回调
    • 合并订阅与取消订阅状态:新接口通过 isPublish 参数代表发布和取消发布
  • 参数变更:
    • 移除参数
      • 移除 userId,新方法通过 streamId 参数标识。
      • 移除 type,新方法直接通过方法名区分视频和音频流。
      • 移除 reason,不再提供移除原因的详细信息。
    • 新增参数:​新增 streamId 参数,用于区分流。

音视频流发布状态触发警告或错误时回调

rtcRoom:(ByteRTCRoom *_Nonnull)rtcRoom onStreamStateChanged:(NSString *_Nonnull)roomId withUid:(nonnull NSString *)uid state:(NSInteger)state extraInfo:(NSString *_Nonnull)extraInfo;

  • rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onVideoPublishStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info state:(ByteRTCPublishState)state reason:(ByteRTCPublishStateChangeReason)reason
  • rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onAudioPublishStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info state:(ByteRTCPublishState)state reason:(ByteRTCPublishStateChangeReason)reason
  • 接口拆分重命名:按照音频和视频拆分,新方法分别用于控制视频流和音频流的发布状态回调
  • 参数变更
    • 移除参数:
      • 移除参数 roomId和 uid;
      • 移除无效参数 extraInfo。
    • 新增参数:
      • 新增 streamId 和 info 参数,用于标识流的唯一标识和流信息;
      • 新增reason 参数,用于更详细地描述状态改变的具体原因。
    • 参数类型变更:state 参数类型从 NSInteger 变更为 ByteRTCPublishState 枚举类型,以提供更明确的状态定义
  1. 订阅/取消订阅音视频流
  • 订阅音视频流
  • 取消订阅音视频流
  • subscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType
  • unsubscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;
  • subscribeStreamAudio:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe
  • subscribeStreamVideo:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe
  • 接口拆分重命名、功能扩展:
    • 按照音频和视频拆分:2 个新方法分别用于控制视频流和音频流的订阅
    • 合并订阅与取消订阅:新接口通过 subscribe 参数代表订阅和取消订阅
  • 参数变更:
    • 移除参数:
      • 移除userId,使用streamId标识流。
      • 移除type,新方法直接通过方法名区分视频和音频流
    • 新增参数:
      • streamId用于标识流;
      • subscribe,用于标识是否订阅。

音视频流订阅状态改变回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onStreamSubscribed:(ByteRTCSubscribeState)state userId:(NSString *_Nonnull)userId subscribeConfig:(ByteRTCSubscribeConfig *_Nonnull)info

  • rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamAudio:(NSString* _Nonnull)roomId uid:(NSString* _Nonnull)uid isPublish:(BOOL)isPublish
  • rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishScreenVideo:(NSString* _Nonnull)roomId uid:(NSString* _Nonnull)uid isPublish:(BOOL)isPublish
  • 接口拆分重命名、功能扩展:
    • 按照音频和视频拆分:2 个新方法分别用于控制音频流和视频流订阅回调
    • 合并订阅与取消订阅状态:新接口通过 (BOOL)isPublish 参数代表发布和取消发布
  • 参数变更:
    • 新增参数:roomId:房间 ID
    • 参数重命名:userId 被重命名为 uid
    • 移除参数:
      • 移除 subscribeConfig:(ByteRTCSubscribeConfig *_Nonnull)info,不再提供订阅配置信息。
      • 移除 state参数,通过 isPublish参数替代,明确区分发布和取消发布状态

音视频流订阅状态改变回调

rtcRoom:(ByteRTCRoom *_Nonnull)rtcRoom onStreamStateChanged:(NSString *_Nonnull)roomId withUid:(nonnull NSString *)uid state:(NSInteger)state extraInfo:(NSString *_Nonnull)extraInfo;

  • rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onVideoSubscribeStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info state:(ByteRTCSubscribeState)state reason:(ByteRTCSubscribeStateChangeReason)reason
  • rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onAudioSubscribeStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info state:(ByteRTCSubscribeState)state reason:(ByteRTCSubscribeStateChangeReason)reason
  • 接口拆分重命名:按照音频和视频拆分,新方法分别用于控制视频流和音频流的发布状态回调
  • 参数变更:
    • 新增参数:
      • 新增 streamId和 info参数,用于标识订阅状态变更的流信息。
      • 新增了 reason 参数:用于标识订阅状态变更的具体原因
    • 参数类型变更:state 参数类型从 NSInteger变更为 ByteRTCSubscribeState枚举类型,以提供更明确的状态定义。
    • 移除参数:
      • 移除参数 roomId和 uid;
      • 移除无效参数 extraInfo。
  1. 订阅/取消订阅所有媒体流
  • 订阅所有媒体流
  • 取消订阅所有媒体流
  • subscribeAllStreamsWithMediaStreamType:(ByteRTCMediaStreamType)mediaStreamType
  • unsubscribeAllStreamsWithMediaStreamType:(ByteRTCMediaStreamType)mediaStreamType
  • subscribeAllStreamsVideo:(BOOL)subscribe
  • subscribeAllStreamsAudio:(BOOL)subscribe
  • 接口拆分重命名、功能扩展:
    • 按照音频和视频拆分:2 个新方法分别用于控制视频流和音频流的订阅
    • 合并订阅与取消订阅:新接口通过 subscribe 参数处理订阅和取消订阅
  • 参数变更:移除 mediaStreamType,新方法直接通过方法名直接区分视频流和音频流

暂停接收来自远端的媒体流

pauseAllSubscribedStream:(ByteRTCPauseResumControlMediaType) mediaType

  • pauseAllSubscribedStreamAudio
  • pauseAllSubscribedStreamVideo
  • 接口拆分:按照音频和视频拆分,2 个新方法分别用于暂停接收所有远端的音频流、暂停所有远端的视频流
  • 参数变更:移除了 mediaType参数,新方法通过方法名直接区分音频和视频流

恢复接收来自远端的媒体流

resumeAllSubscribedStream:(ByteRTCPauseResumControlMediaType) mediaType

  • resumeAllSubscribedStreamAudio
  • resumeAllSubscribedStreamVideo
  • 接口拆分:按照音频和视频拆分,2 个新方法分别用于恢复接收所有远端的音频流、恢复接收所有远端的视频流
  • 参数变更:移除了 mediaType参数,新方法通过方法名直接区分音频和视频流

屏幕分享

  1. 屏幕流和普通视频流在同一引擎中不能共存,开启屏幕流时会自动关闭普通视频流,开启普通视频流时会自动关闭屏幕流。
  2. 屏幕流和普通视频流发布订阅方式一致,废除了一系列带"screen"的接口。

功能

V3.58

V3.60

变更说明

采集屏幕视频

startScreenVideoCapture:(ByteRTCScreenCaptureSourceInfo _Nonnull)sourceInfo captureParameters:(ByteRTCScreenCaptureParam **Nonnull)captureParameters NS_SWIFT_NAME(startScreenVideoCapture(:captureParameters:))

startScreenVideoCapture:(ByteRTCScreenCaptureSourceInfo _Nonnull)sourceInfo captureParameters:(ByteRTCScreenCaptureParam **Nonnull)captureParameters NS_SWIFT_NAME(startScreenVideoCapture(:captureParameters:))

行为变更:
在开始屏幕采集时,会停止视频采集功能

设置屏幕流编码参数

setScreenVideoEncoderConfig:(ByteRTCScreenVideoEncoderConfig * _Nullable) encoderConfig

setVideoEncoderConfig:(ByteRTCVideoEncoderConfig * _Nullable) encoderConfig

接口替换:
屏幕流和视频流共用同一套编码参数,setVideoEncoderConfig设置的参数会同时作用于屏幕流和一般视频流

发布/停止发布本地屏幕音视频流

publishScreen:(ByteRTCMediaStreamType)type
unpublishScreen:(ByteRTCMediaStreamType)type

publishStreamVideo:(BOOL)publish
publishStreamAudio:(BOOL)publish

接口替换:
屏幕流和视频流共用同一套发布/取消发布接口
接口拆分
音频和视频的发布/取消发布接口拆开

订阅/取消订阅远端屏幕音视频流

subscribeScreen:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType
unsubscribeScreen:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType

subscribeStreamVideo:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe
subscribeStreamAudio:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe

接口替换:
屏幕流和视频流共用同一套订阅/取消订阅接口
接口拆分
音频和视频的订阅/取消订阅接口拆开
参数变更:
通过参数streamId来区分具体是哪路流,是否为屏幕流

远端用户发布或者取消发布屏幕流回调

rtcRoom:( ByteRTCRoom * _Nonnull)rtcRoom onUserPublishScreen:(NSString *_Nonnull)userId type:(ByteRTCMediaStreamType)type
rtcRoom:( ByteRTCRoom * _Nonnull)rtcRoom onUserUnpublishScreen:(NSString *_Nonnull)userId type:(ByteRTCMediaStreamType)type reason:(ByteRTCStreamRemoveReason)reason

rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamVideo:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish;
rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamAudio:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish;

接口替换:
屏幕流和视频流共用同一套发布/取消发布回调接口
接口拆分
音频和视频的发布/取消发布回调接口拆开
参数变更:
通过参数streamId来区分具体是哪路流,是否为屏幕流

屏幕共享流的视频首帧发送状态回调

rtcEngine:(ByteRTCVideo *_Nonnull)engine onScreenVideoFrameSendStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state;

rtcEngine:(ByteRTCEngine _Nonnull)engine onVideoFrameSendStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state

接口替换:
屏幕流和视频流共用同一套视频首帧发送状态回调
参数变更:
通过参数streamId来区分具体是哪路流,是否为屏幕流

屏幕共享流视频首帧播放状态回调

rtcEngine:(ByteRTCVideo *_Nonnull)engine onScreenVideoFramePlayStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state;

rtcEngine:(ByteRTCEngine _Nonnull)engine onVideoFramePlayStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state

接口替换:
屏幕流和视频流共用同一套视频首帧播放状态回调
参数变更:
通过参数streamId来区分具体是哪路流,是否为屏幕流

RTS

RTC包含RTS能力,当前版本将RTS相关接口进一步进行拆分。如果仅使用RTS的相关能力则调用createRTSRoom创建RTSRoom实例,使用ByteRTCRTSRoomDelegate回调。如果既使用音视频能力又使用RTS能力则从RTCEngine中调用createRTCRoom创建RTCRoom实例,使用ByteRTCRoomDelegate回调。

ByteRTCRoom 部分

功能

v3.58

v3.60

变更说明

创建RTS房间

createRTCRoom:(NSString * _Nonnull)roomId;

createRTSRoom:(NSString * _Nonnull)roomId;

接口拆分:仅使用RTS的相关能力则调用createRTSRoom创建RTSRoom实例

设置RTS相关回调

setRTCRoomDelegate:(id_Nullable)roomDelegate;

setRTSRoomDelegate:(id_Nullable)roomDelegate;

接口拆分:仅使用RTS的相关能力则在RTSRoom中的此接口设置回调

收到房间外用户 发来的二进制消息时,会收到此回调

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserBinaryMessageReceivedOutsideRoom:(NSString * _Nonnull)uid message:(NSData * _Nonnull)message

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserBinaryMessageReceivedOutsideRoom:(NSInteger)msgid uid:(NSString * _Nonnull)uid message:(NSData * _Nonnull)message

参数变更:回调参数增加msgid参数

接收到房间内广播消息的回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomMessageReceived:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message

参数变更:回调参数增加msgid参数

收到房间内广播二进制消息的回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomBinaryMessageReceived:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomBinaryMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message

参数变更:回调参数增加msgid参数

收到来自房间中其他用户发来的点对点文本消息时,会收到此回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserMessageReceived:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message

参数变更:回调参数增加msgid参数

收到来自房间中其他用户发来的点对点二进制消息时,会收到此回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserBinaryMessageReceived:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserBinaryMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message

参数变更:回调参数增加msgid参数

ByteRTCRTSRoom 部分

功能

v3.58

v3.60

变更说明

接收到房间内广播消息的回调

rtsRoom:(ByteRTCRTSRoom * _Nonnull)rtsRoom onRoomMessageReceived:(NSString * _Nonnull)uid message:(NSString * _Nonnull)message;

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onRoomMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message;

参数变更:回调参数增加msgid参数

收到房间内广播二进制消息的回调

rtsRoom:(ByteRTCRTSRoom * _Nonnull)rtsRoom onRoomBinaryMessageReceived:(NSString * _Nonnull)uid message:(NSData * _Nonnull)message;

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onRoomBinaryMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message;

参数变更:回调参数增加msgid参数

收到来自房间中其他用户发来的点对点文本消息时,会收到此回调

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onUserMessageReceived:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message;

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onUserMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSString *_Nonnull)message;

参数变更:回调参数增加msgid参数

收到来自房间中其他用户发来的点对点二进制消息时,会收到此回调

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onUserBinaryMessageReceived:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message;

rtsRoom:( ByteRTCRTSRoom *_Nonnull)rtsRoom onUserBinaryMessageReceived:(NSInteger)msgid uid:(NSString *_Nonnull)uid message:(NSData *_Nonnull)message;

参数变更:回调参数增加msgid参数

WTN 流(原公共流)

  • 移动接口位置:
    • 订阅 WTN 流的接口移动到新增的 ByteRTCWTNStream 类中。
    • WTN 流订阅端回调移动到新增的 ByteRTCWTNStreamDelegate 回调类中。你需要先调用 setWTNStreamDelegate: 设置回调手柄。
  • 与合流转推接口共用 MixedStreamConfig,提升易用性。
  • 新增 onWTNRemoteVideoStats:videoStats: 和 onWTNRemoteAudioStats:audioStats::用于获取 WTN 流信息,检测流质量。
  • 拆分、重命名、替换接口,具体变更如下:

功能

V3.58

V3.60

变更说明

发布 WTN 流

startPushPublicStream:(NSString * _Nonnull)publicStreamId withLayout:(ByteRTCPublicStreaming *_Nullable)publicStream

startPushMixedStream:(NSString * _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig*)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nullable)config

  • 接口重命名
  • 接口合并、功能扩展:startPushPublicStream 和 startPushMixedStreamToCDN 合并为 startPushMixedStream,新接口可同时用于合流转推至 CDN 或转推 WTN(原公共流)
  • 参数变更:
    • 新增参数:新增 taskId:设置转推任务 ID,用于标识转推任务
    • 替换参数:
      • 移除 publicStreamId:由新增参数 pushTargetConfig 的来指定 WTN 流 ID(即公共流 ID)
      • 移除 publicStream,由新增参数 mixedConfig 来指定配置 WTN 流(例如视频转码、布局等)

更新 WTN 流

updatePublicStreamParam:(NSString * _Nonnull)publicStreamId withLayout:(ByteRTCPublicStreaming *_Nullable)publicStream

updatePushMixedStream:(NSString _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nonnull)config

  • 接口重命名
  • 接口合并、功能扩展:updatePublicStreamParam 和 updatePushMixedStreamToCDN 合并为 updatePushMixedStream,新接口可同时用于更新合流转推 CDN 和转推 WTN(原公共流)任务
  • 参数变更:
    • 新增参数:新增 taskId,合流任务的 ID
    • 替换参数:
      • 移除 publicStreamId:由新增参数 pushTargetConfig 的来指定 WTN 流 ID(即公共流 ID)
      • 移除 publicStream,由新增参数 mixedConfig 来指定配置 WTN 流(例如视频转码、布局等)

停止发布 WTN 流

stopPushPublicStream:(NSString * _Nonnull)publicStreamId;

stopPushMixedStream:(NSString *_Nonnull)taskId withPushTargetType:(ByteRTCMixedStreamPushTargetType)pushTargetType

  • 接口重命名
  • 接口合并、功能扩展:stopPushPublicStream 和 stopPushStreamToCDN 合并为 stopPushMixedStream,新接口可同时用于停止发布 WTN 流(原公共流)和停止合流转推
  • 参数变更:
    • 新增参数:新增 taskId,合流任务的 ID
    • 替换参数:移除 publicStreamId,由新增参数 pushTargetType 来指定用于指定要停止的流
  • 订阅 WTN 流
  • 取消订阅 WTN 流
  • startPlayPublicStream:(NSString * _Nonnull)publicStreamId
  • stopPlayPublicStream:(NSString * _Nonnull)publicStreamId
  • subscribeWTNVideoStream:(NSString * _Nonnull)streamId subscribe:(bool)subscribe
  • subscribeWTNAudioStream:(NSString * _Nonnull)streamId subscribe:(bool)subscribe
  • 接口拆分重命名、功能扩展:
    • 按照音频和视频拆分:2 个新方法别用于订阅/取消订阅 WTN 音视流、订阅/取消订阅视频流
    • 合并订阅与取消订阅:新接口通过 (bool )subscribe 参数处理订阅和取消订阅
  • 参数变更:
    • publicStreamId:重命名为streamId
    • 新增 boolean subscribe

绑定 WTN 流画布

setPublicStreamVideoCanvas:(NSString *_Nonnull)publicStreamId withCanvas:(ByteRTCVideoCanvas * Nullable)canvas NS_SWIFT_NAME(setPublicStreamVideoCanvas(:withCanvas:))

setWTNRemoteVideoCanvas:(NSString *_Nonnull)streamId withCanvas:(ByteRTCVideoCanvas * Nullable)canvas NS_SWIFT_NAME(setWTNRemoteVideoCanvas(:withCanvas:))

  • 接口重命名
  • 参数变更:publicStreamId 重命名为 streamId

为 WTN 流指定外部渲染器

setPublicStreamVideoSink:(NSString *_Nonnull)publicStreamId withSink:(id_Nullable)videoSink withPixelFormat:(ByteRTCVideoSinkPixelFormat)requiredFormat NS_SWIFT_NAME(setPublicStreamVideoSink(:withSink:withPixelFormat:))

setWTNRemoteVideoSink:(NSString _Nonnull)streamId withSink:(id_Nullable)videoSink withConfig:(ByteRTCRemoteVideoSinkConfig)config NS_SWIFT_NAME(setWTNRemoteVideoSink(_:withSink:withConfig:))

  • 接口重命名
  • 参数变更:
    • 参数重命名:publicStreamId 重命名为 streamId
    • 新增参数: config(ByteRTCRemoteVideoSinkConfig 类型),用于配置远端视频帧(例如位置、格式、否将视频帧镜像等)
    • 替换移动:
      移除 requiredFormat,移动至ByteRTCRemoteVideoSinkConfig 中,默认为 0(原格式)

调节 WTN 流播放音量

setPublicStreamAudioPlaybackVolume:(NSString *_Nonnull)publicStreamId volume:(NSInteger)volume

setWTNRemoteAudioPlaybackVolume:(NSString *_Nonnull)streamId volume:(NSInteger)volume

  • 接口重命名
  • 参数变更:publicStreamId 重命名为 streamId

WTN 流任务回调

rtcEngine:(ByteRTCVideo *_Nonnull)engine onPushPublicStreamResult:(NSString *_Nonnull)roomId publicStreamId:(NSString *_Nonnull)streamId errorCode:(ByteRTCPublicStreamErrorCode)errorCode

rtcEngine:(ByteRTCEngine * _Nonnull)engine onMixedStreamEvent:(ByteRTCMixedStreamTaskEvent)event withMixedStreamInfo:(ByteRTCMixedStreamTaskInfo*)info withErrorCode:(ByteRTCMixedStreamTaskErrorCode)errorCode

  • 接口重命名
  • 接口合并、功能扩展:onMixingEvent、onStreamMixingEvent 和 onPushPublicStreamResult 合并为 onMixedStreamEvent,新接口可同时用于回调合流转推 CDN / WTN 流状态
  • 参数变更:
    • 参数类型变更:
      errorCode 的类型由ByteRTCPublicStreamErrorCode 变更为 ByteRTCMixedStreamTaskErrorCode,和合流转推任务共用同一个枚举类。变更详情,请参见iOS
    • 移除参数:
      • 移除 roomId:不再需要传入
      • 移除 publicStreamId:替换为新增的 MixedStreamTaskInfo info 中的 taskId
    • 新增参数:新增 event(合流任务事件)ByteRTCMixedStreamTaskEvent类型,详情请参见iOS

播放 WTN 流任务回调

rtcEngine:(ByteRTCVideo *_Nonnull)engine onPlayPublicStreamResult:(NSString *_Nonnull)publicStreamId errorCode:(ByteRTCPublicStreamErrorCode)errorCode

  • onWTNVideoSubscribeStateChanged:(NSString *_Nonnull)streamId state:(ByteRTCWTNSubscribeState)state reason:(ByteRTCWTNSubscribeStateChangeReason)reason
  • onWTNAudioSubscribeStateChanged:(NSString *_Nonnull)streamId state:(ByteRTCWTNSubscribeState)state reason:(ByteRTCWTNSubscribeStateChangeReason)reason
  • 接口拆分、重命名:拆分为 2 个独立接口,分别用于回调 WTN 音频/视频流订阅状态变化
  • 参数变更
    • 参数重命名:publicStreamId 重命名为 streamId
    • 移除参数:移除 errorCode ,替代为state (订阅状态码)和 reason(订阅状态变化原因)。
  • 位置移动:移动到 ByteRTCWTNStreamDelegate 类中

接收 WTN 流中的 SEI 回调

rtcEngine:(ByteRTCVideo * _Nonnull)engine onPublicStreamSEIMessageReceived:(NSString* _Nonnull)publicStreamId andMessage:(NSData* _Nonnull)message andSourceType:(ByteRTCDataMessageSourceType)sourceType

onWTNSEIMessageReceived:(NSString* _Nonnull)streamId andChannelId:(int)channelId andMessage:(NSData* _Nonnull)message

  • 接口重命名
  • 参数变更:
    • 参数重命名:publicStreamId 重命名为 streamId
    • 新增参数:新增 channelId,为不同接受方设置不同的 ChannelID,接收方可以根据回调中的 ChannelID 选择应关注的 SEI 信息
    • 移除参数:移除DataMessageSourceType sourceType ,不再需要传入
  • 位置移动:移动到 ByteRTCWTNStreamDelegate 类中

接收 WTN 流中的 Data Message 回调

rtcEngine:(ByteRTCVideo * _Nonnull)engine onPublicStreamDataMessageReceived:(NSString* _Nonnull)publicStreamId andMessage:(NSData* _Nonnull)message andSourceType:(ByteRTCDataMessageSourceType)sourceType

onWTNDataMessageReceived:(NSString* _Nonnull)streamId andMessage:(NSData* _Nonnull)message andSourceType:(ByteRTCDataMessageSourceType)sourceType

  • 接口重命名
  • 参数变更:publicStreamId 重命名为 streamId
  • 位置移动:移动到 ByteRTCWTNStreamDelegate 类中

WTN 视频流首帧解码成功回调

rtcEngine:(ByteRTCVideo * _Nonnull)engine onFirstPublicStreamVideoFrameDecoded:(NSString * _Nonnull)publicStreamId withFrameInfo:(ByteRTCVideoFrameInfo * Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onFirstPublicStreamVideoFrameDecoded:withFrameInfo:))

onWTNFirstRemoteVideoFrameDecoded:(NSString * _Nonnull)streamId withFrameInfo:(ByteRTCVideoFrameInfo * _Nonnull)frameInfo NS_SWIFT_NAME(onWTNFirstRemoteVideoFrameDecoded(streamId:withFrameInfo:))

  • 接口重命名
  • 参数重命名:publicStreamId 重命名为 streamId
  • 位置移动:移动到 ByteRTCWTNStreamDelegate 类中

WTN 音频流首帧解码成功回调

rtcEngine:(ByteRTCVideo * _Nonnull)engine onFirstPublicStreamAudioFrame:(NSString * _Nonnull)publicStreamId

onWTNFirstRemoteAudioFrame:(NSString * _Nonnull)streamId

  • 接口重命名
  • 参数变更:publicStreamId 重命名为 streamId
  • 位置移动:移动到 ByteRTCWTNStreamDelegate 类中

转推直播

优化了转推直播接口的易用性。与 WTN 接口共用 MixedStreamConfig,提升易用性。如果你已经实现了转推直播功能,参考以下表格对接口进行替换。

功能

V3.58

V3.60

变更说明

合流转推

startPushMixedStreamToCDN:(NSString * _Nonnull)taskID mixedConfig:(ByteRTCMixedStreamConfig *_Nullable)config observer:(id_Nullable)observer

startPushMixedStream:(NSString * _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig*)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nullable)config

  • 接口重命名
  • 接口合并、功能变更:startPushPublicStream 和 startPushMixedStreamToCDN 合并为 startPushMixedStream,新接口可同时用于合流转推 CDN 和转推 WTN(原公共流)
  • 参数变更:
    • 参数重命名:taskID重命名为 taskId
    • 移除删除:observer
    • 新增参数:新增pushTargetConfig,类型为 ByteRTCMixedStreamPushTargetConfig,用于配置推流目标。

更新合流转推任务

updatePushMixedStreamToCDN:(NSString *_Nonnull)taskID mixedConfig:(ByteRTCMixedStreamConfig *_Nonnull)config

updatePushMixedStream:(NSString _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nonnull)config

  • 接口重命名
  • 接口合并:updatePublicStreamParam 和 updatePushMixedStreamToCDN 合并为 updatePushMixedStream,新接口可同时用于更新合流转推 CDN 和转推 WTN(原公共流)任务
  • 参数变更:
    • 参数重命名:taskID重命名为 taskId
    • 新增参数:新增 pushTargetConfig,类型为 ByteRTCMixedStreamPushTargetConfig,用于设置目标推流地址

单流转推

startPushSingleStreamToCDN:(NSString *_Nonnull)taskID singleStream:(ByteRTCPushSingleStreamParam *_Nonnull)singleStream observer:(idNullable)observer NS_SWIFT_NAME(startPushSingleStreamToCDN(:singleStream:observer:))

startPushSingleStream:(NSString *_Nonnull)taskId singleStream:(ByteRTCPushSingleStreamParam *_Nonnull)singleStream

  • 接口重命名
  • 参数变更:
    • 移除参数:移除 observer,不再需要传入
    • 参数重命名:taskID重命名为 taskId

停止转推任务

stopPushStreamToCDN:(NSString *Nonnull)taskID NS_SWIFT_NAME(stopPushStreamToCDN(:))

  • startPushSingleStream:(NSString *_Nonnull)taskId singleStream:(ByteRTCPushSingleStreamParam *_Nonnull)singleStream
  • stopPushMixedStream:(NSString *_Nonnull)taskId withPushTargetType:(ByteRTCMixedStreamPushTargetType)pushTargetType
  • 接口拆分、重命名:按单流和合流拆分
  • 其中,停止合流转推接口(stopPushMixedStream):
    • 功能扩展:即可用于停止转推 CDN,也可以用于停止转推 WTN 流
    • 新增参数:新增 pushTargetType,类型为 ByteRTCMixedStreamPushTargetType枚举,用于指定目标停止的流
    • 参数重命名:taskID重命名为 taskId

转推任务回调

onMixingEvent:(ByteRTCStreamMixingEvent)event taskId:(NSString *_Nonnull)taskId error:(ByteRTCStreamMixingErrorCode)errorCode mixType:(ByteRTCMixedStreamType)mixType

  • rtcEngine:(ByteRTCEngine * _Nonnull)engine onMixedStreamEvent:(ByteRTCMixedStreamTaskEvent)event withMixedStreamInfo:(ByteRTCMixedStreamTaskInfo*)info withErrorCode:(ByteRTCMixedStreamTaskErrorCode)errorCode
  • rtcEngine:(ByteRTCEngine * _Nonnull)engine onSingleStreamEvent:(ByteRTCSingleStreamTaskEvent)event withTaskId:(NSString*)taskId withErrorCode:(ByteRTCSingleStreamTaskErrorCode)errorCode
  • 接口拆分、重命名:按合流任务事件回调、单流任务的事件回调拆分
    其中,合流转推回调(onMixedStreamEvent):
    • 接口合并、功能扩展:onMixingEvent、onStreamMixingEvent 和 onPushPublicStreamResult 合并为 onMixedStreamEvent,新接口可同时用于回调合流转推 CDN / WTN 流状态
  • 参数变更:
    • 类型变更:
      • event(事件):类型从 ByteRTCStreamMixingEvent改为 ByteRTCMixedStreamTaskEvent,详情请参见iOS
      • errorCode:类型从 ByteRTCStreamMixingErrorCode改为 ByteRTCMixedStreamTaskErrorCode,详情请参见iOS
    • 移除参数:移除 MixedStreamType mixType:无替代
    • 新增参数:新增 info,类型为 ByteRTCMixedStreamTaskInfo,用于提供混合流任务的详细信息
  • 位置移动:移动到 ByteRTCEngineDelegate

音视频传输

功能

接口名

变更说明

接收到来自远端某音频流的第一帧时回调

rtcEngine:onFirstRemoteAudioFrame:info:

参数变化:
RemoteStreamKey参数替换成streamId、streamInfo
新增适用场景:
远端用户取消发布音频并再发布音频后,也会收到该回调。
取消发布包括发布端主动取消、主动退房、掉线以及停止采集。

  • SDK 渲染成功远端视频流首帧后回调
  • SDK 接收并解码远端视频流首帧后回调
  • rtcEngine:onFirstRemoteVideoFrameRendered:info:withFrameInfo:
  • rtcEngine:onFirstRemoteVideoFrameDecoded:info:withFrameInfo:

参数变化:
RemoteStreamKey参数替换成streamId、streamInfo
新增适用场景:
远端用户取消发布视频并再发布视频后,也会收到该这两个回调。
取消发布包括发布端主动取消、主动退房、掉线以及停止采集。

将外部音频参考帧推到sdk内

pushReferenceAudioPCMData:(ByteRTCAudioFrame * _Nonnull) audioFrame;

新增API:自定义音频回声消除参考信号

音画同步

功能

V3.58

V3.60

变更说明

音视频同步状态发生改变回调

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onAVSyncStateChange:(ByteRTCAVSyncState)state

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onAVSyncEvent:(NSString *_Nonnull)roomId userId:(NSString *_Nonnull)userId eventCode:(ByteRTCAVSyncEvent)eventCode

音画同步功能开启后,将通过本回调通知同步结果。新回调中新增了 roomId 和 userId。同时,同步状态 AVSyncState 被替换为同步失败事件 ByteRTCAVSyncEvent,你可以在收到该通知时,调用 setMultiDeviceAVSync: 传入空参数解绑同步关系,并再次调用该接口进行绑定。

  • 接口重命名
  • 参数变更
    • 新增参数:新增了 roomId 和 uid
    • 参数替换:移除state参数,替换为 eventCode(同步失败事件),你可以在收到该通知时,调用 setMultiDeviceAVSync 传入空参数解绑同步关系,并再次调用该接口进行绑定。
  • 行为变更:音视频同步失败
    • 3.58:由以下错误码返回:ByteRTCErrorCodInvalidAudioSyncUidRepeated = -1083
    • 3.60:通过 rtcRoom:onAVSyncEvent:userId:eventCode: 返回ByteRTCAVSyncEventInvalidUidRepeated = 0

音量、音频播放路由、音频场景

功能

V3.58

V3.60

变更说明

调节指定远端用户的音频流在本地设备上的播放音量

setRemoteAudioPlaybackVolume:(NSString *_Nonnull)roomID remoteUid:(NSString *_Nonnull)userID playVolume:(NSInteger)volume

setRemoteAudioPlaybackVolume:(NSString* _Nonnull)streamId volume:(int)volume

  • 参数变更:
    用于指定音频流的参数 roomId 和 uid 改为 streamId。
  • 功能拓展:
    仅支持调节来自指定用户的媒体流音量,升级为支持分别调节本地采集媒体流音量,屏幕流音量,和指定进程音量。

强制切换当前的音频播放路由

setAudioRoute:

setAudioRoute:

限制发生变化:
强制切换当前的音频播放路由,不再限制仅在 AUDIO_SCENARIO_COMMUNICATION 音频场景下使用,只要当前状态为通话模式,即可使用。

设置音频场景类型

setAudioScenario:

setAudioScenario:

音频设备使用的音量模式发生了变更,参看媒体音量和通话音量:

  • 已经通过 setAudioScenario: 设置了音频场景:需要参看上述文档,替换为更新后的音频场景,并关注音量模式的变化情况。
  • 未曾通过 setAudioScenario: 设置音频场景:也需要关注默认音频场景下,同一音频设备的音量模式变化情况。

推送外部视频帧

V3.58

V3.60

变更说明

pushExternalVideoFrame:(ByteRTCVideoFrame * _Nonnull)frame

pushExternalVideoFrame:(ByteRTCVideoFrameData * _Nonnull)frame

参数 frame 类型替换为ByteRTCVideoFrameData。与原参数类型相比,包含参数和是否必填均发生变化。

根据热榜获取每个榜单的歌曲列表

V3.58

V3.60

变更说明

getHotMusic:(ByteRTCMusicHotType)hotType filterType:(ByteRTCMusicFilterType)filterType

getHotMusic:(NSArray <NSString *> *_Nullable)customHotlistId filterType:(ByteRTCMusicFilterType)filterType

参数替换:移除 hotType ,替换为customHotlistId,类型也由枚举改为 NSArray <NSString *> *,用于提供自定义的热门音乐列表 ID。属性值对应如下:

  • ByteRTCMusicHotTypeContentCenter → ContentCenter
  • ByteRTCMusicHotTypeProject → Project

StreamId唯一识别流

当前版本使用 StreamId 唯一标识一路流,因此各个API中以前版本的 StreamIndex / RemoteStreamKey 参数被 StreamId 或相关信息替换,涉及到API如下:

所属类

v3.58

v3.60

变更说明

ByteRTCEngine

muteAudioCapture:(ByteRTCStreamIndex)index mute:(bool)mute

muteAudioCapture: (bool)mute

参数变化: 删除StreamIndex参数

ByteRTCEngine

setCaptureVolume:(ByteRTCStreamIndex)index volume:(int)volume

setCaptureVolume: (int)volume

参数变化: 删除StreamIndex参数

ByteRTCEngine

setLocalVideoCanvas:(ByteRTCStreamIndex)streamIndex withCanvas:(ByteRTCVideoCanvas * Nullable)canvas NS_SWIFT_NAME(setLocalVideoCanvas(:withCanvas:))

setLocalVideoCanvas:(ByteRTCVideoCanvas * _Nullable)canvas NS_SWIFT_NAME(setLocalVideoCanvas(withCanvas:))

参数变化: 删除StreamIndex参数

ByteRTCEngine

updateLocalVideoCanvas:(ByteRTCStreamIndex)streamIndex withRenderMode:(ByteRTCRenderMode)renderMode withBackgroundColor:(NSUInteger)backgroundColor NS_SWIFT_NAME(updateLocalVideoCanvas(_:withRenderMode:withBackgroundColor:))

updateLocalVideoCanvas:(ByteRTCRenderMode)renderMode withBackgroundColor:(NSUInteger)backgroundColor NS_SWIFT_NAME(updateLocalVideoCanvas(withBackgroundColor:))

参数变化: 删除StreamIndex参数

ByteRTCEngine

setRemoteVideoCanvas:(ByteRTCRemoteStreamKey * _Nonnull)key withCanvas:(ByteRTCVideoCanvas * Nullable)canvas NS_SWIFT_NAME(setRemoteVideoCanvas(:withCanvas:))

setRemoteVideoCanvas:(NSString* _Nonnull)streamId withCanvas:(ByteRTCVideoCanvas * Nullable)canvas NS_SWIFT_NAME(setRemoteVideoCanvas(:withCanvas:))

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

updateRemoteStreamVideoCanvas:(ByteRTCRemoteStreamKey * _Nonnull)key withRemoteVideoRenderConfig:(ByteRTCRemoteVideoRenderConfig * Nonnull)remoteVideoRenderConfig NS_SWIFT_NAME(updateRemoteStreamVideoCanvas(:withRemoteVideoRenderConfig:));

updateRemoteStreamVideoCanvas:(NSString* _Nonnull)streamId withRemoteVideoRenderConfig:(ByteRTCRemoteVideoRenderConfig * Nonnull)remoteVideoRenderConfig NS_SWIFT_NAME(updateRemoteStreamVideoCanvas(:withRemoteVideoRenderConfig:));

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

setRemoteVideoSink:(ByteRTCRemoteStreamKey* _Nonnull)streamKey withSink:(idNullable)videoSink withRemoteRenderConfig:(ByteRTCRemoteVideoSinkConfig)config NS_SWIFT_NAME(setRemoteVideoSink(*:withSink:withRemoteRenderConfig:));

setRemoteVideoSink:(NSString* _Nonnull)streamId withSink:(idNullable)videoSink withRemoteRenderConfig:(ByteRTCRemoteVideoSinkConfig)config NS_SWIFT_NAME(setRemoteVideoSink(*:withSink:withRemoteRenderConfig:));

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

setVideoSourceType:(ByteRTCVideoSourceType)type WithStreamIndex:(ByteRTCStreamIndex)streamIndex NS_SWIFT_NAME(setVideoSourceType(_:WithStreamIndex:))

setVideoSourceType:(ByteRTCVideoSourceType)type NS_SWIFT_NAME(setVideoSourceType(_:))

参数变化: 删除StreamIndex参数

ByteRTCEngine

setRemoteVideoMirrorType:(ByteRTCRemoteStreamKey*)key withMirrorType:(ByteRTCRemoteMirrorType)mirrorType

setRemoteVideoMirrorType:(NSString* _Nonnull)streamId withMirrorType:(ByteRTCRemoteMirrorType)mirrorType

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

sendSEIMessage:(ByteRTCStreamIndex)streamIndex andMessage:(NSData* _Nonnull)message andRepeatCount:(int)repeatCount andCountPerFrame:(ByteRTCSEICountPerFrame) mode

sendSEIMessage: (NSData* _Nonnull)message andRepeatCount:(int)repeatCount andCountPerFrame:(ByteRTCSEICountPerFrame) mode

参数变化: 删除StreamIndex参数

ByteRTCEngine

startFileRecording:(ByteRTCStreamIndex)streamIndex withRecordingConfig:(ByteRTCRecordingConfig* Nonnull)recordingConfig type:(ByteRTCRecordingType)recordingType NS_SWIFT_NAME(startFileRecording(:withRecordingConfig:type:))

startFileRecording: (ByteRTCRecordingConfig* _Nonnull)recordingConfig type:(ByteRTCRecordingType)recordingType NS_SWIFT_NAME(startFileRecording(withRecordingConfig:type:))

参数变化: 删除StreamIndex参数

ByteRTCEngine

stopFileRecording:(ByteRTCStreamIndex)streamIndex

stopFileRecording

参数变化: 删除StreamIndex参数

ByteRTCEngine

setRemoteAudioPlaybackVolume:(ByteRTCRemoteStreamKey* _Nonnull)streamKey volume:(int)volume;

setRemoteAudioPlaybackVolume:(NSString* _Nonnull)streamId volume:(int)volume

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

pushExternalEncodedVideoFrame:(ByteRTCStreamIndex)streamIndex withVideoIndex:(NSInteger)videoIndex withEncodedVideoFrame:(ByteRTCEncodedVideoFrame* Nonnull)videoFrame NS_SWIFT_NAME(pushExternalEncodedVideoFrame(:withVideoIndex:withEncodedVideoFrame:))

pushExternalEncodedVideoFrame: (NSInteger)videoIndex withEncodedVideoFrame:(ByteRTCEncodedVideoFrame* _Nonnull)videoFrame NS_SWIFT_NAME(pushExternalEncodedVideoFrame(withVideoIndex:withEncodedVideoFrame:))

参数变化: 将StreamIndex变为videoIndex

ByteRTCEngine

setVideoDecoderConfig:(ByteRTCRemoteStreamKey * Nonnull)key withVideoDecoderConfig:(ByteRTCVideoDecoderConfig)config NS_SWIFT_NAME(setVideoDecoderConfig(:withVideoDecoderConfig:))

setVideoDecoderConfig:(NSString* Nonnull)streamId withVideoDecoderConfig:(ByteRTCVideoDecoderConfig)config NS_SWIFT_NAME(setVideoDecoderConfig(:withVideoDecoderConfig:))

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

requestRemoteVideoKeyFrame:(ByteRTCRemoteStreamKey * _Nonnull)key

requestRemoteVideoKeyFrame:(NSString* _Nonnull)streamId

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngine

setVideoWatermark:(ByteRTCStreamIndex)streamIndex withImagePath:(NSString * _Nullable)imagePath withRtcWatermarkConfig:(ByteRTCVideoWatermarkConfig* _Nonnull)rtcWatermarkConfig

setVideoWatermark: (NSString * _Nullable)imagePath withRtcWatermarkConfig:(ByteRTCVideoWatermarkConfig* _Nonnull)rtcWatermarkConfig

参数变化: 删除StreamIndex参数

ByteRTCEngine

clearVideoWatermark:(ByteRTCStreamIndex)streamIndex NS_SWIFT_NAME(clearVideoWatermark(_:))

clearVideoWatermark

参数变化: 删除StreamIndex参数

ByteRTCEngine

takeLocalSnapshot:(ByteRTCStreamIndex)streamIndex callback:(id_Nullable)callback

takeLocalSnapshot:(id_Nullable)callback

参数变化: 删除StreamIndex参数

ByteRTCEngine

takeRemoteSnapshot:(ByteRTCRemoteStreamKey* _Nonnull)streamKey callback:(id_Nullable)callback

takeRemoteSnapshot:(NSString* _Nonnull)streamId callback:(id_Nullable)callback

参数变化: 将RemoteStreamKey变为streamId

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStartVideoCapture:(NSString * _Nonnull)roomId uid:(NSString * _Nonnull)uid

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStartVideoCapture:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info

参数变化: 将roomId和userId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStopVideoCapture:(NSString * _Nonnull)roomId uid:(NSString * _Nonnull)uid

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStopVideoCapture:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info

参数变化: 将roomId和userId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStartAudioCapture:(NSString* _Nonnull)roomId uid:(NSString *_Nonnull)userId

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStartAudioCapture:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info

参数变化: 将roomId和userId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStopAudioCapture:(NSString* _Nonnull)roomId uid:(NSString *_Nonnull)userId

rtcEngine:(ByteRTCEngine * _Nonnull)engine onUserStopAudioCapture:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info·

参数变化: 将roomId和userId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onLocalAudioStateChanged:(ByteRTCLocalAudioStreamState)state error:(ByteRTCLocalAudioStreamError)error

rtcEngine:(ByteRTCEngine *_Nonnull)engine onLocalAudioStateChanged:(NSString *_Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info state:(ByteRTCLocalAudioStreamState)state error:(ByteRTCLocalAudioStreamError)error

参数变化: 添加streamId和streamInfo参数

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine **Nonnull)engine onLocalVideoStateChanged:(ByteRTCStreamIndex)streamIndex withStreamState:(ByteRTCLocalVideoStreamState)state withStreamError:(ByteRTCLocalVideoStreamError)error NS_SWIFT_NAME(rtcEngine(*:onLocalVideoStateChanged:withStreamState:withStreamError:))

rtcEngine:(ByteRTCEngine *_Nonnull)engine onLocalVideoStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo **Nonnull)info withStreamState:(ByteRTCLocalVideoStreamState)state withStreamError:(ByteRTCLocalVideoStreamError)error NS_SWIFT_NAME(rtcEngine(:onLocalVideoStateChanged:info:withStreamState:withStreamError:))

参数变化: 将streamIndex变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onRemoteAudioStateChanged:(ByteRTCRemoteStreamKey * _Nonnull)key state:(ByteRTCRemoteAudioState)state reason:(ByteRTCRemoteAudioStateChangeReason)reason

rtcEngine:(ByteRTCEngine *_Nonnull)engine onRemoteAudioStateChanged:(NSString *_Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info state:(ByteRTCRemoteAudioState)state reason:(ByteRTCRemoteAudioStateChangeReason)reason

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine _Nonnull)engine onRemoteVideoStateChanged:(ByteRTCRemoteStreamKeyNonnull)streamKey withVideoState:(ByteRTCRemoteVideoState)state withVideoStateReason:(ByteRTCRemoteVideoStateChangeReason)reason NS_SWIFT_NAME(rtcEngine(:onRemoteVideoStateChanged:withVideoState:withVideoStateReason:))

rtcEngine:(ByteRTCEngine *_Nonnull)engine onRemoteVideoStateChanged:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo **Nonnull)info withVideoState:(ByteRTCRemoteVideoState)state withVideoStateReason:(ByteRTCRemoteVideoStateChangeReason)reason NS_SWIFT_NAME(rtcEngine(:onRemoteVideoStateChanged:withVideoState:withVideoStateReason:))

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onFirstLocalVideoFrameCaptured:(ByteRTCStreamIndex)streamIndex withFrameInfo:(ByteRTCVideoFrameInfo * Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onFirstLocalVideoFrameCaptured:withFrameInfo:))

rtcEngine:(ByteRTCEngine * _Nonnull)engine onFirstLocalVideoFrameCaptured:(ByteRTCVideoSource* _Nullable)videoSource withFrameInfo:(ByteRTCVideoFrameInfo * Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onFirstLocalVideoFrameCaptured:withFrameInfo:))

参数变化: 将streamIndex变为VideoSource

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine _Nonnull)engine onLocalVideoSizeChanged:(ByteRTCStreamIndex)streamIndex withFrameInfo:(ByteRTCVideoFrameInfo **Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onLocalVideoSizeChanged:withFrameInfo:))

rtcEngine:(ByteRTCEngine *_Nonnull)engine onLocalVideoSizeChanged:(ByteRTCVideoSource _Nullable)videoSource withFrameInfo:(ByteRTCVideoFrameInfo **Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onLocalVideoSizeChanged:withFrameInfo:))

参数变化: 将streamIndex变为VideoSource

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onRemoteVideoSizeChanged:(ByteRTCRemoteStreamKey _Nonnull)streamKey withFrameInfo:(ByteRTCVideoFrameInfo **Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onRemoteVideoSizeChanged:withFrameInfo:))

rtcEngine:(ByteRTCEngine *_Nonnull)engine onRemoteVideoSizeChanged:(NSString *_Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info withFrameInfo:(ByteRTCVideoFrameInfo **Nonnull)frameInfo NS_SWIFT_NAME(rtcEngine(:onRemoteVideoSizeChanged:withFrameInfo:))

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onFirstLocalAudioFrame:(ByteRTCStreamIndex) streamIndex

rtcEngine:(ByteRTCEngine * _Nonnull)engine onFirstLocalAudioFrame:(ByteRTCAudioSource* _Nullable)audioSource

参数变化: 将streamIndex变为AudioSource

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onSEIMessageReceived:(ByteRTCRemoteStreamKey* _Nonnull)remoteStreamKey andMessage:(NSData* _Nonnull)message

rtcEngine:(ByteRTCEngine * _Nonnull)engine onSEIMessageReceived:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info andMessage:(NSData* _Nonnull)message

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onSEIStreamUpdate:(ByteRTCRemoteStreamKey* _Nonnull)remoteStreamKey eventType:(ByteRTCSEIStreamEventType)eventType

rtcEngine:(ByteRTCEngine * _Nonnull)engine onSEIStreamUpdate:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info eventType:(ByteRTCSEIStreamEventType)eventType

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine* _Nonnull)engine onRecordingStateUpdate:(ByteRTCStreamIndex)type state:(ByteRTCRecordingState)state error_code:(ByteRTCRecordingErrorCode)errorCode recording_info:(ByteRTCRecordingInfo* _Nonnull)recordingInfo

rtcEngine:(ByteRTCEngine* _Nonnull)engine onRecordingStateUpdate:(ByteRTCVideoSource* _Nullable)videoSource state:(ByteRTCRecordingState)state error_code:(ByteRTCRecordingErrorCode)errorCode recording_info:(ByteRTCRecordingInfo* _Nonnull)recordingInfo

参数变化: 将streamIndex变为VideoSource

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine* _Nonnull)engine onRecordingProgressUpdate:(ByteRTCStreamIndex)type process:(ByteRTCRecordingProgress* _Nonnull)process recording_info:(ByteRTCRecordingInfo* _Nonnull)recordingInfo

rtcEngine:(ByteRTCEngine* _Nonnull)engine onRecordingProgressUpdate:(ByteRTCVideoSource* _Nullable)videoSource process:(ByteRTCRecordingProgress* _Nonnull)process recording_info:(ByteRTCRecordingInfo* _Nonnull)recordingInfo

参数变化: 将streamIndex变为VideoSource

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine * _Nonnull)engine onStreamSyncInfoReceived:(ByteRTCRemoteStreamKey* _Nonnull)remoteStreamKey streamType:(ByteRTCSyncInfoStreamType)streamType data:(NSData* _Nonnull)data

rtcEngine:(ByteRTCEngine * _Nonnull)engine onStreamSyncInfoReceived:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info streamType:(ByteRTCSyncInfoStreamType)streamType data:(NSData* _Nonnull)data

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onAudioFrameSendStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state

rtcEngine:(ByteRTCEngine *_Nonnull)engine onAudioFrameSendStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state

参数变化: 将roomId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onVideoFrameSendStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state

rtcEngine:(ByteRTCEngine *_Nonnull)engine onVideoFrameSendStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFrameSendState)state;

参数变化: 将roomId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onAudioFramePlayStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state

rtcEngine:(ByteRTCEngine *_Nonnull)engine onAudioFramePlayStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state

参数变化: 将roomId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onVideoFramePlayStateChanged:(NSString * _Nonnull)roomId rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state

rtcEngine:(ByteRTCEngine *_Nonnull)engine onVideoFramePlayStateChanged:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo *_Nonnull)info rtcUser:(ByteRTCUser *_Nonnull)user state:(ByteRTCFirstFramePlayState)state

参数变化: 将roomId改为streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onSimulcastSubscribeFallback:(ByteRTCRemoteStreamSwitchEvent *_Nonnull)event

rtcEngine:(ByteRTCEngine *_Nonnull)engine onSimulcastSubscribeFallback:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info event:(ByteRTCRemoteStreamSwitchEvent *_Nonnull)event

参数变化: 添加参数streamId和streamInfo

ByteRTCEngineDelegate

rtcEngine:(ByteRTCEngine *_Nonnull)engine onPerformanceAlarms:(ByteRTCPerformanceAlarmMode)mode roomId:(NSString *_Nonnull)roomId reason:(ByteRTCPerformanceAlarmReason)reason sourceWantedData:(ByteRTCSourceWantedData *_Nonnull)data

rtcEngine:(ByteRTCEngine *_Nonnull)engine onPerformanceAlarms:(NSString _Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info mode:(ByteRTCPerformanceAlarmMode)mode reason:(ByteRTCPerformanceAlarmReason)reason sourceWantedData:(ByteRTCSourceWantedData *_Nonnull)data

参数变化: 添加参数streamId和streamInfo

ByteRTCRoomDelegate

rtcRoom:( ByteRTCRoom _Nonnull)rtcRoom onLocalStreamStats:(ByteRTCLocalStreamStats **Nonnull)stats NS_SWIFT_NAME(rtcRoom(:onLocalStreamStats:))

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onLocalStreamStats:(NSString *_Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info stats:(ByteRTCLocalStreamStats **Nonnull)stats NS_SWIFT_NAME(rtcRoom(:onLocalStreamStats:))

参数变化: 添加参数streamId和streamInfo

ByteRTCRoomDelegate

rtcRoom:( ByteRTCRoom _Nonnull)rtcRoom onRemoteStreamStats:(ByteRTCRemoteStreamStats **Nonnull)stats NS_SWIFT_NAME(rtcRoom(:onRemoteStreamStats:))

rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRemoteStreamStats:(NSString *_Nonnull)streamId info:(ByteRTCStreamInfo _Nonnull)info stats:(ByteRTCRemoteStreamStats **Nonnull)stats NS_SWIFT_NAME(rtcRoom(:onRemoteStreamStats:))

参数变化: 添加参数streamId和streamInfo

LocalEncodedVideoFrameObserverObjC : ILocalEncodedVideoFrameObserver

onLocalEncodedVideoFrame:(ByteRTCStreamIndex) streamIndex Frame:(ByteRTCEncodedVideoFrame * _Null_unspecified)frame

onLocalEncodedVideoFrame:(ByteRTCVideoSource* _Nullable)videoSource Frame:(ByteRTCEncodedVideoFrame * _Null_unspecified)frame

参数变化: 将streamIndex变为VideoSource

RemoteEncodedVideoFrameObserverObjC : IRemoteEncodedVideoFrameObserver

onRemoteEncodedVideoFrame:(ByteRTCRemoteStreamKey * _Nonnull)streamKey withEncodedVideoFrame:(ByteRTCEncodedVideoFrame* _Nonnull)videoFrame

onRemoteEncodedVideoFrame:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info withEncodedVideoFrame:(ByteRTCEncodedVideoFrame* _Nonnull)videoFrame

参数变化: 将RemoteStreamKey变为streamId和streamInfo

SnapshotResultObjC : ISnapshotResultCallback

onTakeLocalSnapshotResult:(NSInteger) taskId streamIndex:(ByteRTCStreamIndex)streamIndex image:(ByteRTCImage * _Nullable)image errorCode:(NSInteger)errorCode

onTakeLocalSnapshotResult:(NSInteger) taskId videoSource:(ByteRTCVideoSource * _Nullable)videoSource image:(ByteRTCImage * _Nullable)image errorCode:(NSInteger)errorCode

参数变化: 将streamIndex变为VideoSource

SnapshotResultObjC : ISnapshotResultCallback

onTakeRemoteSnapshotResult:(NSInteger)taskId streamKey:(ByteRTCRemoteStreamKey * _Nonnull)streamKey image:(ByteRTCImage * _Nullable)image errorCode:(NSInteger)errorCode

onTakeRemoteSnapshotResult:(NSInteger)taskId streamId:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info image:(ByteRTCImage * _Nullable)image errorCode:(NSInteger)errorCode

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRTCAudioFrameObserver : IAudioFrameObserver

onRemoteUserAudioFrame:(ByteRTCRemoteStreamKey * _Nonnull)streamKey audioFrame:(ByteRTCAudioFrame * _Nonnull)audioFrame

onRemoteUserAudioFrame:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo * _Nonnull)info audioFrame:(ByteRTCAudioFrame * _Nonnull)audioFrame

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ByteRtcAudioFrameProcessorOCC : IAudioFrameProcessor

onProcessRemoteUserAudioFrame:(ByteRTCRemoteStreamKey * _Nonnull)streamKey audioFrame:(ByteRTCAudioFrame * _Nonnull)audioFrame

onProcessRemoteUserAudioFrame:(NSString * _Nonnull)streamId info:(ByteRTCStreamInfo * _Nonnull)info audioFrame:(ByteRTCAudioFrame * _Nonnull)audioFrame

参数变化: 将RemoteStreamKey变为streamId和streamInfo

ExternalVideoEncoderEventHandlerObjC : IExternalVideoEncoderEventHandler

onStart:(ByteRTCStreamIndex)streamIndex

onStart:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info

参数变化: 将streamIndex变为streamId和streamInfo

ExternalVideoEncoderEventHandlerObjC : IExternalVideoEncoderEventHandler

onStop:(ByteRTCStreamIndex)streamIndex

onStop:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info

参数变化: 将streamIndex变为streamId和streamInfo

ExternalVideoEncoderEventHandlerObjC : IExternalVideoEncoderEventHandler

onRateUpdate:(ByteRTCStreamIndex)streamIndex withVideoIndex:(NSInteger)videoIndex withFps:(NSInteger)fps withBitRate:(NSInteger)bitRateKps

onRateUpdate:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info withVideoIndex:(NSInteger)videoIndex withFps:(NSInteger)fps withBitRate:(NSInteger)bitRateKps

参数变化: 将streamIndex变为streamId和streamInfo

ExternalVideoEncoderEventHandlerObjC : IExternalVideoEncoderEventHandler

onRequestKeyFrame:(ByteRTCStreamIndex)streamIndex withVideoIndex:(NSInteger)videoIndex

onRequestKeyFrame:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info withVideoIndex:(NSInteger)videoIndex

参数变化: 将streamIndex变为streamId和streamInfo

ExternalVideoEncoderEventHandlerObjC : IExternalVideoEncoderEventHandler

onActiveVideoLayer:(ByteRTCStreamIndex)streamIndex withVideoIndex:(NSInteger)videoIndex withActive:(BOOL)active

onActiveVideoLayer:(NSString*)streamId info:(ByteRTCStreamInfo * _Nonnull)info withVideoIndex:(NSInteger)videoIndex withActive:(BOOL)active

参数变化: 将streamIndex变为streamId和streamInfo

类型变更

房间模式

改动的数据类型

V3.58

V3.60

变更说明

ByteRTCRoomProfile

  • ByteRTCRoomProfileChat = 5
  • ByteRTCRoomProfileLwTogether = 7

ByteRTCRoomProfileCall = 19

更注重流畅性,视频缺省码率相对低,对音质要求低,流畅性要求高。

  • ByteRTCRoomProfileGameHD = 8
  • ByteRTCRoomProfileCoHost = 9
  • ByteRTCRoomProfileKTV = 11
  • ByteRTCRoomProfileVRChat = 13
  • ByteRTCRoomProfileLanLiveStreaming = 15
  • ByteRTCRoomProfileLiveBroadcasting = 1

ByteRTCRoomProfileLive = 20

更注重画质,视频缺省码率相对高,对音质要求高。

视频帧相关

功能

V3.58

V3.60

变更说明

视频帧数据

ByteRTCVideoFrame

ByteRTCVideoFrameData

  1. 类型重命名
  2. 参数变更:
  • 删除 supplementaryInfo
  • 删除 colorSpace
  • time 变更为 timestamp
  • planeDatas 变更为 planeDataArray
  • planeStrides 变更为 planeStrideArray
  • extendedData 变更为 seiData
  • 新增 bufferType
  • 新增 format
  • 新增 addRef
  • 新增 releaseRef

远端视频帧回调位置

ByteRTCRemoteVideoRenderPosition

ByteRTCRemoteVideoSinkPosition

类型重命名

是否将视频帧镜像

ByteRTCVideoRenderMirrorType

ByteRTCVideoSinkMirrorType

类型重命名

合流转推事件

  • 名称替换:ByteRTCStreamMixingEvent 变更为 ByteRTCMixedStreamTaskEvent,和 WTN 流任务共用同一个事件枚举类。
  • 枚举值变更如下:

描述

V3.58

V3.60

请求发起任务
推流成功

ByteRTCStreamMixingEventStart = 1
ByteRTCStreamMixingEventStartSuccess = 2

ByteRTCMixedStreamTaskEventStartSuccess = 1

任务发起失败

ByteRTCStreamMixingEventStartFailed= 3

ByteRTCMixedStreamTaskEventStartFailed = 2
具体失败原因参看ByteRTCMixedStreamTaskErrorCode

请求更新
任务更新成功

ByteRTCStreamMixingEventUpdate = 4
ByteRTCStreamMixingEventUpdateSuccess = 5

ByteRTCMixedStreamTaskEventUpdateSuccess = 3

任务更新失败

ByteRTCStreamMixingEventUpdateFailed = 6

ByteRTCMixedStreamTaskEventUpdateFailed = 4
具体失败原因参看ByteRTCMixedStreamTaskErrorCode

请求结束任务
任务结束成功

ByteRTCStreamMixingEventStop = 7
ByteRTCStreamMixingEventStopSuccess = 8

ByteRTCMixedStreamTaskEventStopSuccess = 5

任务结束失败

ByteRTCStreamMixingEventStopFailed = 9

ByteRTCMixedStreamTaskEventStopFailed = 6
具体失败原因参看ByteRTCMixedStreamTaskErrorCode

参数错误

ByteRTCStreamMixingEventRequestParamError = 15

调用 startPushMixedStream:withPushTargetConfig:withMixedConfig: 或 updatePushMixedStream:withPushTargetConfig:withMixedConfig: 时返回 ByteRTCReturnStatusParameterErr = -2

任务处理超时,请检查网络状态并重试超时

ByteRTCStreamMixingEventUpdateTimeout = 13
ByteRTCStreamMixingEventStartTimeout = 14

startPushMixedStream:withPushTargetConfig:withMixedConfig: 或 updatePushMixedStream:withPushTargetConfig:withMixedConfig: 时返回ByteRTCMixedStreamTaskErrorCodeTimeout = 1091

合流加图片

ByteRTCStreamMixingEventMixImage = 16

ByteRTCMixedStreamTaskEventWarning = 7

Warning 事件

无

ByteRTCMixedStreamTaskEventWarning = 7

其他

ByteRTCStreamMixingEventChangeMixType = 10
ByteRTCStreamMixingEventFirstAudioFrameByClientMixer = 11
ByteRTCStreamMixingEventFirstVideoFrameByClientMixer = 12

移除

单流转推任务事件

  • 名称变化:由 ByteRTCSingleStreamPushEvent 变更为 ByteRTCSingleStreamTaskEvent。
  • 具体枚举值变化如下

描述

V3.58

V3.60

开始推流

ByteRTCSingleStreamPushEventStart = 1

ByteRTCSingleStreamTaskEventStartSuccess = 1

推流成功

ByteRTCSingleStreamPushEventStartSuccess = 2

ByteRTCSingleStreamTaskEventStartSuccess = 1

推流失败

ByteRTCSingleStreamPushEventStartFailed = 3

ByteRTCSingleStreamTaskEventStartFailed = 2

停止推流

ByteRTCSingleStreamPushEventStop = 4

ByteRTCSingleStreamTaskEventStopSuccess = 3

单流转推直播任务处理超时,请检查网络状态并重试

ByteRTCSingleStreamPushEventTimeout = 5

ByteRTCSingleStreamTaskEventWarning = 5,具体错误信息参看 ByteRTCSingleStreamTaskErrorCode。

参数错误

ByteRTCSingleStreamPushEventParamError = 6

调用 startPushSingleStream:singleStream: 时返回 ByteRTCReturnStatusParameterErr = -2。

停止推流失败

无

ByteRTCSingleStreamTaskEventStopFailed = 4

音视频流统计信息

功能

改动的数据类型

变更说明

本地音频流统计信息

ByteRTCLocalAudioStats

增加字段 audioDeviceLoopDelay(音频采集播放延时)、encodeFrameRate(音频编码帧率)

远端音频流统计信息

ByteRTCRemoteAudioStats

增加字段 decodeFrameRate(音频解码帧率)

远端视频流统计信息

ByteRTCRemoteVideoStats

增加字段 capToRenderDelay(从发送端开始采集到接收端渲染完成的延时)、avSyncDiffMs(音画同步差异)、codecElapsePerFrame(视频解码平均耗时)

其他

功能

名称

变更说明

发布状态变化原因

ByteRTCPublishStateChangeReason

新增类

截图错误码

ByteRTCSnapshotErrorCode

新增枚举
截图成功(0、ByteRTCSnapshotErrorCodeOk)
截图错误。生成图片数据失败或 RGBA 编码失败(-1、ByteRTCSnapshotErrorCodeCreateFail)
截图错误。流无效(-2、ByteRTCSnapshotErrorCodeStreamInvalid)
截图错误。截图超时,超时时间 1 秒(-3、ByteRTCSnapshotErrorCodeTimeout)
截图错误。图片保存失败(-4、ByteRTCSnapshotErrorCodeFileSaveError)

音频场景类型

ByteRTCAudioScenarioType

枚举值增加
教育场景。适用于以人声教学内容为主的高音质场景(4、ByteRTCAudioScenarioTypeEducation)
AI 对话场景(5、ByteRTCAudioScenarioTypeAiClient)

耳返功能的 Audio Filter 类型

ByteRTCEarMonitorAudioFilter

新增枚举
没有 Audio Filter(默认设置)(0x0001、ByteRTCEarMonitorAudioFilterNone)
耳返复用 3A 处理(0x8000、ByteRTCEarMonitorAudioFilterReuseAudioProcessing)

单流转推直播错误码

ByteRTCSingleStreamTaskErrorCode

枚举值增加
服务端检测任务参数不合法(1093、ByteRTCSingleStreamTaskErrorCodeInvalidParamByServer)
转推任务在目标房间的用户ID被踢出目标房间(1094、ByteRTCSingleStreamTaskErrorCodeRemoteKicked)
转推任务加入目标房间失败(1095、ByteRTCSingleStreamTaskErrorCodeJoinDestRoomFailed)
转推任务在源房间拉流超时(1096、ByteRTCSingleStreamTaskErrorCodeReceiveSrcStreamTimeout)
音视频编码转推任务不支持(1097、ByteRTCSingleStreamTaskErrorCodeNotSurportCodec)

单流转推配置目标房间信息

DestInfo

新增类

单流转推类型

ByteRTCSingleStreamPushType

枚举增加
单流转推到CDN(1、ByteRTCSingleStreamPushToCDN)
单流转推到RTC房间(2、ByteRTCSingleStreamPushToRTC)

单流转推直播配置参数

ByteRTCPushSingleStreamParam

成员增加
单流转推直播配置参数中增加:单流转推配置目标房间信息列表(destInfo)、转推类型(pushType)二个成员

镜像类型

ByteRTCMirrorType

枚举值增加
本地预览时无镜像效果,仅编码传输时有镜像效果(2、ByteRTCMirrorTypeEncoder)

错误码变更

回调告警 - WarningCode

V3.58

V3.60

ByteRTCWarningCodeOldRoomBeenReplaced = -2016

移除:
使用相同 roomId 再次创建房间时,将返回上次创建的房间实例,不再触发此错误码。

WTN 流(原公共流)

  • 错误码名称变更:ByteRTCPublicStreamErrorCode 变更为 ByteRTCMixedStreamTaskErrorCode,和合流转推任务共用同一个枚举类。
  • 具体错误码的变更详情如下:

描述

V3.58

V3.60

成功

ByteRTCPublicStreamErrorCodeSuccess = 0

ByteRTCMixedStreamTaskErrorCodeOK = 0

服务端参数检验失败

ByteRTCPublicStreamErrorCodePushParamError = 1191

删除,不会回调此类错误。

服务端内部错误

ByteRTCPublicStreamErrorCodePushStatusError = 1192 删除,不会回调此类错误。

ByteRTCMixedStreamTaskErrorCodeInvalidStateByServer = 1094

服务端未知错误

ByteRTCPublicStreamErrorCodePushInternalError = 1193 删除,不会回调此类错误。

ByteRTCMixedStreamTaskErrorCodeUnKnownErrorByServer = 1096

任务失败

ByteRTCPublicStreamErrorCodePushError = 1195

ByteRTCMixedStreamTaskErrorCodePushWTNFailed = 1195

任务超时

ByteRTCPublicStreamErrorCodePushTimeOut = 1196

ByteRTCMixedStreamTaskErrorCodeTimeOut = 1091

流订阅超时

ByteRTCPublicStreamErrorCodePullNoPushStream = 1300

ByteRTCWTNSubscribeStateChangeReason.ByteRTCWTNSubscribeStateChangeReasonUnsubscribe = 1300,通过onWTNVideoSubscribeStateChanged:state:reason: 或onWTNAudioSubscribeStateChanged:state:reason: 返回。

合流转推错误码

  • 错误码名称变更:ByteRtcTranscoderErrorCode 变更为 ByteRTCMixedStreamTaskErrorCode,和 WTN 流任务共用同一个枚举类。
  • 具体错误码的变更详情如下:

描述

V3.58

V3.60

推流成功

ByteRtcTranscoderErrorCodeOK = 0

ByteRTCMixedStreamTaskErrorCodeOK = 0

未定义的合流错误

ByteRtcTranscoderErrorCodeBase = 1090

无,该错误码未启用。

客户端 SDK 检测到无效推流参数

ByteRtcTranscoderErrorCodeInvalidParam = 1091

调用 startPushMixedStream:withPushTargetConfig:withMixedConfig: 或 updatePushMixedStream:withPushTargetConfig:withMixedConfig: 时返回 ByteRTCReturnStatusParameterErr = -2。

状态错误,需要在状态机正常状态下发起操作

ByteRtcTranscoderErrorCodeInvalidState = 1092

ByteRTCMixedStreamTaskErrorCodeInvalidStateByServer = 1094

无效操作

ByteRtcTranscoderErrorCodeInvalidOperator = 1093

ByteRTCMixedStreamTaskErrorCodeInvalidStateByServer = 1094

转推直播任务处理超时,请检查网络状态并重试

ByteRtcTranscoderErrorCodeTimeOut = 1094

ByteRTCMixedStreamTaskErrorCodeTimeOut = 1091

服务端检测到错误的推流参数

ByteRtcTranscoderErrorCodeInvalidParamByServer = 1095

ByteRTCMixedStreamTaskErrorCodeInvalidParamByServer = 1092

对流的订阅超时

ByteRtcTranscoderErrorCodeSubTimeoutByServer = 1096

ByteRTCMixedStreamTaskErrorCodeSubTimeoutByServer = 1093

合流服务端内部错误

ByteRtcTranscoderErrorCodeInvalidStateByServer = 1097

ByteRTCMixedStreamTaskErrorCodeInvalidStateByServer = 1094

合流服务端推 CDN 失败

ByteRtcTranscoderErrorCodeAuthenticationByCDN = 1098

ByteRTCMixedStreamTaskErrorCodeAuthenticationByCDN = 1095

服务端接收信令超时,请检查网络状态并重试。

ByteRtcTranscoderErrorCodeTimeoutBySignaling = 1099

ByteRTCMixedStreamTaskErrorCodeSignalRequestTimeout = 1097

图片合流失败

ByteRtcTranscoderErrorCodeMixImageFail = 1100

ByteRTCMixedStreamTaskErrorCodeMixImageFailed = 1098

服务端未知错误

ByteRtcTranscoderErrorCodeUnKnownErrorByServer = 1101

ByteRTCMixedStreamTaskErrorCodeUnKnownErrorByServer = 1096

单流转推错误码

  • 错误码替换:由 ByteRTCTranscoderErrorCode 替换为 ByteRTCSingleStreamTaskErrorCode。
  • 具体错误码的变更和对应详情如下:

描述

V3.58

V3.60

推流成功

TRANSCODER_ERROR_OK = 0

ByteRTCMixedStreamTaskErrorCodeOK = 0

未定义的合流错误

TRANSCODER_ERROR_BASE = 1090

无,该错误码未启用。

客户端 SDK 检测到无效推流参数

TRANSCODER_ERROR_INVALID_PARAM = 1091

调用 startPushSingleStream:singleStream: 时返回 ByteRTCReturnStatusParameterErr = -2。

状态错误,需要在状态机正常状态下发起操作

TRANSCODER_ERROR_INVALID_STATE = 1092

无,单流任务不会触发该错误码。

无效操作

TRANSCODER_ERROR_INVALID_OPERATOR = 1093

无,单流任务不会触发该错误码。

转推直播任务处理超时,请检查网络状态并重试

TRANSCODER_ERROR_TIMEOUT = 1094

无,单流任务不会触发该错误码。

服务端检测到错误的推流参数

TRANSCODER_ERROR_INVALID_PARAM_BY_SERVER = 1095

无,单流任务不会触发该错误码。

对流的订阅超时

TRANSCODER_ERROR_SUB_TIMEOUT_BY_SERVER = 1096

无,单流任务不会触发该错误码。

合流服务端内部错误

TRANSCODER_ERROR_INVALID_STATE_BY_SERVER = 1097

无,单流任务不会触发该错误码。

合流服务端推 CDN 失败

TRANSCODER_ERROR_AUTHENTICATION_BY_CDN = 1098

无,单流任务不会触发该错误码。

服务端接收信令超时,请检查网络状态并重试

TRANSCODER_ERROR_TIMEOUT_BY_SIGNALING = 1099

ByteRTCSingleStreamTaskErrorCodeSignalRequestTimeout = 1092

图片合流失败

TRANSCODER_ERROR_MIX_IMAGE_FAIL = 1100

无,单流任务不会触发该错误码。

服务端未知错误

TRANSCODER_ERROR_UNKNOW_ERROR_BY_SERVER = 1101

ByteRTCSingleStreamTaskErrorCodeUnknownByServer = 1091

其他错误码

删除了部分已废弃多个版本的错误码

描述

错误码

将自身可见性设置为 false 后,再尝试发布流会触发此警告。

ByteRTCWarningCodePublishStreamForbiden = -2010

自动订阅模式未关闭时,尝试开启手动订阅模式会触发此警告。

ByteRTCWarningCodeGetRoomFailed = -2000

新增接口

接口

功能说明

createRTSRoom:

创建RTS房间

pushReferenceAudioPCMData:

将外部音频参考帧推到sdk内

getCallId

获取通话 ID。该方法需要在加入房间后调用

onRemoteEncodedAudioFrame:info:audioFrame:

调用 RegisterRemoteEncodedAudioFrameObserver 后,SDK 收到远端音频帧信息时,回调该事件

takeLocalSnapshotToFile:

截取本地视频流画面,生成 JPG 文件,并保存到本地指定路径。

takeRemoteSnapshotToFile:filePath:

截取远端的视频流画面,生成 JPG 文件,并保存到本地指定路径。

rtcEngine:onLocalSnapshotTakenToFile:filePath:width:height:errorCode:taskId:

用 takeSnapshotToFile:filePath: 截取视频画面时,会收到此回调报告截图是否成功,以及截取的图片信息。

rtcEngine:onRemoteSnapshotTakenToFile:info:filePath:width:height:errorCode:taskId:

用 takeSnapshotToFile:filePath: 截取视频画面时,会收到此回调报告截图是否成功,以及截取的图片信息。

setEarMonitorMode:filter:

耳返支持复用自定义处理后的本地采集音频

setWTNStreamDelegate:

设置 WTN 流回调接口

rtcRoom:onRoomEvent:uid:state:info:

房间事件回调,并新增枚举 ByteRTCRoomEventInfo

setStreamExtraInfo:

设置当前推流的流附加信息

rtcRoom:onRoomStreamExtraInfoUpdate:info:extraInfo:

接收同一房间内,其他用户调用 setStreamExtraInfo 设置的流附加信息的回调。

createGameRoom

创建游戏房间

ByteRTCGameRoom.destroy

销毁游戏房间

ByteRTCGameRoom.setRTCGameRoomDelegate:

设置 GameRTCRoom 事件的代理对象
ByteRTCGameRoomDelegate的句柄,监听此对象对应的回调事件。

ByteRTCGameRoom.joinRoom:

加入游戏房间

ByteRTCGameRoom.leaveRoom

离开游戏房间

ByteRTCGameRoom.getRangeAudio

新增

ByteRTCGameRoom.updateToken:

更新 Token

ByteRTCGameRoom.enableMicrophone:

开启或关闭麦克风

ByteRTCGameRoom.enableSpeakerphone:

开启或关闭扬声器

ByteRTCGameRoom.enableAudioSend:

发送或取消发送音频流

ByteRTCGameRoom.enableAudioReceive:

是否接收指定用户的音频流

ByteRTCGameRoom.setRemoteRoomAudioPlaybackVolume:

调节某个房间内所有远端用户的音频播放音量。

删除/废弃接口

删除了已废弃或不推荐使用的方法,具体如下:

功能

已删除/废弃接口

替代接口

废弃

  • (int)setLocalVideoSink:(ByteRTCStreamIndex)index withSink:(idNullable)videoSink withPixelFormat:(ByteRTCVideoSinkPixelFormat)requiredFormat NS_SWIFT_NAME(setLocalVideoSink(:withSink:withPixelFormat:));
  • (int)setLocalVideoSink:(id_Nullable)videoSink withPixelFormat:(ByteRTCVideoSinkPixelFormat)requiredFormat NS_SWIFT_NAME(setLocalVideoSink(withSink:withPixelFormat:))

废弃

  • (int)setRemoteVideoSink:(ByteRTCRemoteStreamKey* _Nonnull)streamKey withSink:(idNullable)videoSink withPixelFormat:(ByteRTCVideoSinkPixelFormat)requiredFormat NS_SWIFT_NAME(setRemoteVideoSink(:withSink:withPixelFormat:))
  • (int)setRemoteVideoSink:(NSString* _Nonnull)streamId withSink:(idNullable)videoSink withPixelFormat:(ByteRTCVideoSinkPixelFormat)requiredFormat NS_SWIFT_NAME(setRemoteVideoSink(:withSink:withPixelFormat:))

删除

(RTCVideo * _Nullable) createRTCVideo:(NSString * _Nonnull)appId delegate:(id_Nullable)delegate parameters:(NSDictionary * _Nonnull)parameters

(ByteRTCEngine * _Nullable) createRTCEngine:(ByteRTCEngineConfig * _Nonnull) config delegate:(id_Nullable)delegate

删除

getErrorDescription:

无替代接口

删除

startASR:handler:
stopASR

无替代接口
如果需要使用 ASR 功能,可以通过实时字幕功能相关接口实现:startSubtitle:、stopSubtitle

删除

onSuccessonMessage:rtcEngine:
onError:

如果需要使用 ASR 功能,可以通过实时字幕功能相关接口实现。rtcRoom:onSubtitleStateChanged:errorCode:errorMessage:
rtcRoom:onSubtitleMessageReceived:

删除

  • (void)setDeviceId:(NSString* _Nonnull) deviceID

无替代接口

删除

-(int)setAudioPlaybackDevice:(ByteRTCAudioPlaybackDevice)audioPlaybackDevice __deprecated_msg("Will be removed in new version")

  • (int)setDefaultAudioRoute:(ByteRTCAudioRoute)audioRoute

删除

(void)rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomError:(ByteRTCErrorCode)errorCode __deprecated_msg("Will be removed in new version")

  • (void)rtcRoom:(ByteRTCRoom *_Nonnull)rtcRoom onRoomStateChanged:(NSString *_Nonnull)roomId withUid:(nonnull NSString *)uid state:(NSInteger)state extraInfo:(NSString *_Nonnull)extraInfo;
  • (void)rtcRoom:(ByteRTCRoom *_Nonnull)rtcRoom onStreamStateChanged:(NSString *_Nonnull)roomId withUid:(nonnull NSString *)uid state:(NSInteger)state extraInfo:(NSString *_Nonnull)extraInfo

删除

(int)subscribeUserStream:(NSString *_Nonnull)userId streamType:(ByteRTCStreamIndex)streamType mediaType:(ByteRTCSubscribeMediaType)mediaType videoConfig:(ByteRTCSubscribeVideoConfig *_Nonnull)videoConfig __deprecated_msg("Will be removed in new version")

  • (int)subscribeStreamVideo:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe
  • (int)subscribeStreamAudio:(NSString *_Nonnull)streamId subscribe:(BOOL)subscribe

删除

  1. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onUserMuteAudio:(NSString * _Nonnull)roomId uid:(NSString * _Nonnull)uid muteState:(ByteRTCMuteState)muteState __deprecated_msg("Will be removed in new version")
  2. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onUserMuteVideo:(NSString * _Nonnull)roomId uid:(NSString * Nonnull)uid withMuteState:(ByteRTCMuteState)muteState NS_SWIFT_NAME(rtcEngine(:onUserMuteVideo:uid:withMuteState:)) __deprecated_msg("Will be removed in new version")
  3. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onMediaDeviceStateChanged:(NSString*_Nonnull)deviceID device_type:(ByteRTCMediaDeviceType)deviceType device_state:(ByteRTCMediaDeviceState)deviceState device_error:(ByteRTCMediaDeviceError)deviceError __attribute((deprecated("Will be removed in new version")))
  4. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onMediaDeviceWarning:(NSString*_Nonnull)deviceId deviceType:(ByteRTCMediaDeviceType)deviceType deviceWarning:(ByteRTCMediaDeviceWarning)deviceWarning __deprecated_msg("Will be removed in new version")
  5. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onAudioPlaybackDeviceChanged:(ByteRTCAudioPlaybackDevice)device __deprecated_msg("Will be removed in new version")
  6. -(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onAudioMixingStateChanged:(NSInteger)mixId state:(ByteRTCAudioMixingState)state error:(ByteRTCAudioMixingError)error
  7. -(void)rtcEngine:(ByteRTCVideo *_Nonnull)engine onHttpProxyState:(NSInteger)state
  8. -(void)rtcEngine:(ByteRTCVideo *_Nonnull)engine onSocks5ProxyState:(NSInteger)state cmd:(NSString *_Nonnull)cmd proxy_address:(NSString *_Nonnull)proxyAddress local_address:(NSString *_Nonnull)localAddress remote_address:(NSString *_Nonnull)remoteAddress
  1. (void)rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamAudio:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish
  2. (void)rtcRoom:(ByteRTCRoom* _Nonnull)rtcRoom onUserPublishStreamVideo:(NSString* _Nonnull)streamId info:(ByteRTCStreamInfo* _Nonnull)info isPublish:(BOOL)isPublish
  3. (void)rtcEngine:(ByteRTCEngine * _Nonnull)engine onAudioDeviceStateChanged:(NSString*_Nonnull)deviceID device_type:(ByteRTCAudioDeviceType)deviceType device_state:(ByteRTCMediaDeviceState)deviceState device_error:(ByteRTCMediaDeviceError)deviceError
    • (void)rtcEngine:(ByteRTCEngine * _Nonnull)engine onVideoDeviceStateChanged: (NSString*_Nonnull)deviceID device_type: (ByteRTCVideoDeviceType)deviceType device_state:(ByteRTCMediaDeviceState)deviceState device_error:(ByteRTCMediaDeviceError)deviceError
  4. (void)rtcEngine:(ByteRTCEngine * _Nonnull)engine onAudioDeviceWarning:(NSString*_Nonnull)deviceId deviceType:(ByteRTCAudioDeviceType)deviceType deviceWarning:(ByteRTCMediaDeviceWarning)deviceWarning
    • (void)rtcEngine:(ByteRTCEngine * _Nonnull)engine onVideoDeviceWarning (NSString*_Nonnull)deviceId deviceType:(ByteRTCVideoDeviceType)deviceType deviceWarning:(ByteRTCMediaDeviceWarning)deviceWarning
  5. (void)rtcEngine:(ByteRTCEngine *_Nonnull)engine onAudioRouteChanged:(ByteRTCAudioRoute)device
  6. -(void)onAudioEffectPlayerStateChanged:(int)effectId state:(ByteRTCPlayerState)state error:(ByteRTCPlayerError)error
    -(void)onMediaPlayerStateChanged:(int)playerId state:(ByteRTCPlayerState)state error:(ByteRTCPlayerError)error
  7. (void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onLocalProxyStateChanged:(ByteRTCLocalProxyType)type withProxyState:(ByteRTCLocalProxyState)state withProxyError:(ByteRTCLocalProxyError)error
  8. (void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onLocalProxyStateChanged:(ByteRTCLocalProxyType)type withProxyState:(ByteRTCLocalProxyState)state withProxyError:(ByteRTCLocalProxyError)error

删除

  1. -(int)checkVideoEffectLicense:(NSString * Nonnull)licenseFile NS_SWIFT_NAME(checkVideoEffectLicense(:)) __deprecated_msg("Will be removed in new version")
  2. -(void)setVideoEffectAlgoModelPath:(NSString * _Nonnull)modelPath __deprecated_msg("Will be removed in new version")
  3. -(int)enableVideoEffect:(BOOL)enabled NS_SWIFT_NAME(enableVideoEffect(_:)) __deprecated_msg("Will be removed in new version")
  4. (int) setVideoEffectNodes:(NSArray <NSString *> *_Nonnull)effectNodePaths __deprecated_msg("Will be removed in new version")
  5. -(int) updateVideoEffectNode:(NSString * _Nonnull)nodePath nodeKey:(NSString * Nonnull)nodeKey nodeValue:(float) nodeValue NS_SWIFT_NAME(updateVideoEffectNode(:nodeKey:nodeValue:)) __deprecated_msg("Will be removed in new version")
  6. -(int) setVideoEffectColorFilter:(NSString * _Nonnull)resPath __deprecated_msg("Will be removed in new version")
  7. -(int) setVideoEffectColorFilterIntensity:(float) intensity __deprecated_msg("Will be removed in new version")
  8. -(int) setBackgroundSticker:(NSString* _Nullable)modelPath source:(ByteRTCVirtualBackgroundSource* _Nonnull)source __deprecated_msg("Will be removed in new version")
  9. -(int) registerFaceDetectionObserver:(Nullable id)faceDetectionObserver withInterval:(NSInteger)interval NS_SWIFT_NAME(registerFaceDetectionObserver(:withInterval:)) __deprecated_msg("Will be removed in new version")

美颜相关API从ByteRTCEngine(原ByteRTCVideo)移到了ByteRTCVideoEffect中:

  1. (int) initCVResource:(NSString* _Nonnull)licenseFile withAlgoModelDir: (NSString* _Nonnull)algoModelDir
  2. (int) initCVResource:(NSString* _Nonnull)licenseFile withAlgoModelDir: (NSString* _Nonnull)algoModelDir
  3. (int) enableVideoEffect
  4. (int) setEffectNodes:(NSArray<NSString*>*_Nonnull)effect_nodes
  5. (int) updateEffectNode:(NSString* _Nonnull)node_path key:(NSString* _Nonnull)key value:(float) value
  6. (int) setColorFilter:(NSString* _Nonnull)filter_res
  7. (int) setColorFilterIntensity:(float) intensity
  8. (int) enableVirtualBackground:(NSString* _Nonnull)bg_sticker_res withSource:(ByteRTCVirtualBackgroundSource* _Nonnull)source
  9. (int) enableFaceDetection:(id)observer withInterval:(NSUInteger)interval withModelPath:(NSString *)path

删除

  1. -(int)startLiveTranscoding:(NSString * _Nonnull)taskID transcoding:(ByteRTCLiveTranscoding *_Nullable)
  2. -(int)stopLiveTranscoding:(NSString *_Nonnull)taskID __deprecated_msg("deprecated since 352, will be deleted in 358, use stopPushStreamToCDN instead")
  3. -(int)updateLiveTranscoding:(NSString *_Nonnull)taskID transcoding:(ByteRTCLiveTranscoding *_Nonnull)transcoding __deprecated_msg("deprecated since 352, will be deleted in 358, use updatePushMixedStreamToCDN instead")
  1. (int)startPushMixedStream:(NSString * _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig*)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nullable)config
  2. (int)stopPushMixedStream:(NSString *_Nonnull)taskId withPushTargetType:(ByteRTCMixedStreamPushTargetType)pushTargetType
  3. (int)updatePushMixedStream:(NSString _Nonnull)taskId withPushTargetConfig:(ByteRTCMixedStreamPushTargetConfig)pushTargetConfig withMixedConfig:(ByteRTCMixedStreamConfig *_Nonnull)config

删除

ByteRTCAudioMixingManager

ByteRTCMediaPlayer
ByteRTCAudioEffectPlayer

删除

-(int)muteAudioPlayback:(ByteRTCMuteState)muteState __deprecated_msg("Will be removed in new version")

  • (int)setPlaybackVolume:(NSInteger)volume
  1. -(int)updatePosition:(ByteRTCPosition* _Nonnull) pos __deprecated_msg("deprecated since 352, use updateSelfPosition instead");
  2. -(int)updateSelfOrientation:(ByteRTCHumanOrientation* _Nonnull) orientation __deprecated_msg("deprecated since 352, use updateSelfPosition instead");
  3. -(int)updateListenerPosition:(ByteRTCPosition* _Nonnull) pos __deprecated_msg("deprecated since 352, use updateRemotePosition instead");
  4. -(int)updateListenerOrientation:(ByteRTCHumanOrientation* _Nonnull)orientation __deprecated_msg("deprecated since 352, use updateRemotePosition instead")
  1. -(int)updateSelfPosition:(ByteRTCPositionInfo* _Nonnull)positionInfo
  2. -(int)updateSelfPosition:(ByteRTCPositionInfo* _Nonnull)positionInfo
  3. -(int)updateRemotePosition:(NSString * _Nonnull)uid positionInfo:(ByteRTCPositionInfo* _Nonnull)positionInfo
  4. -(int)updateRemotePosition:(NSString * _Nonnull)uid positionInfo:(ByteRTCPositionInfo* _Nonnull)positionInfo

删除

  • ByteRTCEngine(原ByteRTCVideo)类定义的以下方法:
    • (int)pushScreenVideoFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts rotation:(int)rotation
    • (int)setScreenAudioStreamIndex:(ByteRTCStreamIndex) index

屏幕分享功能部分删除,暂无替换

3.58

类型变更

变更详情

功能模块

改动的数据类型

说明

新增枚举值

音效

ByteRTCPlayerState

3.57

重要说明

  1. 自 3.57 版本起,macOS SDK 支持的最低版本为 macOS 10.13。

  2. 该版本对所有不规范的 API 命名进行了统一修复,提升代码规范度和易用性。以下仅为变更示例,请至类型详情页查看所用类型的具体改动。

    变更对象

    变更详情

    旧版示例

    新版示例

    枚举值

    统一以 “ByteRTC” 为前缀,改为“类名+值名”

    以 ByteRTCSEICountPerFrame 为例:

    • kSingleSEIPerFrame = 0,
    • kMultiSEIPerFrame = 1,

    以 ByteRTCSEICountPerFrame 为例:

    • ByteRTCSEICountPerFrameSingle = 0,
    • ByteRTCSEICountPerFrameMulti = 1,

    结构体成员

    改为首字母小写,驼峰标识

    以 ByteRTCLocalStreamStats 为例:

    • audio_stats
    • video_stats
    • tx_quality
    • rx_quality
    • is_screen

    以 ByteRTCLocalStreamStats 为例:

    • audioStats
    • videoStats
    • txQuality
    • rxQuality
    • isScreen

方法变更

变更详情

功能模块

废弃的类/接口

替代的类/接口

说明

删除

主调类

ByteRTCEngineKit

ByteRTCVideo

删除

引擎管理

ByteRTCVideo.setEnv

RTCVideo.createRTCVideo:delegate:parameters:

咨询技术支持获取详细信息。

使用范围拓展

视频处理

setVideoDecoderConfig

setVideoDecoderConfig

旧版接口仅支持在手动订阅时使用,新增支持在自动订阅时使用。

删除

音频处理

ByteRTCAudioProcessor

ByteRTCAudioFrameProcessor

ByteRTCAudioProcessor 已在 3.42 中废弃。此次进行了删除。

参数数据结构新增成员变量

音频管理

enableAudioPropertiesReport

enableAudioPropertiesReport

新增参数 enableVoicePitch 控制是否回调本地用户的人声基频。

废弃

视频处理

ByteRTCVideo.getAuthMessage

ByteRTCVideoEffect.getAuthMessage

使用类 ByteRTCVideoEffect 中的同名方法,替换 ByteRTCVideo 中的方法。

回调变更

变更详情

功能模块

废弃的类/接口

替代的类/接口

说明

删除

主回调类

ByteRTCEngineDelegate

ByteRTCVideoDelegate

参数变更

消息

(void)rtcEngineOnLogout:(ByteRTCVideo * _Nonnull)engine NS_SWIFT_NAME(rtcEngineOnLogout(_:))

(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onLogout:(ByteRTCLogoutReason)reason

在 onLogout 回调上新增 reason 参数,区分用户主动/被动登出。

参数数据结构新增成员变量

音频管理

onLocalAudioPropertiesReport

onLocalAudioPropertiesReport

新增参数voicePitch返回本地用户的人声基频。

类型变更

变更详情

功能模块

改动的数据类型

说明

成员变量新增

字幕翻译服务

ByteRTCSubtitleMessage

在字幕内容回调 rtcRoom:onSubtitleMessageReceived: 的参数 ByteRTCSubtitleMessage 中新增成员变量 language 和 mode,可用于同时收到字幕原文和字幕译文。

成员变量变更

CDN 推流

ByteRTCMixedStreamLayoutRegionConfig

转推直播单个用户画面由设置相对于整体画面的归一化比例变更为可设置像素绝对值。

枚举值重命名

视频管理

ByteRTCVideoSourceType

ByteRTCVideoSourceTypeEncodedManualSimulcast = 2 变更为 ByteRTCVideoSourceTypeEncodedAutoSimulcast = 2
ByteRTCVideoSourceTypeEncodedAutoSimulcast = 3 变更为 ByteRTCVideoSourceTypeEncodedManualSimulcast = 3
变更后的枚举值与其他端保持一致。

错误码变更

变更详情

错误码

说明

枚举值增删

ByteRTCUserMessageSendResult

新增客户端向业务服务器发送消息失败错误码:
ByteRTCUserMessageSendResultE2BSSendFailed = 17
ByteRTCUserMessageSendResultE2BSReturnFailed = 18

3.54

重要说明

  1. 该版本 macOS 端新增音频编解码器插件、视频编解码器插件,详情参看按需集成插件文档。
  2. 该版本为全部 API 增加返回值,通过返回值可以明确发现失败的 API 调用,定位失败原因。具体返回值的含义参看各 API 注释。

方法变更

变更详情

功能模块

变动前方法

变动后方法

说明

将混音相关的类和接口按音效和音乐进行拆分,具体变动情况请参看混音相关的新旧接口对应表

混音

  • getAudioMixingManager
  • ByteRTCAudioMixingManager

一般来说,对于短时间的音效(比如小于 20s),可以使用音效类;对于较长的音频或 PCM 数据,可以使用音乐类。

行为变更

音频管理

等待超时后返回空列表,超时时间默认为 10 s

行为变更

视频管理

enumerateVideoCaptureDevices

等待超时后返回空列表,超时时间默认为 10 s

类型变更

变更详情

类型

变更前

变更后

说明

参数变更

ByteRTCRoomStats

  • tx_cellular_kbitrate
  • rx_cellular_kbitrate
  • txCellularKBitrate
  • rxCellularKBitrate

附:混音相关的新旧接口对应表

接口分类

接口用途

废弃类/接口

新类/接口(音效)

新类/接口(音乐)

备注

获取实例

获取播放器实例

getAudioMixingManager

getAudioEffectPlayer

getMediaPlayer

混音类

ByteRTCAudioMixingManager

ByteRTCAudioEffectPlayer

ByteRTCMediaPlayer

混音主调接口

将音效文件加载至内存

  • preloadAudioMixing
  • unloadAudioMixing
  • preload
  • unload
  • unloadAll
  • open
  • openWithCustomSource

播放/停止/暂停/恢复

  • startAudioMixing
  • stopAudioMixing
  • stopAllAudioMixing
  • pauseAudioMixing
  • pauseAllAudioMixing
  • resumeAudioMixing
  • resumeAllAudioMixing
  • start
  • stop
  • stopAll
  • pause
  • pauseAll
  • resume
  • resumeAll
  • start
  • stop
  • stopAll
  • pause
  • resume

获取/指定位置/时长

  • setAudioMixingPosition
  • getAudioMixingCurrentPosition
  • getAudioMixingDuration
  • setPosition
  • getPosition
  • getDuration
  • setPosition
  • getTotalDuration
  • getPlaybackDuration

获取/指定音量

  • setAudioMixingVolume
  • NA
  • setVolume
  • getVolume
  • setVolume
  • getVolume

调整音调

setAudioMixingPitch

NA

setAudioPitch

设置声道模式

setAudioMixingDualMonoMode

NA

setAudioDualMonoMode

获取/设置音轨数

  • getAudioTrackCount
  • selectAudioTrack

NA

  • getAudioTrackCount
  • selectAudioTrack

Index 取值修改为从 0 开始

设置播放速度

setAudioMixingPlaybackSpeed

NA

setPlaybackSpeed

设置播放进度回调间隔

setAudioMixingProgressInterval

NA

setProgressInterval

设置响度

setAudioMixingLoudness

NA

setLoudness

播放外部音频源

  • enableAudioMixingFrame
  • disableAudioMixingFrame
  • pushAudioMixingFrame

NA

  • openWithCustomSource
  • pushExternalAudioFrame

混音回调接口

播放状态回调

onAudioMixingStateChanged

  • setEventHandler
  • onAudioEffectPlayerStateChanged
  • setEventHandler
  • onMediaPlayerStateChanged
  • onMediaPlayerPlayingProgress

音频数据回调

  • registerAudioFileFrameObserver
  • onAudioFileFrame

NA

  • ByteRTCMediaPlayerAudioFrameObserver
  • onFrame

3.52

方法变更

变更详情

功能模块

变动前方法

变动后方法

说明

参数变更

引擎管理

feedback:info:

参数数据类型变更

废弃

CDN 推流

- (int)startLiveTranscoding:(NSString * _Nonnull)taskID transcoding:(ByteRTCLiveTranscoding *_Nullable)transcoding observer:(id<LiveTranscodingDelegate> _Nullable)observer;

- (int)startPushMixedStreamToCDN:(NSString * _Nonnull)taskID mixedConfig:(ByteRTCMixedStreamConfig *_Nullable)config observer:(id<ByteRTCMixedStreamObserver> _Nullable)observer;

合流转推直播接口/参数类型重命名,行为逻辑无变化,新旧版本类名对应关系参看该版本中“类型变更”

- (int)stopLiveTranscoding:(NSString *_Nonnull)taskID;

- (int)stopPushStreamToCDN:(NSString *_Nonnull)taskID NS_SWIFT_NAME(stopPushStreamToCDN(_:));

- (int)updateLiveTranscoding:(NSString *_Nonnull)taskID transcoding:(ByteRTCLiveTranscoding *_Nonnull)transcoding;

- (int)updatePushMixedStreamToCDN:(NSString *_Nonnull)taskID mixedConfig:(ByteRTCMixedStreamConfig *_Nonnull)config;

合并

高级功能

  • -(int)updatePosition:(Position* _Nonnull) pos
  • -(int)updateSelfOrientation:(HumanOrientation* _Nonnull) orientation

-(int)updateSelfPosition:(ByteRTCPositionInfo* _Nonnull)positionInfo;

新接口支持本地用户同时设置本地用户的发声位置和发声朝向。

  • -(int)updateListenerPosition:(Position* _Nonnull) pos
  • -(int)updateListenerOrientation:(HumanOrientation* _Nonnull)orientation

-(int)updateRemotePosition:(NSString * _Nonnull)uid positionInfo:(ByteRTCPositionInfo* _Nonnull)positionInfo;

新接口支持本地用户设置远端用户的发声位置和发声朝向。

回调变更

变更详情

方法

说明

参数变更

rtcEngine:onPublicStreamSEIMessageReceived:andMessage:andSourceType:

参数 sourceType 的类型由 ByteRTCSEIMessageSourceType
变更为 ByteRTCDataMessageSourceType
拆分为:

  • rtcEngine:onPublicStreamSEIMessageReceived:andMessage:andSourceType::接收客户端插入的 SEI 消息。
  • rtcEngine:onPublicStreamDataMessageReceived:andMessage::接收服务端插入的 SEI 消息和其他数据信息,例如音量信息。

类型变更

变更详情

类型

变更前

变更后

说明

重命名

转推直播一级结构体

ByteRTCLiveTranscoding

ByteRTCMixedStreamConfig

结构体中变量名称/方法名称均有变更,请至对应的类型详情中查看

转推直播 Observer

LiveTranscodingDelegate

ByteRTCMixedStreamObserver

转推直播二级结构体

ByteRTCTranscodingVideoConfig

ByteRTCMixedStreamVideoConfig

结构体中变量名称/方法名称均有变更,请至对应的类型详情中查看

ByteRTCTranscodingAudioConfig

ByteRTCMixedStreamAudioConfig

ByteRTCTranscodingSpatialConfig

ByteRTCMixedStreamSpatialAudioConfig

ByteRTCTranscodingClientMixParam

ByteRTCMixedStreamClientMixConfig

ByteRTCVideoCompositingRegion

ByteRTCMixedStreamLayoutRegionConfig

ByteRTCVideoCompositingLayout

ByteRTCMixedStreamLayoutConfig

转推直播相关枚举类型

ByteRTCClientMixVideoFormat

ByteRTCMixedStreamClientMixVideoFormat

各枚举类中的枚举值名称均有变更,请至对应的类型详情中查看

ByteRTCTranscoderContentControlType

ByteRTCMixedStreamMediaType

ByteRTCRenderMode

ByteRTCMixedStreamRenderMode

ByteRTCTranscoderLayoutRegionType

ByteRTCMixedStreamLayoutRegionType

ByteRTCAACProfile

ByteRTCMixedStreamAudioProfile

ByteRTCTranscodingVideoCodec

ByteRTCMixedStreamVideoCodecType

ByteRTCTranscodingAudioCodec

ByteRTCMixedStreamAudioCodecType

ByteRTCStreamMixingType

ByteRTCMixedStreamType

错误码变更

变更详情

错误码

说明

枚举值变更

ByteRTCPublicStreamErrorCode

新增枚举值:

  • ByteRTCPublicStreamErrorCodePullNoPushStream = 1300

名称变更:

  • ByteRTCPublicStreamErrorCodeParamError = 1191 更新为 ByteRTCPublicStreamErrorCodePushParamError = 1191
  • ByteRTCPublicStreamErrorCodeStatusError = 1192 更新为 ByteRTCPublicStreamErrorCodePushStatusError = 1192
  • ByteRTCPublicStreamErrorCodeInternalError = 1193 更新为 ByteRTCPublicStreamErrorCodePushInternalError = 1193

ByteRTCErrorCode

新增枚举值 kErrorCodeJoinRoomRoomForbidden=-1025 和 kErrorCodeJoinRoomUserForbidden=-1026。
当服务端在指定房间封禁指定用户,而此用户加入房间失败,或从房间中被踢出时收到。

废弃枚举值 ByteRTCErrorCodeOverScreenPublishLimit=-1081, 用 ByteRTCErrorCodeOverStreamPublishLimit=-1080 代替。

3.50

产物变更

该版本 SDK 产物新增 libAGFX.dylib 和 libbytenn.dylib 依赖库,需手动导入项目。

头文件变更

原 ByteRTCCommonDefines.h 文件拆分为 ByteRTCMediaDefines.h 及 ByteRTCRtsDefines.h

方法变更

变更详情

功能模块

变动前方法

变动后方法

备注

返回值变更

房间管理

joinRoom:userInfo:roomConfig: 返回值含义如下:

  • -1:无效的参数。
  • -2:已经在房间内。

joinRoom:userInfo:roomConfig: 返回值含义如下:

  • -1:调用失败。
  • -2:无效的参数。
  • -4:已经在房间内。

返回值为 0 代表成功,不变。

网络管理

stopEchoTest 返回 -1 代表失败,未开启回路检测。

stopEchoTest 返回 -3 代表失败,未开启回路检测

引擎管理

setBusinessId: 返回值含义如下:

  • < 0: 失败,具体原因参照 BusinessCheckCode。
  • -6001: 用户已经在房间中。
  • -6002: 输入非法。

setBusinessId: 返回值含义如下:

  • < 0: 失败,具体原因参照 ReturnStatus
  • -2: 输入非法。

拆分

视频管理

(int) registerFaceDetectionObserver:(_Nullable id<ByteRTCFaceDetectionObserver>)faceDetectionObserver withInterval:(NSInteger)interval;

解除人脸识别与视频特效之间的耦合,提升接口易用性。

参数变更

消息

(int64_t)sendUserMessage:(NSString *_Nonnull)userId message:(NSString *_Nonnull)message config:(ByteRTCMessageConfig)config;

(NSInteger)sendUserMessage:(NSString *_Nonnull)userId message:(NSString *_Nonnull)message config:(ByteRTCMessageConfig)config;

返回参数类型由 int64_t 变更为 NSInteger

(int64_t)sendUserBinaryMessage:(NSString * _Nonnull)uid message:(NSData * _Nonnull)message config:(ByteRTCMessageConfig)config;

(NSInteger)sendUserBinaryMessage:(NSString * _Nonnull)uid message:(NSData * _Nonnull)message config:(ByteRTCMessageConfig)config;

(int64_t)sendRoomMessage:(NSString *_Nonnull)message NS_SWIFT_NAME(sendRoomMessage(_:));

(NSInteger)sendRoomMessage:(NSString *Nonnull)message NS_SWIFT_NAME(sendRoomMessage(:));

(int64_t)sendRoomBinaryMessage:(NSData * _Nonnull)message NS_SWIFT_NAME(sendRoomBinaryMessage(_:));

(NSInteger)sendRoomBinaryMessage:(NSData * Nonnull)message NS_SWIFT_NAME(sendRoomBinaryMessage(:));

(int64_t)sendUserMessageOutsideRoom:(NSString * _Nonnull)userId message:(NSString * _Nonnull)messageStr config:(ByteRTCMessageConfig)config;

(NSInteger)sendUserMessageOutsideRoom:(NSString * _Nonnull)userId message:(NSString * _Nonnull)messageStr config:(ByteRTCMessageConfig)config;

(int64_t)sendUserBinaryMessageOutsideRoom:(NSString * _Nonnull)userId message:(NSData * _Nonnull)messageStr config:(ByteRTCMessageConfig)config;

(NSInteger)sendUserBinaryMessageOutsideRoom:(NSString * _Nonnull)userId message:(NSData * _Nonnull)messageStr config:(ByteRTCMessageConfig)config;

(int64_t)sendServerMessage:(NSString * _Nonnull)messageStr;

(NSInteger)sendServerMessage:(NSString * _Nonnull)messageStr;

(int64_t)sendServerBinaryMessage:(NSData * _Nonnull)messageStr;

(NSInteger)sendServerBinaryMessage:(NSData * _Nonnull)messageStr;

参数类型变更

屏幕共享

-(int)setScreenVideoEncoderConfig:(ByteRTCVideoEncoderConfig * _Nullable) screen_solution;

-(int)setScreenVideoEncoderConfig:(ByteRTCScreenVideoEncoderConfig * _Nullable) screen_solution;

参数类型变更为新增的 ByteRTCScreenVideoEncoderConfig

行为变更、名称变更

屏幕共享

  • setVideoSourceType:WithStreamIndex:: 屏幕流默认为外部源
  • setScreenAudioSourceType:: 当前设置为内部源时,且已开启了采集,调用该接口切换为外部源时,不会停止内部采集
  • startScreenAudioCapture:: 当前为外部源时,调用本接口将自动切换为内部源,并开启采集
  • startScreenCaptureSourceInfo:captureParameters:: 当前为外部源时,调用本接口将自动切换为内部源,并开启采集
  • stopScreenAudioCapture/ stopScreenVideoCapture: 当前为外部源时,调用本接口将关闭外部采集

优化屏幕共享接口的行为

所属类型变更、名称变更、参数变更

音视频处理

  • (int)checkVideoEffectLicense:(NSString * _Nonnull)licenseFile;
  • (void)setVideoEffectAlgoModelPath:(NSString * _Nonnull)modelPath;

(int) initCVResource:(NSString* _Nonnull)license_file withAlgoModelDir: (NSString* _Nonnull)algo_model_dir;

  • 统一从 ByteRTCVideo 类下调整到 ByteRTCVideoEffect 类下
  • 统一返回值

(int)enableVideoEffect:(BOOL)enabled;

(int) setVideoEffectNodes:(NSArray <NSString *> *_Nonnull)effectNodePaths;

(int) setEffectNodes:(NSArray<NSString*>*_Nonnull)effect_nodes;

(int) updateVideoEffectNode:(NSString * _Nonnull)nodePath nodeKey:(NSString * _Nonnull)nodeKey nodeValue:(float) nodeValue;

(int) updateEffectNode:(NSString* _Nonnull)node key:(NSString* _Nonnull)key value:(float) value;

(int) setBackgroundSticker:(NSString* _Nullable)modelPath source:(ByteRTCVirtualBackgroundSource* _Nonnull)source;

(int) setVideoEffectColorFilter:(NSString * _Nonnull)resPath;

(int) setColorFilter:(NSString* _Nonnull)filter_res;

(int) setVideoEffectColorFilterIntensity:(float) intensity;

(int) setColorFilterIntensity:(float) intensity;

参数变更

消息

(int)sendSEIMessage:(ByteRTCStreamIndex)streamIndex andMessage:(NSData* _Nonnull)message andRepeatCount:(int)repeatCount;

(int)sendSEIMessage:(ByteRTCStreamIndex)streamIndex andMessage:(NSData* _Nonnull)message andRepeatCount:(int)repeatCount andCountPerFrame:(ByteRTCSEICountPerFrame) mode;

支持 SEI 多发模式,即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 随下个视频帧同时发送。

多个模块

返回值类型变化,例如:

  • 旧方法——(void)subscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;
  • 新方法——(int)subscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;

以下接口返回值类型由 void 变为 int,具体 int 值含义参考新增数据结构 ByteRTCReturnStatus:
subscribeStream
subscribeScreen
setVoiceChangerType
setVoiceReverbType
login
以下接口返回值类型由 BOOL 变为 int,具体 int 值含义参考新增数据结构 ByteRTCReturnStatus:
pushExternalEncodedVideoFrame
以下接口返回值类型由 BOOL 变为 void:
setUserVisibility
setMultiDeviceAVSync
registerAudioProcessor
以下接口返回值类型由 int 变为 void:
leaveRoom
publishStream
unpublishStream
publishScreen
unpublishScreen
enableSimulcastMode
updateLocalVideoCanvas
setLocalVideoMirrorType
setVideoRotationMode
startLiveTranscoding
stopLiveTranscoding
setPublishFallbackOption
setSubscribeFallbackOption

视频管理

(int)setRemoteVideoCanvas:(NSString * _Nonnull)uid withIndex:(ByteRTCStreamIndex)streamIndex withCanvas:(ByteRTCVideoCanvas * _Nullable)canvas;

(void)setRemoteVideoCanvas:(ByteRTCRemoteStreamKey * _Nonnull)key withCanvas:(ByteRTCVideoCanvas * _Nullable)canvas;

  • 返回值类型由 int 变更为 void。
  • 通过 key 传入 uid 和 streamIndex。

(int)updateRemoteStreamVideoCanvas:(NSString * _Nonnull)roomid withUserId:(NSString * _Nonnull)uid withIndex:(ByteRTCStreamIndex)streamIndex withRenderMode:(ByteRTCRenderMode)renderMode withBackgroundColor:(NSUInteger)backgroundColor;

(void)updateRemoteStreamVideoCanvas:(ByteRTCRemoteStreamKey * _Nonnull)key withRenderMode:(ByteRTCRenderMode)renderMode withBackgroundColor:(NSUInteger)backgroundColor;

  • 返回值类型由 int 变更为 void。
  • 通过 key 传入 roomid 、uid 和 streamIndex。

名称和参数变更

音视频传输

(void)unSubscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;

(int)unsubscribeStream:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;

  • 返回值由 void 变为 int。
  • 修正名称中的大小写。

(void)unSubscribeScreen:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;

(int)unsubscribeScreen:(NSString *_Nonnull)userId mediaStreamType:(ByteRTCMediaStreamType)mediaStreamType;

  • 返回值由 void 变为 int。
  • 修正名称中的大小写。

屏幕分享

(void)pushScreenCaptureFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts rotation:(int)rotation;

(int)pushScreenVideoFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts rotation:(int)rotation;

  • 返回值由 void 变为 int。
  • 方法名称由 pushScreenFrame 变更为 pushScreenVideoFrame。

自定义流处理

(BOOL)pushExternalByteVideoFrame:(ByteRTCVideoFrame * _Nonnull)frame;

(int)pushExternalVideoFrame:(ByteRTCVideoFrame * _Nonnull)frame;

  • 返回值由 BOOL 变为 int。
  • 名称由 pushExternalByteVideoFrame 变更为 pushExternalVideoFrame。

(BOOL)setAudioFrameObserver:(_Nullable id<ByteRTCAudioFrameObserver>) audioFrameObserver;

(void)registerAudioFrameObserver:(_Nullable id<ByteRTCAudioFrameObserver>) audioFrameObserver;

  • 返回值由 BOOL 变为 void。
  • 名称由 setAudioFrameObserver 变为 registerAudioFrameObserver。

名称变更

高级功能

UpdateScreenCaptureMouseCursor

updateScreenCaptureMouseCursor

大驼峰变为小驼峰。

SetVideoWatermark

setVideoWatermark

音视频处理

ClearVideoWatermark

clearVideoWatermark

ClearVideoWatermark

clearVideoWatermark

视频管理

SetVideoEncoderConfig

setVideoEncoderConfig

SetMaxVideoEncoderConfig

setMaxVideoEncoderConfig

屏幕分享

getScreenCaptureSourceThumbnail

getThumbnail

房间管理

joinRoomByToken

joinRoom

renewToken

updateToken

setRtcRoomDelegate

setRTCRoomDelegate

修正大小写。

引擎管理

getSdkVersion

getSDKVersion

修正大小写。

安全与加密

setEncryptType

setEncryptInfo

屏幕分享

SetScreenVideoEncoderConfig

setScreenVideoEncoderConfig

音频管理

startPlaybackDeviceTest

startAudioPlaybackDeviceTest

stopPlaybackDeviceTest

stopAudioPlaybackDeviceTest

删除

自定义流处理

删除:

  • (BOOL)pushExternalVideoFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts;
  • (BOOL)pushExternalVideoFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts rotation:(ByteRTCVideoRotation)rotation;
  • (BOOL)pushExternalVideoFrame:(CVPixelBufferRef _Nonnull )frame time:(CMTime)pts rotation:(ByteRTCVideoRotation)rotation extendedData:(NSData* _Nullable)extendedData supplementaryInfo:(NSData* _Nullable)supplementoryInfo;

由以下接口替代:
(int)pushExternalVideoFrame:(ByteRTCVideoFrame * _Nonnull)frame;

回调变更

变更详情

功能模块

变动前回调

变动后回调

备注

参数变更

消息

(void)rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserMessageSendResult:(int64_t)msgid error:(ByteRTCUserMessageSendResult)error;

(void)rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onUserMessageSendResult:(NSInteger)msgid error:(ByteRTCUserMessageSendResult)error;

msgid 参数类型由 int64_t 变更为 NSInteger

(void)rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomMessageSendResult:(int64_t)msgid error:(ByteRTCRoomMessageSendResult)error;

(void)rtcRoom:( ByteRTCRoom *_Nonnull)rtcRoom onRoomMessageSendResult:(NSInteger)msgid error:(ByteRTCRoomMessageSendResult)error;

(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onUserMessageSendResultOutsideRoom:(int64_t)msgid error:(ByteRTCUserMessageSendResult)error;

(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onUserMessageSendResultOutsideRoom:(NSInteger)msgid error:(ByteRTCUserMessageSendResult)error;

CDN 推流

(void)onMixingAudioFrame:(ByteRTCAudioFrame *_Nonnull)audioFrame taskId:(NSString *_Nonnull)taskId;

onMixingAudioFrame

新增参数 timeStamp

消息

(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onPublicStreamSEIMessageReceived:(NSString* _Nonnull)publicStreamId andMessage:(NSData* _Nonnull)message;

(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine onPublicStreamSEIMessageReceived:(NSString* _Nonnull)publicStreamId andMessage:(NSData* _Nonnull)message andSourceType:(ByteRTCSEIMessageSourceType)sourceType;

名称变更

房间管理

onLeaveRoomWithStats

onLeaveRoom

音视频传输

connectionChangedToState

onConnectionStateChanged

networkTypeChangedToType

onNetworkTypeChanged

reportSysStats

onSysStats

网络管理

onPerformanceAlarmsWithMode

onPerformanceAlarms

OnSimulcastSubscribeFallback

onSimulcastSubscribeFallback

大驼峰变为小驼峰。

安全与加密

ByteRTCEncryptRawData

onEncryptData

ByteRTCDecryptRawData

onDecryptData

视频管理

onFaceDetectionResult

onFaceDetectResult

删除

音视频传输

删除:
(void)rtcEngine:(ByteRTCVideo * _Nonnull)engine remoteVideoStateChangedOfUid:(NSString * _Nonnull)uid state:(ByteRTCRemoteVideoState)state;

/

删除回调类

范围语音

ByteRTCRangeAudioObserver 类和相关的接口

此前,在手动订阅的场景下,如果你希望使用范围语音功能,你必须根据此回调获取的衰减系数,设定音量。
自此版本起,无论是手动订阅还是自动订阅,衰减效果都由 SDK 实现,无需使用此接口。

类型变更

变更详情

数据类型

备注

取值范围拓展

ByteRTCVideoCompositingRegion 中,width 和 height

取值范围由 (0.0, 1.0] 拓展为 [0.0, 1.0]。

枚举值增删

ByteRTCAudioFrameMethod

新增枚举值:ByteRTCAudioFrameProcessorEarMonitor = 3

成员变量变更

ByteRTCFaceDetectionResult

新增成员变量:frameTimestamp

ByteRTCVideoCanvas

删除变量:roomId 和 uid

ByteRTCVideoFrame

  • extendedData 的类型由 ByteRTCFrameExtendedData 变为 NSData
  • 新增成员变量:supplementaryInfo

ByteRTCLiveTranscoding

新增成员变量:ByteRTCTranscodingClientMixParam

变量类型变更

空间音频功能中表示空间坐标的 position 的 变量 x, y, z 类型由 int 更改为 float。

提升球面立体声渲染效果。

配置变更

ByteRTCRoomProfile

房间属性的默认值 ByteRTCRoomProfileCommunication = 0,对应的由 ByteRTCRoomProfileChatRoom = 6 变更为 ByteRTCRoomProfileMeeting = 16。

错误码变更

变更详情

错误码

备注

枚举值增删

ByteRTCErrorCode

新增枚举值:ByteRTCUserIDDifferent = -1014

ByteRTCUserMessageSendResult

新增枚举值:ByteRTCUserMessageSendResultExceedQPS = 5

ByteRTCRoomMessageSendResult

新增枚举值:ByteRTCRoomMessageSendResultExceedQPS = 5

新增

ByteRTCPublicStreamErrorCode

onPlayPublicStreamResult: 和 onPushPublicStreamResult: 中的 errorCode 参数类型由 ByteRTCTranscodingError 改为 ByteRTCPublicStreamErrorCode

3.45.6

类型变更

以下表格中的类型发生了变化,你需要在工程文件中找到该类型,并根据变化调整相关处理逻辑:

变更详情

数据类型

备注

枚举值增删

ByteRTCAudioFrameMethod

新增屏幕共享音频的枚举值: ByteRTCAudioFrameProcessorScreen = 4

3.45.4

方法变更

以下表格中的方法发生了变化。你需要在工程文件中找到该方法,并进行相关修改:

变更详情

功能模块

方法

备注

参数数据结构改动

音频管理

(void)enableAudioPropertiesReport:(ByteRTCAudioPropertiesConfig* _Nonnull)config;

数据结构中,新增参数:
ByteRTCAudioPropertiesMode
ByteRTCAudioReportMode

3.45.2

方法变更

以下表格中的方法发生了变化。你需要在工程文件中找到该方法,并进行相关修改:

变更详情

功能模块

变动前方法

变动后方法

备注

废弃原方法

音频处理

(void)muteAudioPlayback:(ByteRTCMuteState)muteState;

(void)setPlaybackVolume:(NSInteger)volume;

设置远端用户音量为 0 即可停止播放本地收到的音频流

最近更新时间:2026.10.13 19:59:32
这个页面对您有帮助吗?
有用
有用
无用
无用