![]() |
AliyunPlayer v7.10.0
Aliyun Player API Reference Manual for iOS Platforms
|
媒体预加载管理器。 More...
#include "AliMediaLoaderV2.h"
Instance Methods | |
| (NSString *) | - addTask:listener: |
| 添加一个预加载任务。 | |
| (void) | - cancelTask: |
| 取消指定任务 ID 的加载。 | |
| (void) | - pauseTask: |
| 暂停指定任务 ID 的加载。 | |
| (void) | - resumeTask: |
| 恢复指定任务 ID 的加载。 | |
Class Methods | |
| (instancetype) | + shareInstance |
| 获取 AliMediaLoaderV2 的单例实例。 | |
媒体预加载管理器。
Media preload manager.
提供预加载任务的提交、控制和状态监控能力。这是一个单例类。
Provides capabilities for submitting, controlling, and monitoring the status of preload tasks. This is a singleton class.
| - (NSString *) addTask: | (AVPPreloadTask *) | preloadTask | |
| listener: | (id< OnPreloadListener >) | listener |
添加一个预加载任务。
此方法用于提交一个预加载任务,并为该任务指定一个状态回调监听器。操作是异步的。
每次提交任务时系统都会生成一个唯一的任务 ID(taskId),即使提交的是配置完全相同的任务,该任务的 ID 也会不同。
多个添加的预加载任务之间是并行执行的,无优先级之分。
| preloadTask | AVPPreloadTask 预加载任务对象,包含了数据源和需要加载的时长等信息。 |
| listener | 实现了 OnPreloadListener 协议的监听器对象。任务状态发生变更时,会通过此监听器的方法进行通知。 |
Adds a preload task.
This method is used to submit a preload task and specify a status callback listener for it. The operation is asynchronous.
Each time a task is submitted, the system generates a unique task ID (taskId). Even if the same task configuration is submitted multiple times, the corresponding task IDs will still be different.
Multiple tasks added are executed in parallel with no priority order.
| preloadTask | The AVPPreloadTask object, which contains information such as the data source and loading duration. |
| listener | A listener object that conforms to the OnPreloadListener protocol. When the task status changes, notifications will be sent through the methods of this listener. |
| - (void) cancelTask: | (NSString *) | taskId |
取消指定任务 ID 的加载。
| taskId | 要取消加载的任务 ID,该 ID 由 addTask:listener:] 返回。 |
Cancels the loading for the specified task ID.
| taskId | The ID of the task to be canceled, which is returned by addTask:listener:] . |
| - (void) pauseTask: | (NSString *) | taskId |
暂停指定任务 ID 的加载。
| taskId | 要暂停加载的任务 ID,该 ID 由 addTask:listener:] 返回。 |
Pauses the loading for the specified task ID.
| taskId | The ID of the task to be paused, which is returned by addTask:listener:] . |
| - (void) resumeTask: | (NSString *) | taskId |
恢复指定任务 ID 的加载。
用于继续一个之前被 pauseTask:] 暂停的任务。
| taskId | 要恢复加载的任务 ID,该 ID 由 addTask:listener:] 返回。 |
Resumes the loading for the specified task ID.
Used to continue a task that was previously paused by pauseTask:] .
| taskId | The ID of the task to be resumed, which is returned by addTask:listener:] . |
| + (instancetype) shareInstance |
获取 AliMediaLoaderV2 的单例实例。
Gets the singleton instance of AliMediaLoaderV2.