Cache_Objc
@objc(THEOplayerCache)
public protocol Cache_Objc
The caching API allows to store a streaming source on the user’s device.
-
Indicates the
CacheStatus
.Declaration
Swift
var status: CacheStatus { get }
-
The list of all caching tasks.
Remark
The list should be regarded as read-only. To remove a task, invokeCachingTask.remove()
.Declaration
Swift
@objc(tasks) var tasks_Objc: [CachingTask_Objc] { get }
-
Creates a
CachingTask
which will be used to cache the provided source, abiding to the provided parameters.Declaration
Swift
@discardableResult @objc(createTaskWithSource:parameters:) func createTask_Objc(source: SourceDescription, parameters: CachingParameters?) -> CachingTask_Objc?
Parameters
source
The source to be cached.
parameters
The optional caching parameters.
Return Value
The created
CachingTask
. -
Adds the event listener of the given
EventType
.Remark
When attaching a listener on the wrong object the application will crash.
Declaration
Swift
@discardableResult func addEventListener(type: String, listener: @escaping (CacheEvent) -> ()) -> EventListener
Parameters
type
EventType
of the added event listener. SeeCacheEventTypes
for possible values.listener
Closure called when event is dispatched.
Return Value
The newly added
EventListener
. -
Removes the event listener for the given
EventType
.Declaration
Swift
func removeEventListener(type: String, listener: EventListener)
Parameters
type
EventType
of the event listener to be removed. SeeCacheEventTypes
for possible values.listener
EventListener
which was added byaddEventListener(...)
.