KollusStorage
KollusStorage Class
#import <KollusStorage.h>
A class for managing content download, deletion, and retrieval.
Instance Methods
(BOOL) setKollusPath:(BOOL) startStorage:(BOOL) startStorageWithFirst:error:(BOOL) startStorageWithCheck:(BOOL) startStorageWithNewPlayerID:(NSString *) loadContentURL:error:(NSString *) checkContentURL:error:(BOOL) downloadContent:error:(BOOL) removeContent:error:(BOOL) removeCacheWithError:(BOOL) downloadCancelContent:error:(void) setNetworkTimeOut:retry:(void) updateDownloadDRMInfo:(void) setCacheSize:(void) setBackgroundDownload:(NSMutableArray *) contents(void) sendStoredLms
Properties
id<KollusStorageDelegate> delegateNSString * applicationVersionNSString * applicationDeviceIDNSString * applicationKeyNSString * applicationBundleIDNSString * keychainGroupNSDate * applicationExpireDateNSString * storagePathlong long storageSizelong long cacheDataSizeNSInteger serverPortNSString * extraDrmParamNSString * appUserAgentNSString * deviceType
Method Details
(BOOL) setKollusPath: (NSString *) path
Sets the storage folder path where the Kollus SDK will store content.
- Note: This method should only be used during a new app installation. Changing the existing path will make previously downloaded content inaccessible. Must be set before calling
startStorage. - Parameters
path: The path where content will be stored (default:Document)
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) startStorage: (NSError **) error
Starts KollusStorage.
- Note: If this method is not called, the content information array (
contents) will be returned asnil, making downloaded content inaccessible. - Parameters
error: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) startStorageWithFirst: (BOOL) first error: (NSError **) error
Starts KollusStorage.
- Note: If this method is not called, the content count (
contentsCount) will be returned as 0. Must be called to properly retrieve the list of stored content. - Parameters
first: Whether this is the first launch after app installationerror: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) startStorageWithCheck: (NSError **) error
Starts KollusStorage.
- Note: If this method is not called, the content count (
contentsCount) will be returned as 0. Must be called to properly retrieve the list of stored content. - Player ID handling logic
- On first launch: If no player ID exists in the keychain, a new ID is generated and registered.
- On subsequent launches: Attempts to retrieve the ID from the keychain; returns an error after 3 consecutive failures.
- Parameters
error: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) startStorageWithNewPlayerID: (NSError **) error
Starts KollusStorage.
- Note: If this method is not called, the content count (
contentsCount) will be returned as 0. Must be called to properly retrieve the list of stored content. Since a new player ID is generated and registered in the keychain, use caution when utilizing data dependent on the existing ID. - Parameters
error: Error details
- Return value: Processing result (
YES: success,NO: failure)
(NSString *) loadContentURL: (NSString *) URL error: (NSError **) error
Initializes content download.
- Parameters
URL: Content URLerror: Error details
- Return value: Media content key
(NSString*) checkContentURL: (NSString *) URL error: (NSError **) error
Checks whether the content corresponding to the given URL has been downloaded and retrieves its media content key.
- Parameters
URL: Content URLerror: Error details
- Return value: Media content key if downloaded content exists,
nilotherwise
(BOOL) downloadContent: (NSString *) mediaContentKey error: (NSError **) error
Downloads content using a media content key.
- Parameters
mediaContentKey: Media content keyerror: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) removeContent: (NSString *) mediaContentKey error: (NSError **) error
Deletes specific content.
- Parameters
mediaContentKey: Media content keyerror: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) removeCacheWithError: (NSError **) error
Deletes cached data for streaming content.
- Parameters
error: Error details
- Return value: Processing result (
YES: success,NO: failure)
(BOOL) downloadCancelContent: (NSString *) mediaContentKey error: (NSError **) error
Stops content download.
- Parameters
mediaContentKey: Media content keyerror: Error details
- Return value: Processing result (
YES: success,NO: failure)
(void) setNetworkTimeOut: (NSInteger) timeOut retry: (NSInteger) retryCount
Sets the storage network Timeout.
- Parameters
timeOut: Timeout value (sec)retryCount: Number of retries
(void) updateDownloadDRMInfo: (BOOL) bAll
Updates the DRM content list.
- Parameters
bAll: Whether to update all content (YES: update all content,NO: update only expired content)
(void) setCacheSize: (NSInteger) cacheSizeMB
Sets the storage cache size.
- Parameters
cacheSizeMB: Cache size for streaming content (MB)
(void) setBackgroundDownload: (BOOL) bBackground
Sets whether background download is enabled for storage content.
- Parameters
bBackground: Whether background download is enabled (YES: enabled,NO: disabled)
(NSMutableArray*) contents
Returns an array of downloaded content information.
(void) sendStoredLms
Sends any unsent LMS data.
Property Details
| Property | Description |
|---|---|
(id<KollusStorageDelegate>) delegate[read, write, nonatomic, weak] | Download status delegate |
(NSString*) applicationVersion[read, nonatomic, copy] | Kollus SDK version |
(NSString*) applicationDeviceID[read, nonatomic, copy] | Kollus player device ID |
(NSString*) applicationKey[read, write, nonatomic, copy] | Kollus SDK authentication key (issued by Catenoid) |
(NSString*) applicationBundleID[read, write, nonatomic, copy] | Application Bundle ID (e.g., com.yourcompany.applicationname) |
(NSString*) keychainGroup[read, write, nonatomic, copy] | Keychain group (e.g., com.yourcompany.shared) |
(NSDate*) applicationExpireDate[read, write, nonatomic, copy] | Kollus SDK expiration date (issued by Catenoid) |
(NSString*) storagePath[readonly, nonatomic, copy] | Kollus SDK folder |
(long long) storageSize[read, nonatomic, unsafe_unretained] | Total size of downloaded content (bytes) |
(long long) cacheDataSize[read, nonatomic, unsafe_unretained] | Total size of streaming cache data (bytes) |
(NSInteger) serverPort[read, write, nonatomic, assign] | Port number used in hybrid apps |
(NSString*) extraDrmParam[read, write, nonatomic, copy] | Dynamic DRM parameter |
(NSString*) appUserAgent[read, nonatomic, copy] | User-Agent string to use in HTTP requests |
(NSString*) deviceType[read, nonatomic, copy] | Device type (kp-mobile: mobile, kp-tablet: tablet) |
KollusStorageDelegate Protocol
#import <KollusStorageDelegate.h>
A protocol for receiving download progress status and DRM callback events.
Instance Methods
(void) kollusStorage:downloadContent:error:(void) kollusStorage:request:json:error:(void) kollusStorage:cur:count:error:(void) kollusStorage:lmsData:resultJson:(void) onSendCompleteStoredLms:failCount:
Method Details
(void) kollusStorage: (KollusStorage *) kollusStorage cur: (int) cur count: (int) count error: (NSError *) error
Called when each content update completes during a bulk update of the DRM content list.
- Parameters
kollusStorage:KollusStorageIDcur: Current itemcount: Total number of content itemserror: Error details (error occurred if notnil)
(void) kollusStorage: (KollusStorage *) kollusStorage downloadContent: (KollusContent *) content error: (NSError *) error
Called when a status change occurs during content download.
- Parameters
kollusStorage:KollusStorageIDcontent: Content information with a status changeerror: Error details (error occurred if notnil)
(void) kollusStorage: (KollusStorage *) kollusStorage lmsData: (NSString *) lmsData resultJson: (NSDictionary *) resultJsonLMS
Called after LMS callback processing.
- Parameters
kollusStorage:KollusStorageIDlmsData: LMS dataresultJsonLMS: LMS result information
(void) kollusStorage: (KollusStorage *) kollusStorage request: (NSDictionary *) request json: (NSDictionary *) json error: (NSError *) error
Called after DRM download callback processing.
- Parameters
kollusStorage:KollusStorageIDrequest: Request informationjson: Response dataerror: Error details (error occurred if notnil)
(void) onSendCompleteStoredLms: (int) successCount failCount: (int) failCount
Called after unsent LMS callback completion.
- Parameters
successCount: Number of successful LMS transmissionsfailCount: Number of failed LMS transmissions