Class LoadImageTask
- java.lang.Object
-
- android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>
-
- com.brightcove.player.display.tasks.LoadImageTask
-
- All Implemented Interfaces:
Component
@Emits(events={"didSetVideoStill","didSetVideoStillError"}) @ListensFor(events={}) public class LoadImageTask extends android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap> implements Component
General purpose AsyncTask to load an image over the network into an ImageView. The Event type specified in the constructor will be emitted on successful load of an image.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TAG
-
Constructor Summary
Constructors Constructor Description LoadImageTask(android.widget.ImageView view, EventEmitter eventEmitter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected android.graphics.Bitmap
doInBackground(java.net.URI... params)
Loads a Bitmap over the network using the given URL.java.lang.String
getSuccessEventType()
Get the currently configured EventType string that is to be emitted on successful load of a Bitmap.protected void
onPostExecute(android.graphics.Bitmap image)
On successful load of a Bitmap from the background thread, put that Bitmap in the ImageView provided to this task.void
setSuccessEventType(java.lang.String type)
Set the EventType string to be emitted on successful load of a Bitmap.
-
-
-
Constructor Detail
-
LoadImageTask
public LoadImageTask(android.widget.ImageView view, EventEmitter eventEmitter)
-
-
Method Detail
-
getSuccessEventType
public java.lang.String getSuccessEventType()
Get the currently configured EventType string that is to be emitted on successful load of a Bitmap.- Returns:
- the EventType string to be used on success, or null if none is set
-
setSuccessEventType
public void setSuccessEventType(java.lang.String type)
Set the EventType string to be emitted on successful load of a Bitmap.- Parameters:
type
- the EventType string
-
doInBackground
protected android.graphics.Bitmap doInBackground(java.net.URI... params)
Loads a Bitmap over the network using the given URL.- Specified by:
doInBackground
in classandroid.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>
- Parameters:
params
- should contain a single URL object- Returns:
- the Bitmap loaded from the network, or null if Bitmap could not be loaded
-
onPostExecute
protected void onPostExecute(android.graphics.Bitmap image)
On successful load of a Bitmap from the background thread, put that Bitmap in the ImageView provided to this task.- Overrides:
onPostExecute
in classandroid.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>
- Parameters:
image
- the Bitmap that was loaded via background thread
-
-