Upload Media
This documentation provides guidelines on uploading images and video to server using the TruVideo Media SDK. The SDK offers simple methods to integrate upload functionalities into your application.
Prerequisites
Ensure you have integrated the TruVideo Core SDK into your project and completed with the authentication process
Camera module will provide MediaItem or simply provide filepath to upload (optional)
Step 1 : Create a MediaBuilder object
final builder = MediaBuilder(filePath)Step 2 : Set tags or metaData mediaBuilder object if required
// Set Tags
builder..setTag("key", "value");
builder..setTag("color", "red");
builder..setTag("orderNumber", "123");
// Set Metadata
builder..setMetaData("key", "value");
builder..setMetaData("key1", "1");
builder..setMetaData("key2", "[4,5,6]");Step 3 : Build the request with mediaBuilder
await builder.build();Step 4 : Finally call the upload to push data to server
Finalize :
After completing this steps the function should look like
Last updated
Was this helpful?