6. DRM License Renewal
This document is a machine-translated draft and is currently undergoing review. Some content may be inaccurate or differ from the original Korean version. For the most precise information, refer to the Korean documentation.
Explains how to determine whether DRM has expired for downloaded content stored in offline storage, and how to safely renew expired licenses in real time or in bulk.
All example code in this document is based on the official sample app, kollus_player_v2_android.
Check license expiration
Reference code for checking the DRM expiration status of a content object in advance to determine whether to initiate the renewal process.
KollusContent c = ...;
boolean expired =
c.getDrmExpireDate() < System.currentTimeMillis()
|| c.getDrmExpirePlayTime() <= 0
|| c.getDrmExpireCount() >= c.getDrmExpireCountMax();
Batch license renewal API
Using the updateDownloadDRMInfo method, you can renew the DRM licenses of all content registered in storage at once.
When the method is called, the renewal progress, completion status, and error results for each content item are notified to the application layer through the injected KollusPlayerDRMUpdateListener callback loop.
multiStorage.updateDownloadDRMInfo(
diskIndex, // Physical storage index (-1 to renew all disks)
drmUpdateListener, // KollusPlayerDRMUpdateListener object to receive renewal events
bAll); // true: force renew all content in the list / false: renew only expired content
Background renewal restrictions
Due to Android's Doze mode and App Standby battery optimization policies, uninterrupted license renewal in the background when the app is not visible on screen may be restricted. The following patterns are recommended for stable integration.
- Use foreground service: Call the renewal API together at the point when a foreground service is already active because a download task is in progress.
- Use foreground transition timing: Run the renewal process when the user relaunches the app or activates the screen.
You can also attempt background renewal by combining the WorkManager component with a periodic work structure, but the exact execution timing is not guaranteed depending on the OS specifications.
For service stability, the most reliable approach is to check expiration status immediately before the user plays a video and call the API synchronously.
Auto-renewal after network recovery
The official sample app does not include built-in logic for automatic license renewal upon network recovery. When developing a commercial service, it is recommended to implement exception handling code using the following flow.
- Register a
ConnectivityManager.NetworkCallbacksystem signal to detect when the device's network is restored. - Check the license status of the target content when the user taps the play button in the offline library.
- If expiration is confirmed, immediately call the
updateDownloadDRMInfomethod to complete license renewal before safely playing the media.
Exception handling for license renewal failures
If license renewal ultimately fails due to a server failure or network interruption, the SDK notifies the exception through one of the following two paths.
- When an abnormal response (
response) value is received as a response parameter in theMultiKollusPlayerDRMListener.onDRM(storage, request, response)callback - When a remote force control code,
DCB_INFO_DELETE(force delete) orDCB_INFO_EXPIRED(force expire), is received via theMultiKollusPlayerDRMListener.onDRMInfocallback
When a license renewal failure signal is detected, display an exception message on screen such as "License renewal failed. Please check your network status or re-download the content.", and connect the user to a UI branch for Retry / Re-download / Customer support according to their choice. For information on the types of detailed callbacks, refer to the 8. Download Events/Callbacks document.