Skip to content

Commit 2adecaf

Browse files
committed
SoraMediaChannel での onDisconnect の仮組み
1 parent cbf027a commit 2adecaf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sora/MediaChannel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ public final class MediaChannel {
414414
Logger.debug(type: .mediaChannel, message: "call onDisconnect")
415415
internalHandlers.onDisconnectLegacy?(error)
416416
handlers.onDisconnectLegacy?(error)
417+
if let error {
418+
handlers.onDisconnect?(SoraCloseEvent.error(error))
419+
} else {
420+
handlers.onDisconnect?(SoraCloseEvent.ok(code: 1000, reason: "NO-ERROR"))
421+
}
417422
}
418423
}
419424

0 commit comments

Comments
 (0)