Version - 0.0.1
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');
}
}
await builder.upload(
onProgress: (e) => print("Upload Progess: ${e['progress']}%"),
onComplete: (e) => print("Upload Complete: ${e['remoteURL']}"),
onError: (e) => print("Upload Failed: ${e['error']}"),
);
Last updated
Was this helpful?