public class MediaLoaderV2
extends java.lang.Object
getInstance().| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
addTask(PreloadTask preloadTask,
OnPreloadListener listener)
Submits a new preload task and associates it with a status callback listener.
|
void |
cancelTask(java.lang.String taskId)
Cancels the specified preload task.
|
static MediaLoaderV2 |
getInstance()
Gets the global singleton instance of MediaLoaderV2.
|
static void |
loadClass() |
void |
pauseTask(java.lang.String taskId)
Pauses the specified preload task.
|
void |
resumeTask(java.lang.String taskId)
Resumes a paused preload task.
|
public static void loadClass()
public static MediaLoaderV2 getInstance()
MediaLoaderV2.public java.lang.String addTask(PreloadTask preloadTask,
OnPreloadListener listener)
listener.
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 configuration object for the preload task, containing data source, loading duration, and other info. See PreloadTask.listener - The callback listener to receive status updates for this task. See OnPreloadListener.public void cancelTask(java.lang.String taskId)
taskId - The ID of the task to cancel, returned by the addTask(PreloadTask, OnPreloadListener) method.public void pauseTask(java.lang.String taskId)
taskId - The ID of the task to pause, returned by the addTask(PreloadTask, OnPreloadListener) method.public void resumeTask(java.lang.String taskId)
taskId - The ID of the task to resume, returned by the addTask(PreloadTask, OnPreloadListener) method.