Pause/Resume Video Stream - Android
Whenver you wish to stop/resume downlaod stream(webcam, screenShare and mic) of participant, you can simply do it by using pause
, resume
methods.
Pause video stream​
pause()
method is used for pause stream(webcam, screenShare and mic) of a particular participant.
- Kotlin
- Java
btnPause!!.setOnClickListener { _: View? ->
for ((_, stream) in participant.streams) {
stream.pause()
}
}
btnPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (Map.Entry<String, Stream> entry : participant.getStreams().entrySet()) {
Stream stream = entry.getValue();
stream.pause();
}
}
});
Resume video stream​
resume()
method is used to resume stream(webcam, screenShare and mic) of a particular participant.
- Kotlin
- Java
btnResume!!.setOnClickListener { _: View? ->
for ((_, stream) in participant.streams) {
stream.resume()
}
}
btnResume.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (Map.Entry<String, Stream> entry : participant.getStreams().entrySet()) {
Stream stream = entry.getValue();
stream.resume();
}
}
});
Got a Question? Ask us on discord