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 fun onEvent(context: Context, command: String, payload: String?) {
        when (command) {
            "VIDEO_MUTED" -> {
                isMuted = true
            }
            "VIDEO_UNMUTED" -> {
                isMuted = false
            }
        }
    }

    Reference

    ShopLiveShortformHandler.onEvent(context: Context, command: String, payload: String?)

    Passing the mute setting state to the Shoplive shortform preview

    private var isMuted = false
    ShopLiveShortform.showPreview(
        this@YourActivity,
        ShopLiveShortformPreviewData().apply {
            isMuted = this@YourActivity.isMuted
        })
    

    Reference

    ShopLiveShortformPreview


    What's Next