Advanced Setting - Mute

    Advanced Setting - Mute


    Article summary

    In Shoplive shortform, you can maintain the sound state. The mute function persists in the shortform details.

    Callback for mute button click

    private var isMuted = false
    override func onEvent(command: String, payload: String?) {
        switch (command) {
            case "VIDEO_MUTED":
                isMuted = true
            case "VIDEO_UNMUTED":
                isMuted = false
        }
    }

    Reference

    ShopLiveShortformReceiveHandlerDelegate.onEvent(command: String, payload: String?)

    Passing the mute setting state to the Shoplive shortform preview

    private var isMuted = false
    ShopLiveShortform.showPreview(
        requestData:ShopLiveShortformPreviewData(productId: productId, isMuted: isMuted)
    )
    


    What's Next