createCustomerData method

Map<String, dynamic> createCustomerData(
  1. Map<String, String>? trackingData,
  2. Map<String, dynamic>? providedData
)

Implementation

Map<String, dynamic> createCustomerData(
    Map<String, String>? trackingData, Map<String, dynamic>? providedData) {
  var videoData = VideoData();
  videoData[VideoEventJSONKeys.cloudName.name] =
      trackingData?[VideoEventJSONKeys.cloudName.name] ?? '';
  videoData[VideoEventJSONKeys.publicId.name] =
      trackingData?[VideoEventJSONKeys.publicId.name] ?? '';

  var result = {VideoEventJSONKeys.videoData.name: videoData};

  if (providedData != null && providedData.isNotEmpty) {
    var providedDataObject = <String, dynamic>{};
    providedData.forEach((key, value) {
      providedDataObject[key] = value;
    });
    result[VideoEventJSONKeys.providedData.name] = providedDataObject;
  }

  return result;
}