File tree Expand file tree Collapse file tree 3 files changed +24
-7
lines changed
app/src/main/java/com/haishinkit/app
haishinkit/src/main/java/com/haishinkit Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,12 @@ class CameraViewModel(
146146 Screen .DEFAULT_HEIGHT ,
147147 )
148148 }
149+
150+ Configuration .ORIENTATION_SQUARE -> {
151+ }
152+
153+ Configuration .ORIENTATION_UNDEFINED -> {
154+ }
149155 }
150156 }
151157
Original file line number Diff line number Diff line change @@ -126,8 +126,12 @@ class MediaMixer(
126126 if (video is Camera2Source ) {
127127 video.isTorchEnabled = isToucheEnabled
128128 }
129- return video.open(this ).onSuccess {
130- screen.attachVideo(track, video)
129+ return if (isRunning.get()) {
130+ video.open(this ).onSuccess {
131+ screen.attachVideo(track, video)
132+ }
133+ } else {
134+ Result .success(Unit )
131135 }
132136 }
133137 videoSources.remove(track)?.let {
@@ -173,8 +177,12 @@ class MediaMixer(
173177 orientationEventListener.enable()
174178 startAudioCapturing()
175179 launch {
176- videoSources.values.forEach {
177- it.open(this @MediaMixer)
180+ videoSources.forEach {
181+ val track = it.key
182+ val source = it.value
183+ source.open(this @MediaMixer).onSuccess {
184+ screen.attachVideo(track, source)
185+ }
178186 }
179187 }
180188 isRunning.set(true )
@@ -187,8 +195,11 @@ class MediaMixer(
187195 keepAlive = false
188196 orientationEventListener.disable()
189197 launch {
190- videoSources.values.forEach {
191- it.close()
198+ videoSources.forEach {
199+ val track = it.key
200+ val source = it.value
201+ source.close()
202+ screen.attachVideo(track, null )
192203 }
193204 }
194205 isRunning.set(false )
Original file line number Diff line number Diff line change @@ -57,6 +57,6 @@ data class ScreenObjectSnapshot(
5757 @Serializable
5858 data class Size (
5959 val width : Int ,
60- val height : Int
60+ val height : Int ,
6161 )
6262}
You can’t perform that action at this time.
0 commit comments