pjsip-android icon indicating copy to clipboard operation
pjsip-android copied to clipboard

[ISSUE] Remote preview lost and surfaceview turn to black when app goes to background and turns to foreground

Open asimhayat67 opened this issue 1 year ago • 0 comments

Describe the bug Remote preview lost and surfaceview turn to black when app goes to background and turns to foreground

Lib version 2.1

Smartphone (please complete the following information):

  • Device: Android
  • OS: 13

Additional context I have tried with surfaceview callbacks and tried to start preview again but no luck.

below is my code

remotePreviewHolder.addCallback(object : SurfaceHolder.Callback { override fun surfaceCreated(holder: SurfaceHolder) { // The surface is created. This is a good place to start your video preview or perform any drawing operations. }

  override fun surfaceChanged(
    surfaceHolder: SurfaceHolder,
    format: Int,
    width: Int,
    height: Int
  ) {
    SipServiceCommand.setupIncomingVideoFeed(
      this@CallActivity,
      SipService.mAccountID,
      SipService.mCallID,
      surfaceHolder.surface
    )

  }

  override fun surfaceDestroyed(holder: SurfaceHolder) {
     SipServiceCommand.setupIncomingVideoFeed(
       this@CallActivity, SipService.mAccountID, SipService.mCallID, holder.surface
     )
  }
})

asimhayat67 avatar Jul 25 '23 11:07 asimhayat67