How to pause/resume receiving streams in a room?
2024-05-11
Products / Plugins:Live Streaming Kit
Platform / Framework:Android
live streaming UIKit (Live Streaming Kit) allows you to pause/resume receiving streams in a room. This operation does not affect other users and only takes effect locally.
Taking "pause receiving streams in the room when the application goes to the background, and resume when returning to the foreground" as an example, the sample code is as follows:
//Activity that added ZegoUIKitPrebuiltLiveStreamingFragment.
public class LiveActivity extends AppCompatActivity {
...
@Override
protected void onStart() {
super.onStart();
ZegoLiveStreamingManager.getInstance().unMuteAllAudioVideo();
}
@Override
protected void onStop() {
super.onStop();
ZegoLiveStreamingManager.getInstance().muteAllAudioVideo();
}