Skip to content

Commit

Permalink
fix : kvs 수정 (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmatches committed Dec 11, 2024
1 parent 28d4356 commit 8b8549c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
2 changes: 0 additions & 2 deletions app/src/main/java/com/example/mhnfe/data/remote/api/QRApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package com.example.mhnfe.data.remote.api

import com.example.mhnfe.data.remote.request.CctvQRRequest
import com.example.mhnfe.data.remote.request.ViewerQRRequest
import com.example.mhnfe.data.remote.response.CctvInfoResponse
import com.example.mhnfe.data.remote.response.CctvQRResponse
import com.example.mhnfe.data.remote.response.CctvSelfInfoResponse
import com.example.mhnfe.data.remote.response.ViewerQRResponse
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Path

interface QRApi {
@POST("/api/cctv-device")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1583,9 +1583,12 @@ class KVSSignalingViewModel : ViewModel() {
}

private var isBackCamera = false
private val _isCameraSwitching = MutableStateFlow(false)
val isCameraSwitching: StateFlow<Boolean> = _isCameraSwitching

fun switchCamera(context: Context) {
viewModelScope.launch {
_isCameraSwitching.value = true
try {
(videoCapturer as? CameraVideoCapturer)?.let { capturer ->
val enumerator = Camera1Enumerator(false)
Expand Down Expand Up @@ -1625,6 +1628,8 @@ class KVSSignalingViewModel : ViewModel() {
}
} catch (e: Exception) {
Log.e("Camera", "카메라 전환 중 에러 발생", e)
} finally {
_isCameraSwitching.value = false
}
}
}
Expand Down Expand Up @@ -1716,26 +1721,6 @@ class KVSSignalingViewModel : ViewModel() {
}
}
}
private val _isAudioEnabled = MutableStateFlow(true)
val isAudioEnabled = _isAudioEnabled.asStateFlow()

fun toggleAudio() {
viewModelScope.launch {
_isAudioEnabled.value = !_isAudioEnabled.value
// remoteAudioTrack의 상태를 업데이트
_remoteVideoTrack.value?.let { track ->
track.setEnabled(_isAudioEnabled.value)
}
val audioManager = applicationContext?.getSystemService(Context.AUDIO_SERVICE) as? AudioManager
if (_isAudioEnabled.value) {
audioManager?.mode = AudioManager.MODE_IN_COMMUNICATION
audioManager?.isSpeakerphoneOn = true
} else {
audioManager?.isSpeakerphoneOn = false
}
}
}

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fun ProfileScreen(
}
exitGroupResponse?.let {
if (it.isSuccessful) {
mainNavController.navigate(NavRoutes.Auth.Main.route) {
mainNavController.navigate(NavRoutes.Auth.Select.route) {
popUpTo(NavRoutes.Main.route) { inclusive = true }
}
}
Expand Down Expand Up @@ -342,13 +342,3 @@ fun ProfileScreen(
}
}
}

//@Preview(showBackground = true)
//@Composable
//private fun ProfileScreenPreview() {
// val navController = rememberNavController()
// ProfileScreen(
// bottomNavController = navController,
// mainNavController = navController
// )
//}

0 comments on commit 8b8549c

Please sign in to comment.