static async canCastDisplayType_(videoConfig) {
    if (!(window.cast &&
        cast.__platform__ && cast.__platform__.canDisplayType)) {
      shaka.log.warning('Expected cast APIs to be available! Falling back to ' +
          'shaka.media.Capabilities.isTypeSupported() for type support.');
      return shaka.media.Capabilities.isTypeSupported(videoConfig.contentType);
    }

    let displayType = videoConfig.contentType;
    if (videoConfig.width && videoConfig.height) {
      // All Chromecast can support 720p videos
      if (videoConfig.width > 1280 && videoConfig.height > 720) {
        displayType +=
            `; width=${videoConfig.width}; height=${videoConfig.height}`;
      }
    }
    if (videoConfig.framerate) {
      // All Chromecast can support a framerate of 24, 25 or 30.
      const framerate = Math.round(videoConfig.framerate);
      if (framerate < 24 || framerate > 30) {
        displayType += `; framerate=${videoConfig.framerate}`;
      }
    }

    // Don't trust Closure types here.  Although transferFunction is string or
    // undefined, we don't want to count on the input type.  A switch statement
    // will, however, differentiate between null and undefined.  So we default
    // to a blank string.
    const transferFunction = videoConfig.transferFunction || '';

    // Based on internal sources.  Googlers, see go/cast-hdr-queries for source.
    switch (transferFunction) {
      // The empty case falls through to SDR.
      case '':
      // These are the only 3 values defined by MCap as of November 2024.
      case 'srgb':
        // https://en.wikipedia.org/wiki/Standard-dynamic-range_video
        // https://en.wikipedia.org/wiki/SRGB
        // https://en.wikipedia.org/wiki/Rec._709
        // This is SDR, standardized in BT 709.
        // The platform recognizes "eotf=bt709", but we can also omit it.
        break;

      case 'pq':
        // https://en.wikipedia.org/wiki/Perceptual_quantizer
        // This HDR transfer function is standardized as SMPTE ST 2084.
        displayType += '; eotf=smpte2084';
        break;

      case 'hlg':
        // https://en.wikipedia.org/wiki/Hybrid_log%E2%80%93gamma
        // This HDR transfer function is standardized as ARIB STD-B67.
        displayType += '; eotf=arib-std-b67';
        break;

      default:
        // An unrecognized transfer function.  Reject this query.
        return false;
    }

    let result = false;
    const memoizedCanDisplayTypeRequests =
        shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_;
    if (memoizedCanDisplayTypeRequests.has(displayType)) {
      result = memoizedCanDisplayTypeRequests.get(displayType);
    } else {
      result = await cast.__platform__.canDisplayType(displayType);
      memoizedCanDisplayTypeRequests.set(displayType, result);
    }
    return result;
  }
Checks if the given media parameters of the video or audio streams are
supported by the Cast platform.
@param {!VideoConfiguration} videoConfig The 'video' field of the
  MediaDecodingConfiguration.
@return {!Promise<boolean>} `true` when the stream can be displayed on a
  Cast device.
@private