@ceeblue/web-utils
    Preparing search index...

    Function createMediaKeySystemConfigurations

    • Helper to create the MediaKeySystem.configurations from :

      • common audio/video content types
      • base configuration (with other parameters)
      • robustness values It generates all combinations of audio and video content types and robustness values, and merges them with the base configuration if provided.

      The returned configurations can be assigned to MediaKeySystem.configurations. When the caller omits capability content types, a DRM implementation may enrich those templates with stream metadata before passing the final configurations to requestMediaKeySystemAccess().

      Example of usage :

      const keySystem: MediaKeySystem = {
      license: 'https://license-server.com/getLicense',
      configurations: createMediaKeySystemConfigurations({
      audioContentTypes: ['audio/mp4; codecs="mp4a.40.2"'],
      videoContentTypes: ['video/mp4; codecs="avc1.640028"', 'video/mp4; codecs="hvc1.1.6.L93.B0"'],
      audioRobustness: ['SW_SECURE_CRYPTO', 'HW_SECURE_CRYPTO'],
      videoRobustness: ['SW_SECURE_DECODE', 'HW_SECURE_DECODE']
      })
      };

      Returns MediaKeySystemConfiguration[]

      An array of MediaKeySystemConfiguration templates.