Chat Android SDK
7.0.1
|
Media object describes downloadable media inside chat message with type Message.Type.MEDIA. More...
Public Member Functions | |
Getters | |
String | getSid () |
Get SID of media stream. More... | |
String | getFileName () |
Get file name of media stream. More... | |
String | getType () |
Get mime-type of media stream. More... | |
long | getSize () |
Get size of media stream. More... | |
void | getContentTemporaryUrl (CallbackListener< String > listener) |
Request media download temporary link. More... | |
Actions | |
void | download (OutputStream stream, StatusListener status, ProgressListener progress) |
Save media content stream that could be streamed or downloaded by client. More... | |
Media object describes downloadable media inside chat message with type Message.Type.MEDIA.
void com.twilio.chat.Message.Media.download | ( | OutputStream | stream, |
StatusListener | status, | ||
ProgressListener | progress | ||
) |
Save media content stream that could be streamed or downloaded by client.
Provided stream could be any subclass of java.io.OutputStream, including ByteArrayOutputStream, so you could download media into memory for further processing.
stream | Output stream to write media to. |
status | Status listener receives result status of the download operation. If download is successful, listener.onSuccess() will be called, otherwise listener.onError(). |
progress | Progress listener receives updates about media download starting (progress.onStarted()), bytes downloaded (progress.onProgress(bytes)) and completed (progress.onCompleted()). |
IllegalArgumentException | When attempt is made to use null output stream. |
void com.twilio.chat.Message.Media.getContentTemporaryUrl | ( | CallbackListener< String > | listener | ) |
Request media download temporary link.
This URL is impermanent, it expires in several minutes. If the link became invalid (expired), need to re-request the new one. It is user's responsibility to timely download media data by this link.
listener | Listener to receive temporary URL. |
String com.twilio.chat.Message.Media.getFileName | ( | ) |
Get file name of media stream.
String com.twilio.chat.Message.Media.getSid | ( | ) |
Get SID of media stream.
long com.twilio.chat.Message.Media.getSize | ( | ) |
Get size of media stream.
String com.twilio.chat.Message.Media.getType | ( | ) |
Get mime-type of media stream.