Skip to content

Commit d0573cc

Browse files
committed
クロージャ引数名修正
1 parent f54bc19 commit d0573cc

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Sora/VideoMute.swift

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,24 @@ actor VideoHardMuteActor {
5050

5151
// 現在のカメラキャプチャラーを取得します
5252
private func currentCameraVideoCapturer() async -> CameraVideoCapturer? {
53-
await withCheckedContinuation { cont in
54-
SoraDispatcher.async(on: .camera) { cont.resume(returning: CameraVideoCapturer.current) }
53+
await withCheckedContinuation { continuation in
54+
SoraDispatcher.async(on: .camera) {
55+
continuation.resume(returning: CameraVideoCapturer.current)
56+
}
5557
}
5658
}
5759

5860
// カメラキャプチャを停止します
5961
private func stopCameraVideoCapture(_ capturer: CameraVideoCapturer) async throws {
60-
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<Void, Error>) in
62+
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in
6163
SoraDispatcher.async(on: .camera) {
6264
// CameraVideoCapturer.stop はコールバック形式です
6365
capturer.stop { error in
64-
if let error { cont.resume(throwing: error) } else { cont.resume(returning: ()) }
66+
if let error {
67+
continuation.resume(throwing: error)
68+
} else {
69+
continuation.resume(returning: ())
70+
}
6571
}
6672
}
6773
}
@@ -72,13 +78,17 @@ actor VideoHardMuteActor {
7278
_ capturer: CameraVideoCapturer,
7379
senderStream: MediaStream
7480
) async throws {
75-
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<Void, Error>) in
81+
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in
7682
SoraDispatcher.async(on: .camera) {
7783
// マルチストリームの場合、停止時と現在の送信ストリームが異なることがあるので再設定します
7884
capturer.stream = senderStream
7985
// CameraVideoCapturer.restart はコールバック形式です
8086
capturer.restart { error in
81-
if let error { cont.resume(throwing: error) } else { cont.resume(returning: ()) }
87+
if let error {
88+
continuation.resume(throwing: error)
89+
} else {
90+
continuation.resume(returning: ())
91+
}
8292
}
8393
}
8494
}

0 commit comments

Comments
 (0)