public class MediaLoader
extends java.lang.Object
getInstance().
Loading tasks are performed asynchronously, and status updates are delivered through the MediaLoader.OnLoadStatusListener.| Modifier and Type | Class and Description |
|---|---|
static interface |
MediaLoader.OnLoadStatusListener
A listener for receiving loading status updates.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
OLD_CODE_EADDED |
static int |
OLD_CODE_ENOT_ENABLE |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(java.lang.String url)
Cancels one or all loading tasks.
|
static MediaLoader |
getInstance()
Gets the global singleton instance of MediaLoader.
|
void |
load(java.lang.String url,
long duration)
Asynchronously starts loading the specified video file.
|
void |
load(java.lang.String url,
long duration,
int bandwidth)
Asynchronously starts loading the specified video file with a preferred bitrate.
|
static void |
loadClass() |
void |
loadWithResolution(java.lang.String url,
long duration,
int resolutionProduct)
Asynchronously starts loading the specified video file with a preferred resolution.
|
void |
pause(java.lang.String url)
Pauses one or all loading tasks.
|
void |
resume(java.lang.String url)
Resumes one or all paused loading tasks.
|
void |
setOnLoadStatusListener(MediaLoader.OnLoadStatusListener listener)
Sets the listener for loading status updates.
|
public static final int OLD_CODE_EADDED
public static final int OLD_CODE_ENOT_ENABLE
public static void loadClass()
public static MediaLoader getInstance()
MediaLoader.public void load(java.lang.String url,
long duration)
url - The URL of the video file to load.duration - The duration of the content to preload, in milliseconds.load(String, long, int),
loadWithResolution(String, long, int)public void load(java.lang.String url,
long duration,
int bandwidth)
url - The URL of the video file to load.duration - The duration of the content to preload, in milliseconds.bandwidth - The desired bitrate in bps (bits per second). The loader will select the stream closest to this value.public void loadWithResolution(java.lang.String url,
long duration,
int resolutionProduct)
url - The URL of the video file to load.duration - The duration of the content to preload, in milliseconds.resolutionProduct - The product of the width and height of the desired resolution. The loader will select the stream closest to this value.public void cancel(java.lang.String url)
url - The URL of the video file to cancel loading. Pass null or an empty string to cancel all tasks.public void pause(java.lang.String url)
url - The URL of the video file to pause loading. Pass null or an empty string to pause all tasks.public void resume(java.lang.String url)
url - The URL of the video file to resume loading. Pass null or an empty string to resume all tasks.public void setOnLoadStatusListener(MediaLoader.OnLoadStatusListener listener)
listener - An instance of the listener for loading status callbacks. See MediaLoader.OnLoadStatusListener.