UNPKG

@svta/common-media-library

Version:
25 lines 1.03 kB
import { createMediaKeySystemConfiguration } from './createMediaKeySystemConfiguration.js'; import { getSupportedKeySystemConfiguration } from './getSupportedKeySystemConfiguration.js'; /** * Fallback method to get key system access using legacy MediaKeys.isTypeSupported(). * * @param requests - An array of key system access requests. * @returns A KeySystemAccess object if successful, or null if no system is supported. * * @group DRM * @beta */ export function getLegacyKeySystemAccess(requests) { for (const { keySystem, configurations } of requests) { const supportedConfig = getSupportedKeySystemConfiguration(keySystem, configurations); if (supportedConfig) { const configuration = createMediaKeySystemConfiguration(supportedConfig.supportedAudio, supportedConfig.supportedVideo); return { keySystem, configurations: [configuration], }; } } return null; } //# sourceMappingURL=getLegacyKeySystemAccess.js.map