ByteRTCWTNStream class
Inheritance
Object
NativeClass
ByteRTCWTNStream
Properties
$resource
→ NativeResource
no setter inherited
hashCode
→ int
The hash code for this object.
no setter inherited
ready
→ Future <void >
Whether the instance is initialized
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
destroy ()
→ void
inherited
nativeCall <T > (String method , [List ? args , NativeMethodMeta? meta ])
→ Future <T >
Call instance method
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendInstanceGet <T > (String property )
→ Future <T >
Get instance property
inherited
sendInstancePropertiesGet (dynamic nativeClass )
→ Future <Map <String , dynamic > >
Get instance properties
inherited
sendInstanceSet (String property , dynamic value )
→ Future <void >
Set instance property
inherited
setWTNRemoteAudioPlaybackVolume (NSString streamId , NSInteger volume )
→ FutureOr <int >
@detail api
@valid since 3.60. 自 3.60 起,该接口替代了 setPublicStreamAudioPlaybackVolume:volume: 方法来实现下述功能。你已升级至 3.60 及以上版本,并且仍在使用该方法,请迁移到此接口。
@author hanchenchen
@brief 调节 WTN 流的音频播放音量。
@param streamId WTN 流 ID
@param volume 音频播放音量值和原始音量值的比值,该比值的范围是 [0, 400],单位为 %,且自带溢出保护。为保证更好的音频质量,建议设定在 [0, 100] 之间,其中 100 为系统默认值。
@return
- 0: 成功调用。
- -2: 参数错误。
@order 4
setWTNRemoteVideoCanvas (NSString streamId , ByteRTCVideoCanvas canvas )
→ FutureOr <int >
@detail api
@valid since 3.60. Since version 3.60, this interface replaces setPublicStreamVideoCanvas:withCanvas: for the following function. If you have upgraded to version 3.60 or above and are still using this method, please migrate to this interface.
@author hanchenchen
@brief Assign a internal render view to the WTN stream
@param streamId ID of the WTN stream
@param canvas Internal render view. Set to be a blank view if you want to unbind. Refer to ByteRTCVideoCanvas{@link #ByteRTCVideoCanvas} for more details.
@return
- 0: Success
- !0: Failure
@order 2
setWTNRemoteVideoSink (NSString streamId , id <ByteRTCVideoSinkDelegate > videoSink , ByteRTCRemoteVideoSinkConfig config )
→ FutureOr <int >
@detail api
@valid since 3.60. 自 3.60 起,该接口替代了 setPublicStreamVideoSink:withSink:withPixelFormat: 方法来实现下述功能。你已升级至 3.60 及以上版本,并且仍在使用该方法,请迁移到此接口。
@author hanchenchen
@brief 为指定 WTN 流绑定自定义渲染器。详见自定义视频渲染 。
@param streamId WTN 流 ID
@param videoSink 自定义视频渲染器,需要释放渲染器资源时,将 videoSink 设置为 null。参看 ByteRTCVideoSinkDelegate{@link #ByteRTCVideoSinkDelegate}
@param config 远端视频帧回调配置,参看 ByteRTCRemoteVideoSinkConfig{@link #ByteRTCRemoteVideoSinkConfig}
@return
- 0: 成功
- <0: 失败。具体失败原因参看 ByteRTCReturnStatus{@link #ByteRTCReturnStatus}。
@order 3
setWTNStreamDelegate (id <ByteRTCWTNStreamDelegate > delegate )
→ FutureOr <void >
@detail api
@valid since 3.60.
@author hanchenchen
@brief 设置 WTN 流回调接口
@param delegate WTN 回调类,参看 ByteRTCWTNStreamDelegate{@link #ByteRTCWTNStreamDelegate}。
@order 5
subscribeWTNAudioStream (NSString streamId , bool subscribe )
→ FutureOr <int >
@author hanchenchen
@detail api
@valid since 3.60. 自 3.60 起,此接口替代了 startPlayPublicStream: 和 stopPlayPublicStream: 方法来订阅/取消订阅指定 WTN 音频流,如果你使用了这两个方法,请迁移至此接口。
@brief 订阅/取消订阅指定 WTN 音频流
无论用户是否在房间内,都可以调用本接口订阅/取消订阅指定的 WTN 音频流。
@param streamId WTN 流 ID,如果指定流暂未发布,则本地客户端将在其开始发布后接收到流数据。
@param subscribe 是否订阅 WTN 流
- true:订阅
- false:取消订阅
@return
- 0: 成功。同时将收到 onWTNVideoSubscribeStateChanged:state:reason:{@link #ByteRTCWTNStreamDelegate#onWTNVideoSubscribeStateChanged:state:reason} 回调。
- !0: 失败。当参数不合法或参数为空,调用失败。
@note
- 一个客户端最多同时播放 5 路 WTN 流,请及时调用 subscribeWTNVideoStream:subscribe:{@link #ByteRTCWTNStream#subscribeWTNVideoStream:subscribe}/subscribeWTNAudioStream:subscribe:{@link #ByteRTCWTNStream#subscribeWTNAudioStream:subscribe} 取消订阅 WTN 流,避免订阅的 WTN 流数量超限。
- 在调用本接口之前,建议先绑定渲染视图。
- 调用 setWTNRemoteVideoCanvas:withCanvas:{@link #ByteRTCWTNStream#setWTNRemoteVideoCanvas:withCanvas} 绑定内部渲染视图
- 调用 setWTNRemoteVideoSink:withSink:withConfig:{@link #ByteRTCWTNStream#setWTNRemoteVideoSink:withSink:withConfig} 绑定自定义渲染视图
- 调用本接口后,可以通过 onWTNFirstRemoteAudioFrame:{@link #ByteRTCWTNStreamDelegate#onWTNFirstRemoteAudioFrame} 回调 WTN 音频流首帧解码情况。
- 调用本接口后,可以通过 onWTNSEIMessageReceived:andChannelId:andMessage:{@link #ByteRTCWTNStreamDelegate#onWTNSEIMessageReceived:andChannelId:andMessage} 回调 WTN 流中包含的 SEI 信息。
@order 1
subscribeWTNVideoStream (NSString streamId , bool subscribe )
→ FutureOr <int >
@detail api
@valid since 3.60. 自 3.60 起,此接口替代了 startPlayPublicStream: 和 stopPlayPublicStream: 方法来订阅/取消订阅指定 WTN 视频流,如果你使用了这两个方法,请迁移至此接口。
@author hanchenchen
@brief 订阅/取消订阅指定 WTN 视频流
无论用户是否在房间内,都可以调用本接口订阅/取消订阅指定的 WTN 音频流。
@param streamId WTN 流 ID,如果指定流暂未发布,则本地客户端将在其开始发布后接收到流数据。
@param subscribe 是否订阅 WTN 流
- true:订阅
- false:取消订阅
@return
- 0: 成功。同时将收到
onWTNAudioSubscribeStateChanged:state:reason:{@link #ByteRTCWTNStreamDelegate#onWTNAudioSubscribeStateChanged:state:reason} 回调。
- !0: 失败。当参数不合法或参数为空,调用失败。
@note
- 一个客户端最多同时播放 5 路 WTN 流,请及时调用 subscribeWTNVideoStream:subscribe:{@link #ByteRTCWTNStream#subscribeWTNVideoStream:subscribe}/subscribeWTNAudioStream:subscribe:{@link #ByteRTCWTNStream#subscribeWTNAudioStream:subscribe} 取消订阅 WTN 流,避免订阅的 WTN 流数量超限。
- 在调用本接口之前,建议先绑定渲染视图。
- 调用 setWTNRemoteVideoCanvas:withCanvas:{@link #ByteRTCWTNStream#setWTNRemoteVideoCanvas:withCanvas} 绑定内部渲染视图
- 调用 setWTNRemoteVideoSink:withSink:withConfig:{@link #ByteRTCWTNStream#setWTNRemoteVideoSink:withSink:withConfig} 绑定自定义渲染视图
- 调用本接口后,可以通过 onWTNFirstRemoteVideoFrameDecoded:withFrameInfo:{@link #ByteRTCWTNStreamDelegate#onWTNFirstRemoteVideoFrameDecoded:withFrameInfo} 回调 WTN 视频流的首帧解码情况
- 调用本接口后,可以通过 onWTNSEIMessageReceived:andChannelId:andMessage:{@link #ByteRTCWTNStreamDelegate#onWTNSEIMessageReceived:andChannelId:andMessage} 回调 WTN 流中包含的 SEI 信息。
@order 0
toString ()
→ String
A string representation of this object.
inherited
updateResource (NativeResource resource )
→ void
inherited