Version - 1.0.3-beta.2
Upload Media
The uploadFile function facilitates the uploading of photos or videos by accepting the context and the URI of the local file path as parameters.
Our transcriptions module simplifies video transcription. Upload videos effortlessly, initiate transcription, and retrieve results seamlessly, it's ideal for content management, media monitoring, and educational platforms.
Example Usage :
Future<void> performUploadFlow(String filePath) async {
try {
// Create a new MediaBuilder with a test file path
final builder = MediaBuilder(filePath)
..setTag("color", "blue")
..setTag("source", "flutter-sdk")
..setMetaData("uploadedBy", "truvideo");
// Build the media upload request
await builder.build();
final mediaId = builder.getMediaId();
print("Upload media ID is: $mediaId");
// Start the upload with event callbacks
await builder.upload(
onProgress: (e) => print("Upload Progess: ${e['progress']}%"),
onComplete: (e) => print("Upload Complete: ${e['remoteURL']}"),
onError: (e) => print("Upload Failed: ${e['error']}"),
);
} catch (e) {
debugPrint('Upload flow failed: $e');
}
}Get All Requests
Use getAllFileUploadRequests function to fetch all the file upload request. The function will return List<MediaBuilder>?.
Get Requests byID
Use getFileUploadRequestById function to fetch request associated with the id. The function will return MediaBuilder? object.
Upload
Call .upload function from MediaBuilder object to upload the file.
Pause
Call .pause function from MediaBuilder object to pause the uploading process.
Resume
Call .resume function from MediaBuilder object resume uploading.
Delete
Call .delete function from MediaBuilder object to delete the request.
Last updated
Was this helpful?