unified-video-framework
Version:
Cross-platform video player framework supporting iOS, Android, Web, Smart TVs (Samsung/LG), Roku, and more
24 lines • 742 B
JavaScript
export class BaseDRM {
constructor(video, config, debug = false) {
this.video = video;
this.config = config;
this.debug = debug;
}
getHLSConfig() { return {}; }
getDashProtectionData() { return {}; }
log(...args) {
if (this.debug)
console.log('[DRM]', ...args);
}
async requestLicense(url, body, headers) {
const resp = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/octet-stream', ...(headers || {}) },
body,
});
if (!resp.ok)
throw new Error(`License request failed: HTTP ${resp.status}`);
return resp.arrayBuffer();
}
}
//# sourceMappingURL=BaseDRM.js.map