【m】开发完成

This commit is contained in:
2026-04-30 23:27:34 +08:00
parent c0dd21b524
commit f04556e609
3 changed files with 13 additions and 8 deletions

View File

@@ -97,6 +97,8 @@ namespace Unity.RenderStreaming
public override void DeleteConnection(string connectionId)
{
// 清理所有Participant连接
// 注意:不能在这里调用 base.DeleteConnection(participantId)否则会给每个Participant发送disconnect
// 导致服务器返回多次通知。应该只发一次disconnect关闭房间Participant的清理由服务器通知触发。
foreach (var participantId in participantIds.ToList())
{
DisconnectParticipant(participantId);
@@ -152,10 +154,10 @@ namespace Unity.RenderStreaming
if (m_participantStreams.TryGetValue(participantId, out var ps))
{
// 移除Sender关联
foreach (var sender in streams.OfType<IStreamSender>())
{
RemoveSender(participantId, sender);
}
// foreach (var sender in streams.OfType<IStreamSender>())
// {
// RemoveSender(participantId, sender);
// }
// 移除Receiver关联
if (ps.videoReceiver != null)
RemoveReceiver(participantId, ps.videoReceiver);