classDiagram
class MediaStreamTrack {
}
class RTCPeerConnection {
-- RTP 扩展方法 --
+ addTranscceiver()
+ addTransceiver()
+ addTrack()
+ removeTrack()
+ getTransceivers():<RTCRtpTransceiver[]>
+ getSenders(): <RTCRtpSender[]>
+ getReceivers()
-- RTP 扩展事件 --
+ Event ontrack
}
RTCPeerConnection::RTCRtpTransceiver -o RTCRtpTransceiver
class RTCRtpTransceiver {
+ readonly currentDirection
+ readonly direction
+ readonly mid
+ readonly receiver: RTCRtpReceiver[]
+ readonly sender: RTCRtpSender[]
+ setCodecPreferences() // 设置编码格式
+ stop() // 停止通道传输
}
class RTCRtpReceiver {
+ readonly track: MediaStreamTrack
+ readonly transport: RTCDtlsTransport
+ {static} getCapbilities () 静态方法 // 该方法用于获取平台接收能力
+ getParamters() // 返回 RTP 解码参数
+ getContributingSources() // 返回最近10S内的贡献源(CSRC)
+ getSynchronizationSources() // 返回最近10s内的同步源(SSRC)
+ getStats() // 该方法返回RTP接收器的统计数据
}
RTCRtpReceiver ---o RTCDtlsTransport
RTCRtpReceiver --o MediaStreamTrack
RTCRtpTransceiver -o RTCRtpReceiver
class RTCRtpSender {
+ readonly track: MediaStreamTrack
+ readonly dtmf: RTCDTMFSender
+ readonly transport: RTCDtlsTransport
+ {static} getCapbilities() // 该方法用于获取平台发送能力
+ getParamters() // 获取 RTP 媒体编码及传输信息
+ setParamters() // 更新 RTP 编码及传输信息
+ replaceTrack() // 替换媒体流轨道
+ getStats() // 返回 RTP 发送器的统计数据
}
RTCRtpSender ---o RTCDtlsTransport
RTCRtpSender --o MediaStreamTrack
RTCRtpSender -o RTCDTMFSender
RTCRtpTransceiver --o RTCRtpSender
class RTCDtlsTransport {
+ readonly iceTransport: RTCIceTransport
+ readonly state: RTCDtlsTransportState
+ getRemoteCertificates()
+ Event onstatechange
+ Event onerror
}
class RTCIceTransport {
+ readonly role: RTCIceRole
+ readonly components: RTCIceComponent
+ readonly state: RTCIceTransportState
+ readonly gatheringState: RTCGatheringState
.. 方法 ..
+ getLocalCandidates(): RTCIceCandidate[]
+ getRemoteCandidates(): RTCIceCandidate[]
+ getSelectedCandidatePair(): RTCIceCandidatePair
+ getLocalParameters(): RTCIceParameters
+ getRemoteParameters(): RTCIceParameters
.. Event ..
+ Event Statechange // RTCIceTransport 状态发生变更时触发该事件
+ Event GatheringStateChange// ICE 候选者的收集状态值发生改变时触发该事件
+ Event Selectedcandidatepairchange // ICE 代理选择了新的候选对时触发该事件
}
RTCDtlsTransport -o RTCIceTransport
class RTCDTMFSender {
+ readonly canInsertDTMF: Boolean
+ readonly toneBuffer: ArrayBuffer
+ insertDTMF()
+ Event ontonechange
}
RTC媒体管理
于 2022-11-09 21:11:18 首次发布