Minimize audio room window
In-app minimization
With only two simple steps, you can achieve the effect of minimizing the audio room window within the application. Ideally, the final effect will look like this:
Integrate in-app minimization
To display the minimize button, configure the ZegoUIKitPrebuiltLiveAudioRoomConfig
's topMenuBar
, and add the ZegoLiveAudioRoomMenuBarButtonName.minimizingButton
button to the top menu bar.
To achieve the effect of minimizing the window, you need to use the ZegoUIKitPrebuiltLiveAudioRoomMiniOverlayPage
component and insert it into the Overlay
of the app.
When you minimize the interface, if the button is not restricted, clicking the enter button again will enter the live audio room again. To avoid this situation, it is necessary to restrict the button.
Therefore, in the click event of the button, you need to handle it: if it is currently in a minimized state, do not carry out the page jump operation.
After completing the above two steps, you can now minimize the audio room window within the application.
Out-of-app minimization
PIP, also known as Picture In Picture, is a window displayed when the application is in background.
In addition, interactive operations are not allowed at this time, so it is only in viewing mode.
The default value of ZegoLiveAudioRoomPIPConfig.enableWhenBackground
is true, which means the PIP feature is enabled by default. If you don't want to enable it, you can set it to false.
If you want to display the PIP window by clicking a button, you can achieve this by adding ZegoCallMenuBarButtonName.pipButton
to topMenuBar.buttons
.
The final effect will look like this:
Integrate with button
ZegoUIKitPrebuiltLiveAudioRoom(
appID: YourAppID,
appSign: YourAppSign,
userID: userID,
userName: userName,
roomID: roomID,
config: isHost
? ZegoUIKitPrebuiltLiveAudioRoomConfig.host()
: ZegoUIKitPrebuiltLiveAudioRoomConfig.audience()
..pip.enableWhenBackground = true,
..topMenuBar.buttons = [
ZegoLiveAudioRoomMenuBarButtonName.pipButton
],
),
Config
- ZegoLiveAudioRoomPIPConfig
Attribute | Description | Type |
---|---|---|
aspectWidth | aspect width | int |
aspectHeight | aspect height | int |
enableWhenBackground | android: only available on SDK higher than 31(>=31) | bool |
android | android config | ZegoLiveAudioRoomPIPAndroidConfig |
- ZegoLiveAudioRoomPIPAndroidConfig
Attribute | Description | Type |
---|---|---|
background | background widget, default is a black widget | Widget? |
showUserName | show user name or not | bool |
userNameTextColor | text color of user name, default is white | Color? |