正在显示
1 个修改的文件
包含
9 行增加
和
0 行删除
| @@ -171,6 +171,10 @@ internal constructor( | @@ -171,6 +171,10 @@ internal constructor( | ||
| 171 | if (enabled) { | 171 | if (enabled) { |
| 172 | if (pub != null) { | 172 | if (pub != null) { |
| 173 | pub.muted = false | 173 | pub.muted = false |
| 174 | + | ||
| 175 | + if (source == Track.Source.CAMERA && pub.track is LocalVideoTrack) { | ||
| 176 | + (pub.track as? LocalVideoTrack)?.startCapture() | ||
| 177 | + } | ||
| 174 | } else { | 178 | } else { |
| 175 | when (source) { | 179 | when (source) { |
| 176 | Track.Source.CAMERA -> { | 180 | Track.Source.CAMERA -> { |
| @@ -199,6 +203,11 @@ internal constructor( | @@ -199,6 +203,11 @@ internal constructor( | ||
| 199 | unpublishTrack(track) | 203 | unpublishTrack(track) |
| 200 | } else { | 204 | } else { |
| 201 | pub.muted = true | 205 | pub.muted = true |
| 206 | + | ||
| 207 | + // Release camera session so other apps can use. | ||
| 208 | + if (pub.source == Track.Source.CAMERA && track is LocalVideoTrack) { | ||
| 209 | + track.stopCapture() | ||
| 210 | + } | ||
| 202 | } | 211 | } |
| 203 | } | 212 | } |
| 204 | } | 213 | } |
-
请 注册 或 登录 后发表评论