buildEnablePipJsonParams method

String buildEnablePipJsonParams(
  1. bool enable,
  2. String roomId
)

Implementation

String buildEnablePipJsonParams(bool enable, String roomId) {
  Map<String, dynamic> jsonObject = {
    'api': 'enablePictureInPicture',
    'params': {
      "room_id": roomId,
      "enable": enable,
      "camBackgroundCapture": true,
      "canvas": {"width": 720, "height": 1280, "backgroundColor": "#000000"},
      "regions": [
        {
          "userId": "",
          "userName": "",
          "width": 1.0,
          "height": 1.0,
          "x": 0.0,
          "y": 0.0,
          "streamType": "high",
          "backgroundColor": "#000000",
          "backgroundImage": "" // /path/to/user1_placeholder.png
        }
      ]
    }
  };
  final jsonString = jsonEncode(jsonObject);
  return jsonString;
}