mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
eac68c7ea0
Widevine's CDM handles renewal automatically, but FairPlay and PlayReady require manual `session.update()` calls to renew licenses before they expire. Previously, developers had to access internal APIs like `getDrmEngine().activeSessions_` which only works in debug builds - not ideal for production use. Based on the discussion in #9505, this PR implements both Option A and Option C: **Option A - Manual renewal API:** ```js player.renewLicense(); // all sessions player.renewLicense(sessionId); // specific session ``` **Option C - Automatic renewal with config:** ```js player.configure({ drm: { renewalIntervalSec: 600 } }); player.addEventListener('licenserenewal', (event) => { console.log('License renewed:', event.newSessionMetadata, event.oldSessionMetadata); }); ``` This way, developers can choose automatic renewal, manual control, or both depending on their use case. Under the hood, FairPlay sends a 'renew' message via session.update(), while PlayReady re-creates the session. Widevine just dispatches the event since the CDM already handles everything.