fetch Base64File
Fetches a file from the given URL and returns its contents as a base64-encoded string.
This is typically used to download a file that was previously uploaded via uploadBase64File. The URL is the one returned by that upload method. The raw response bytes are read in full and encoded to a Base64 string.
The download itself is asynchronous, with the listener callbacks invoked on the main thread. A call rejected on the spot — meeting not joined, or a missing argument — calls listener.onError synchronously on the calling thread.
Requires a joined meeting, like uploadBase64File. Called before the meeting is joined, or while it is reconnecting, nothing is fetched and the reason arrives twice: once on onError (see Meeting for the codes) and once as the same text on listener.onError.
Code Example:
meeting.fetchBase64File(fileUrl, token,
new TaskCompletionListener<String, String>() {
public void onComplete(String base64Data) {
Log.d("Meeting", "File fetched, length: " + base64Data.length());
}
public void onError(String error) {
Log.e("Meeting", "Fetch error: " + error);
}
});
Parameters
the URL of the file to fetch (typically a URL returned by uploadBase64File)
the VideoSDK authentication token (same token used for config)
the TaskCompletionListener to receive the base64-encoded file content on success, or an error message on failure