Guest User

Untitled

a guest
Nov 11th, 2021
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. // это при нажатии юзером кнопки вкл/выкл камеры
  2. ui.videoToggle.setOnCheckedChangeListener { _, b ->
  3. if (!b) {
  4. ui.localStream.clearImage()
  5. localVideoTrack?.removeSink(ui.localStream)
  6. }
  7. liveStream!!.setLocalVideo(b)
  8. ui.groupInfo.visible(!b)
  9. ui.switchCameraToggle.visible(b)
  10. }
  11.  
  12. // сюда прилетает стрим
  13. private fun onGetLocalStream(track: VideoTrack, eglContext: EglBase.Context) {
  14. globalMain {
  15. if (ui.videoToggle.isChecked)
  16. ui.groupInfo.gone()
  17. localVideoTrack = track
  18. ui.localStream.release()
  19. ui.localStream.init(eglContext, null)
  20. ui.localStream.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL)
  21. track.addSink(ui.localStream)
  22. }
  23. }
  24. // это логи при вкл камеры
  25. I/org.webrtc.Logging: Camera2Session: Camera opened.
  26. I/org.webrtc.Logging: Camera2Session: Camera capture session configured.
  27. I/org.webrtc.Logging: Camera2Session: Using video stabilization.
  28. I/org.webrtc.Logging: Camera2Session: Auto-focus is not available.
  29. I/org.webrtc.Logging: Camera2Session: Camera device successfully started.
  30. I/org.webrtc.Logging: CameraCapturer: Create session done. Switch state: IDLE
Advertisement
Add Comment
Please, Sign In to add comment