com.ooyala.android.offline.DownloadUtils Class Reference

Classes

interface  DownloaderType
 The type of the downloader that was used for downloading media files. More...
 

Static Public Member Functions

static int getBitrateToDownload (List< Representation > representations, int requestedBitrate)
 
static boolean deleteFolder (File folder)
 A helper function to delete a folder recursively. More...
 
static File createFolder (DownloadOptions options) throws Exception
 A helper function to create a folder. More...
 
static void downloadContentTreeClosedCaptions (File folder, Video video) throws Exception
 Save Closed Captions to a local folder. More...
 
static ClosedCaptions retrieveContentTreeClosedCaption (File folder)
 Retrieve ClosedCaptions from an offline folder. More...
 
static Stream retrieveDashStreamData (Context context, String embedCode, File folder)
 Retrieve DASH Stream data from an offline folder. More...
 
static Stream retrieveStreamData (Context context, String embedCode)
 Retrieve Stream data of an offline video. More...
 
static String retrieveDownloaderType (Context context, String embedCode)
 Retrieve downloader type. More...
 

Static Public Attributes

static final String CLOSED_CAPTIONS_OFFLINE_FILE = "CLOSED_CAPTIONS_OFFLINE_FILE"
 
static final String STREAM_URL_OFFLINE = "STREAM_URL_OFFLINE"
 
static final String STREAM_DELIVERY_TYPE_OFFLINE = "STREAM_DELIVERY_TYPE_OFFLINE"
 
static final String STREAM_WIDEVINE_SERVER_PATH = "STREAM_WIDEVINE_SERVER_PATH"
 
static final String DOWNLOADER_TYPE = "DOWNLOADER_TYPE"
 
static final String OOYALA_DOWNLOADER = "OOYALA_DOWNLOADER"
 
static final String DASH_DOWNLOADER = "DASH_DOWNLOADER"
 

Member Function Documentation

static File com.ooyala.android.offline.DownloadUtils.createFolder ( DownloadOptions  options) throws Exception
static

A helper function to create a folder.

Parameters
optionsA DownloadOptions instance.
Returns
A download folder that created according to DownloadOptions.
static boolean com.ooyala.android.offline.DownloadUtils.deleteFolder ( File  folder)
static

A helper function to delete a folder recursively.

Parameters
folderThe local folder to store the mpd file.
Returns
true if and only if the file or directory is successfully deleted; false otherwise.
static void com.ooyala.android.offline.DownloadUtils.downloadContentTreeClosedCaptions ( File  folder,
Video  video 
) throws Exception
static

Save Closed Captions to a local folder.

Parameters
folderThe local folder to store the closed captions file.
videoA Video.
static int com.ooyala.android.offline.DownloadUtils.getBitrateToDownload ( List< Representation >  representations,
int  requestedBitrate 
)
static
Parameters
representationsA list that consists of all the com.google.android.exoplayer2.offline.TrackKey and bitrates associated with keys.
requestedBitrateA requested bitrate from DownloadOptions.
Returns
The closest bitrate to download from the list of representations.
static ClosedCaptions com.ooyala.android.offline.DownloadUtils.retrieveContentTreeClosedCaption ( File  folder)
static

Retrieve ClosedCaptions from an offline folder.

Parameters
folderThe local folder where the closed captions file was saved.
static Stream com.ooyala.android.offline.DownloadUtils.retrieveDashStreamData ( Context  context,
String  embedCode,
File  folder 
)
static

Retrieve DASH Stream data from an offline folder.

Parameters
contextA Context.
embedCodeThe current item embed code.
folderThe local folder where DASH manifest file was saved.
Returns
The current stream to playback.
static String com.ooyala.android.offline.DownloadUtils.retrieveDownloaderType ( Context  context,
String  embedCode 
)
static

Retrieve downloader type.

Parameters
contextA Context.
embedCodeThe current item embed code.
static Stream com.ooyala.android.offline.DownloadUtils.retrieveStreamData ( Context  context,
String  embedCode 
)
static

Retrieve Stream data of an offline video.

Parameters
contextA Context.
embedCodeThe current item embed code.
Returns
The current stream to playback.

Member Data Documentation

final String com.ooyala.android.offline.DownloadUtils.CLOSED_CAPTIONS_OFFLINE_FILE = "CLOSED_CAPTIONS_OFFLINE_FILE"
static
final String com.ooyala.android.offline.DownloadUtils.DASH_DOWNLOADER = "DASH_DOWNLOADER"
static
final String com.ooyala.android.offline.DownloadUtils.DOWNLOADER_TYPE = "DOWNLOADER_TYPE"
static
final String com.ooyala.android.offline.DownloadUtils.OOYALA_DOWNLOADER = "OOYALA_DOWNLOADER"
static
final String com.ooyala.android.offline.DownloadUtils.STREAM_DELIVERY_TYPE_OFFLINE = "STREAM_DELIVERY_TYPE_OFFLINE"
static
final String com.ooyala.android.offline.DownloadUtils.STREAM_URL_OFFLINE = "STREAM_URL_OFFLINE"
static
final String com.ooyala.android.offline.DownloadUtils.STREAM_WIDEVINE_SERVER_PATH = "STREAM_WIDEVINE_SERVER_PATH"
static