Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // это при нажатии юзером кнопки вкл/выкл камеры
- ui.videoToggle.setOnCheckedChangeListener { _, b ->
- if (!b) {
- ui.localStream.clearImage()
- localVideoTrack?.removeSink(ui.localStream)
- }
- liveStream!!.setLocalVideo(b)
- ui.groupInfo.visible(!b)
- ui.switchCameraToggle.visible(b)
- }
- // сюда прилетает стрим
- private fun onGetLocalStream(track: VideoTrack, eglContext: EglBase.Context) {
- globalMain {
- if (ui.videoToggle.isChecked)
- ui.groupInfo.gone()
- localVideoTrack = track
- ui.localStream.release()
- ui.localStream.init(eglContext, null)
- ui.localStream.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL)
- track.addSink(ui.localStream)
- }
- }
- // это логи при вкл камеры
- I/org.webrtc.Logging: Camera2Session: Camera opened.
- I/org.webrtc.Logging: Camera2Session: Camera capture session configured.
- I/org.webrtc.Logging: Camera2Session: Using video stabilization.
- I/org.webrtc.Logging: Camera2Session: Auto-focus is not available.
- I/org.webrtc.Logging: Camera2Session: Camera device successfully started.
- I/org.webrtc.Logging: CameraCapturer: Create session done. Switch state: IDLE
Advertisement
Add Comment
Please, Sign In to add comment