static commonFairPlayResponse(type, response, context) {
    if (type !== shaka.net.NetworkingEngine.RequestType.LICENSE) {
      return;
    }

    const drmInfo = response.originalRequest.drmInfo;
    if (!drmInfo ||
        !shaka.drm.DrmUtils.isFairPlayKeySystem(drmInfo.keySystem)) {
      return;
    }

    // In Apple's docs, responses can be of the form:
    //   '\n<ckc>base64encoded</ckc>\n' or 'base64encoded'
    // We have also seen responses in JSON format from some of our partners.
    // In all of these text-based formats, the CKC data is base64-encoded.

    let responseText;
    try {
      // Convert it to text for further processing.
      responseText = shaka.util.StringUtils.fromUTF8(response.data);
    } catch (error) {
      // Assume it's not a text format of any kind and leave it alone.
      return;
    }

    let licenseProcessing = false;

    // Trim whitespace.
    responseText = responseText.trim();

    // Look for <ckc> wrapper and remove it.
    if (responseText.substr(0, 5) === '<ckc>' &&
        responseText.substr(-6) === '</ckc>') {
      responseText = responseText.slice(5, -6);
      licenseProcessing = true;
    }

    if (!licenseProcessing) {
      // Look for a JSON wrapper and remove it.
      try {
        const responseObject = /** @type {!Object} */(JSON.parse(responseText));
        if (responseObject['ckc']) {
          responseText = responseObject['ckc'];
          licenseProcessing = true;
        }
        if (responseObject['CkcMessage']) {
          responseText = responseObject['CkcMessage'];
          licenseProcessing = true;
        }
        if (responseObject['License']) {
          responseText = responseObject['License'];
          licenseProcessing = true;
        }
      } catch (err) {
        // It wasn't JSON.  Fall through with other transformations.
      }
    }

    if (licenseProcessing) {
      // Decode the base64-encoded data into the format the browser expects.
      // It's not clear why FairPlay license servers don't just serve this
      // directly.
      response.data = shaka.util.BufferUtils.toArrayBuffer(
          shaka.util.Uint8ArrayUtils.fromBase64(responseText));
    }
  }
Common FairPlay response transform for some DRMs providers.

@param {shaka.net.NetworkingEngine.RequestType} type
@param {shaka.extern.Response} response
@param {shaka.extern.RequestContext=} context
@export