Keep mute status

    Keep mute status


    Article summary

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

    messageCallback of a 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
            }
        }
    }


    Pass the status settings of Mute to Shoplive Player

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