UNPKG

@svta/common-media-library

Version:
24 lines 763 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getKeySystemAccess = getKeySystemAccess; /** * Attempts to get key system access using requestMediaKeySystemAccess from EME. * * @param requests - An array of key system access requests. * @returns MediaKeySystemAccess object if successful, or null if no system is supported. * * @group DRM * @beta */ async function getKeySystemAccess(requests) { for (const { keySystem, configurations } of requests) { try { return await navigator.requestMediaKeySystemAccess(keySystem, configurations); } catch { // legacy approach could be used here } } return null; } //# sourceMappingURL=getKeySystemAccess.js.map