logo
On this page

Minimize video call window

With only two simple steps, you can achieve the effect of minimizing the video call window within the application.

Ideally, the final effect will look like this:

Integrate the minimize function into the app

Prepare the environment

  • iOS 15.0 or higher version and iOS devices that support audio and video.

Display the minimize button

To display the minimize button, configure the ZegoUIKitPrebuiltCallConfig's topMenuBarConfig or bottomMenuBarConfig, and add the ZegoMenuBarButtonName.minimizingButton to bottomMenuBarConfig.buttons or topMenuBarConfig.buttons to show a minimize button.

Here is the sample code:

With call invitation
Basic call
//....
ZegoUIKitPrebuiltCallInvitationService.shared.delegate = self
//...
func requireConfig(_ data: ZegoCallInvitationData) -> ZegoUIKitPrebuiltCallConfig {
    if data.type == .voiceCall {
        if data.invitees?.count ?? 0 > 1 {
            let config = ZegoUIKitPrebuiltCallConfig.groupVoiceCall()
            config.topMenuBarConfig.isVisible = true
            config.topMenuBarConfig.buttons = [.minimizingButton]
            return config
        } else {
            let config = ZegoUIKitPrebuiltCallConfig.oneOnOneVoiceCall()
            config.topMenuBarConfig.isVisible = true
            config.topMenuBarConfig.buttons = [.minimizingButton]
            return config
        }
    } else {
        if data.invitees?.count ?? 0 > 1 {
            let config = ZegoUIKitPrebuiltCallConfig.groupVideoCall()
            config.topMenuBarConfig.isVisible = true
            config.topMenuBarConfig.buttons = [.minimizingButton]
            return config
        } else {
            let config = ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall()
            config.topMenuBarConfig.isVisible = true
            config.topMenuBarConfig.buttons = [.minimizingButton]
            return config
        }
    }
}
// ...

1
Copied!
not support yet
//! Since the ViewController is managed by yourself, you need to implement the minimizing logic of the ViewController yourself.
1
Copied!

After completing the above steps, you can now minimize the video call window.

FAQ