onPinStateChanged

fun onPinStateChanged(pinStateData: JSONObject)

Called when a participant's pin state changes.

The pinStateData object contains:

  • "peerId" — the ID of the participant whose pin state changed
  • "state" — a JSON object with "cam" and "share" boolean fields
  • "pinnedBy" — the ID of the participant who performed the pin/unpin action

Code Example:


override fun onPinStateChanged(pinStateData: JSONObject) {
    val peerId = pinStateData.optString("peerId")
    val state = pinStateData.optJSONObject("state")
    val camPinned = state != null && state.optBoolean("cam")
    val sharePinned = state != null && state.optBoolean("share")
    Log.d("Meeting", "Pin state for $peerId" +
        " - cam: $camPinned, share: $sharePinned")
}

Parameters

pinStateData

a JSONObject with pin state information

See also

Participant.unpin()