KollusStorage
KollusStorage Class
com.kollus.sdk.media.KollusStorage
A storage management class that oversees content download, cache management, DRM information updates, and various event listeners.
Interfaces
interface DrmSessionManagerListenerinterface OnKollusStorageDeviceListenerinterface OnKollusStorageListener
Public Methods
KollusStorage(Context context)void cancelLoad()int checkLiveStream(String url)void clearCache()String decrypt(String encData)int download(String mediaContentKey)void finish()ArrayList<KollusContent> getDownloadContentList()KollusContent getDownloadKollusContent(String path)boolean getKollusContent(KollusContent content, String mediaContentKey) throws IllegalStateExceptionString getLastError()long getNativeInstance()String getRootPath()long getUsedSize(int type)String getVersion()int initialize(String key, String expireDate, String packageName)boolean isReady()int load(String path, String extraDrmParam, KollusContent content)void registerDrmSessionManagerListenerList(DrmSessionManagerListener listener)void registerKollusPlayerCallbackListener(KollusPlayerCallbackListener listener)void registerKollusPlayerDRMListener(KollusPlayerDRMListener listener)void registerKollusPlayerThumbnailListener(KollusPlayerThumbnailListener listener)void registerKollusStorageListener(OnKollusStorageListener listener)synchronized void releaseInstance()int remove(String mediaContentKey)void removeDrmSessionManagerListenerList(DrmSessionManagerListener listener)void sendStoredLMS(StoredLMSListener listener)void setCacheSize(int cacheSizeMB)int setDevice(String storagePath, boolean bTablet)void setDeviceASync(String storagePath, boolean bTablet, OnKollusStorageDeviceListener listener)void setNetworkTimeout(int timeout, int retryCount)int unload(String mediaContentKey)void unregisterKollusPlayerCallbackListener(KollusPlayerCallbackListener listener)void unregisterKollusPlayerDRMListener(KollusPlayerDRMListener listener)void unregisterKollusPlayerThumbnailListener(KollusPlayerThumbnailListener listener)void unregisterKollusStorageListener(OnKollusStorageListener listener)void updateDownloadDRMInfo(KollusPlayerDRMUpdateListener listener, boolean bAll)void updateDownloadDRMInfo(KollusPlayerDRMUpdateListener listener, ArrayList<String> mckList)
Static Public Methods
static synchronized KollusStorage getInstance(Context context)
Static Public Properties
static final int TYPE_CACHE = 0static final int TYPE_DOWNLOAD = 1static final int TYPE_ALL = 2
Protected Methods
int downloadFile(String srcPath, String dstPath)int downloadThumbnail(String srcPath, String dstPath)String getCallback(String customer, String callbackUrl, String postData)String getMediaInfoJson(Uri uri)String getNoKollusDownloadPath()String getNoKollusStreamPath()void registerKollusPlayerLMSListener(KollusPlayerLMSListener listener)void sendCallback(String customer, String url)void unregisterKollusPlayerLMSListener(KollusPlayerLMSListener listener)
Method Details
void com.kollus.sdk.media.KollusStorage.cancelLoad()
Cancels the currently ongoing load operation. When canceling a download, call this method first and then perform unload.
int com.kollus.sdk.media.KollusStorage.checkLiveStream(String url)
Checks whether the given path is a currently active live stream URL.
- Parameters
url: View URL
- Returns: Live stream status code
void com.kollus.sdk.media.KollusStorage.clearCache()
Deletes all temporary cache data used during streaming playback. (Downloaded content is not deleted.)
int com.kollus.sdk.media.KollusStorage.download(String mediaContentKey)
Starts a download using the media content key of the loaded content.
- Parameters
mediaContentKey: Media content key
- Returns: Error code (see: Error Codes)
void com.kollus.sdk.media.KollusStorage.finish()
Releases storage resources in the native layer.
ArrayList<KollusContent> com.kollus.sdk.media.KollusStorage.getDownloadContentList()
Returns the full list of currently downloaded content.
- Returns: List of downloaded content
KollusContent com.kollus.sdk.media.KollusStorage.getDownloadKollusContent(String path)
Retrieves the download content information for the specified path.
- Parameters
path: Content path
- Returns: Content information
static synchronized KollusStorage com.kollus.sdk.media.KollusStorage.getInstance(Context context)
Returns the singleton instance of KollusStorage.
- Parameters
context: Application context
- Returns:
KollusStorageinstance
boolean com.kollus.sdk.media.KollusStorage.getKollusContent(KollusContent content, String mediaContentKey) throws IllegalStateException
Retrieves specific content information using a media content key.
- Parameters
content: Empty object to hold the informationmediaContentKey: Media content key
- Returns: Whether the information was successfully retrieved
String com.kollus.sdk.media.KollusStorage.getLastError()
Returns the message of the last error that occurred.
- Returns: Error message
String com.kollus.sdk.media.KollusStorage.getMediaInfoJson(Uri uri)
Internal SDK Only Retrieves the media information of the specified URI in JSON format.
- Parameters
uri: Media URI
- Returns: Media information (JSON data)
long com.kollus.sdk.media.KollusStorage.getNativeInstance()
Returns the actual instance handle (pointer) value of the KollusStorage engine managed in the native layer.
- Returns: Native instance address value (Handle)
String com.kollus.sdk.media.KollusStorage.getRootPath()
Returns the currently configured root path for content storage.
- Returns: Currently configured storage location path
long com.kollus.sdk.media.KollusStorage.getUsedSize(int type)
Retrieves the total storage usage for the specified data type.
- Parameters
typeTYPE_CACHE(0): Cache size generated during streaming playbackTYPE_DOWNLOAD(1): Total size of downloaded content stored locallyTYPE_ALL(2): Total size of all types
- Returns: Total storage currently in use
String com.kollus.sdk.media.KollusStorage.getVersion()
Returns the version information of the SDK library.
- Returns: SDK version
int com.kollus.sdk.media.KollusStorage.initialize(String key, String expireDate, String packageName)
Initializes the SDK library.
- Parameters
key: Issued keyexpireDate: Expiration date (YYYY/MM/DD)packageName: App package name
- Returns: Error code (see: Error Codes)
boolean com.kollus.sdk.media.KollusStorage.isReady()
Checks whether the storage manager is in a ready state (device configuration complete).
- Returns
true: Availablefalse: Not available
int com.kollus.sdk.media.KollusStorage.load(String path, String extraDrmParam, KollusContent content)
Loads the content information to be downloaded.
- Parameters
path: Path of the content to downloadextraDrmParam: Dynamic DRM download callback / playback callback argumentcontent: Object to hold the information
- Returns: Error code (see: Error Codes)
void com.kollus.sdk.media.KollusStorage.registerKollusPlayerCallbackListener(KollusPlayerCallbackListener listener)
Registers a KollusPlayerCallbackListener.
- Parameters
listener: Listener instance to handle events
void com.kollus.sdk.media.KollusStorage.registerKollusPlayerDRMListener(KollusPlayerDRMListener listener)
Registers a KollusPlayerDRMListener.
- Parameters
listener: Listener instance to handle events
void com.kollus.sdk.media.KollusStorage.registerKollusPlayerLMSListener(KollusPlayerLMSListener listener)
Registers a KollusPlayerLMSListener.
- Parameters
listener: Listener instance to handle events
void com.kollus.sdk.media.KollusStorage.registerKollusPlayerThumbnailListener(KollusPlayerThumbnailListener listener)
Registers a KollusPlayerThumbnailListener.
- Parameters
listener: Listener instance to handle events
void com.kollus.sdk.media.KollusStorage.registerKollusStorageListener(OnKollusStorageListener listener)
Registers an OnKollusStorageListener.
- Parameters
listener: Listener instance to handle events
synchronized void com.kollus.sdk.media.KollusStorage.releaseInstance()
Explicitly releases the resources of the KollusStorage instance in use.
int com.kollus.sdk.media.KollusStorage.remove(String mediaContentKey)
Deletes downloaded content stored locally.
- Parameters
mediaContentKey: Media content key
- Returns: Error code (see: Error Codes)
void com.kollus.sdk.media.KollusStorage.sendStoredLMS(StoredLMSListener listener)
Batch-sends locally stored LMS data that could not be transmitted due to network issues or other problems.
- Parameters
listener: Listener instance to handle events
void com.kollus.sdk.media.KollusStorage.setCacheSize(int cacheSizeMB)
Sets the cache memory size to use during streaming. Must be configured before calling setDevice or setDeviceASync.
- Parameters
cacheSizeMB: Cache size (MB)
int com.kollus.sdk.media.KollusStorage.setDevice(String storagePath, boolean bTablet)
Sets the storage root path and device type.
- Parameters
storagePath: Root path to be used by the storage managerbTablet: Whether the device is a tablet (true: tablet)
void com.kollus.sdk.media.KollusStorage.setDeviceASync(String storagePath, boolean bTablet, OnKollusStorageDeviceListener listener)
Performs storage configuration asynchronously.
- Parameters
storagePath: Root path to be used by the storage managerbTablet: Whether the device is a tablet (true: tablet)listener: Listener instance to receive configuration completion events
void com.kollus.sdk.media.KollusStorage.setNetworkTimeout(int timeout, int retryCount)
Sets the network Timeout duration and retry count.
- Parameters
timeout: Time limit (sec)retryCount: Number of retries when a Timeout occurs
int com.kollus.sdk.media.KollusStorage.unload(String mediaContentKey)
Releases the loaded index. Call this after cancelLoad when canceling a download.
- Parameters
mediaContentKey: Media content key
- Returns: Error code (see: Error Codes)
void com.kollus.sdk.media.KollusStorage.unregisterKollusPlayerCallbackListener(KollusPlayerCallbackListener listener)
Unregisters a KollusPlayerCallbackListener.
- Parameters
listener: Listener instance to unregister
void com.kollus.sdk.media.KollusStorage.unregisterKollusPlayerDRMListener(KollusPlayerDRMListener listener)
Unregisters a KollusPlayerDRMListener.
- Parameters
listener: Listener instance to unregister
void com.kollus.sdk.media.KollusStorage.unregisterKollusPlayerLMSListener(KollusPlayerLMSListener listener)
Unregisters a KollusPlayerLMSListener.
- Parameters
listener: Listener instance to unregister
void com.kollus.sdk.media.KollusStorage.unregisterKollusPlayerThumbnailListener(KollusPlayerThumbnailListener listener)
Unregisters a KollusPlayerThumbnailListener.
- Parameters
listener: Listener instance to unregister
void com.kollus.sdk.media.KollusStorage.unregisterKollusStorageListener(OnKollusStorageListener listener)
Unregisters an OnKollusStorageListener.
- Parameters
listener: Listener instance to unregister
void com.kollus.sdk.media.KollusStorage.updateDownloadDRMInfo(KollusPlayerDRMUpdateListener listener, boolean bAll)
Batch-updates DRM information for all content or only expired content.
- Parameters
listener: Interface instance for receiving update progress status and resultsbAll: Update scope setting (true: all content,false: expired content only)
void com.kollus.sdk.media.KollusStorage.updateDownloadDRMInfo(KollusPlayerDRMUpdateListener listener, ArrayList<String> mckList)
Updates DRM for content corresponding to a specific list of media content keys.
- Parameters
listener: Interface instance for receiving update progress status and resultsmckList: List of media content keys to update
Property Details
| Property | Value | Description |
|---|---|---|
TYPE_CACHE | 0 | Cache data generated during streaming playback |
TYPE_DOWNLOAD | 1 | Downloaded content data stored in local storage |
TYPE_ALL | 2 | All types of data (cache + download) |
OnKollusStorageDeviceListener Interface
com.kollus.sdk.media.KollusStorage.OnKollusStorageDeviceListener
An interface for receiving the progress status of the storage device configuration process initiated by calling the setDeviceASync method.
Public Methods
void onDeviceSettingEnd()void onDeviceSettingError(int nErrorCode)void onDeviceSettingStart()
Method Details
void com.kollus.sdk.media.KollusStorage.OnKollusStorageDeviceListener.onDeviceSettingEnd()
Called when the device configuration and initialization process has completed successfully.
void com.kollus.sdk.media.KollusStorage.OnKollusStorageDeviceListener.onDeviceSettingError(int nErrorCode)
Called when an error occurs during the device configuration process. (e.g., insufficient permissions to create required directories at the specified path, or insufficient storage space)
- Parameters
nErrorCode: Identification code of the error that occurred
void com.kollus.sdk.media.KollusStorage.OnKollusStorageDeviceListener.onDeviceSettingStart()
Called when the device configuration process has started.
OnKollusStorageListener Interface
com.kollus.sdk.media.KollusStorage.OnKollusStorageListener
An interface for receiving events related to status changes in the content download process (in progress, complete, error occurred).
Public Methods
void onComplete(KollusContent content)void onError(KollusContent content, int errorCode)void onProgress(KollusContent content)
Method Details
void com.kollus.sdk.media.KollusStorage.OnKollusStorageListener.onComplete(KollusContent content)
Called when all data for the content has been successfully saved to local storage.
- Parameters
content: Content information
void com.kollus.sdk.media.KollusStorage.OnKollusStorageListener.onError(KollusContent content, int errorCode)
Called when an unexpected error occurs during the download process and it is interrupted.
- Parameters
content: Content informationerrorCode: Error code
void com.kollus.sdk.media.KollusStorage.OnKollusStorageListener.onProgress(KollusContent content)
Called periodically while the download is in progress.
- Parameters
content: Content information