Noman khanbhai
Noman khanbhai

Reputation: 581

How to pause and resume video in a programmable video call in twilio in android (JAVA)

I am using twilio Programmable video call. The requirement is when the video call is going on between two participants, ie local participant which is myself and remote participant which is another person on call, if local participant clicks button 'toggle video' or locks the phone then the ongoing video should be paused and when unlocks the phone or presses 'toggle video' again then the video should visible to remote participant, I am able to pause the video when phone locks and resume video when unlocks, the problem is when the video is resumed only local participant (myself) can see it, put remote participant doesn't . How to fixed this, I tried different methods, videoCapturer but nothing worked. Please help!

Upvotes: 0

Views: 554

Answers (1)

Noman khanbhai
Noman khanbhai

Reputation: 581

I figured it out!! for lock and unlock use onPause() and onRestart() when phone locks, onPause() is called, in onPause(){ localVideoTracke.enable(false)}, when phone unlocks onRestart() is called, in onRestart(localVideoTrack.enable(true))

enable() method can be used for pause and resume video during video call, it can be used for both localAudioTrack and localVideoTrack

Upvotes: 1

Related Questions