Class LoadImageTask

java.lang.Object
android.os.AsyncTask<URI,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<URI,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.
  • Nested Class Summary

    Nested classes/interfaces inherited from class android.os.AsyncTask

    android.os.AsyncTask.Status
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class android.os.AsyncTask

    SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoadImageTask(android.widget.ImageView view, EventEmitter eventEmitter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected android.graphics.Bitmap
    doInBackground(URI... params)
    Loads a Bitmap over the network using the given URL.
    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
    Set the EventType string to be emitted on successful load of a Bitmap.

    Methods inherited from class android.os.AsyncTask

    cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TAG

      public static final String TAG
  • Constructor Details

    • LoadImageTask

      public LoadImageTask(android.widget.ImageView view, EventEmitter eventEmitter)
  • Method Details

    • getSuccessEventType

      public 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(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(URI... params)
      Loads a Bitmap over the network using the given URL.
      Specified by:
      doInBackground in class android.os.AsyncTask<URI,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 class android.os.AsyncTask<URI,Void,android.graphics.Bitmap>
      Parameters:
      image - the Bitmap that was loaded via background thread