Media
Our Media module stands out as a potent tool for efficient and secure management and sharing of your image and video content. This module streamlines the process of uploading multimedia files to cloud storage, offering a hassle-free experience.
Primary Benefit
Seamlessly integrates with your workflow through its user-friendly API, reducing the need for manual database management.
Eliminates the complexities of setting up databases and managing AWS servers, allowing you to focus on your core tasks
Adding Module
npm install @trunpm/truvideo-capacitor-media-sdk --registry=https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=<YOUR_TOKEN>Import the following dependency in your file, here you will use these function.
import {
MediaBuilder,
type UploadCompleteEventData,
type UploadErrorEvent,
type UploadProgressEvent
} from '@trunpm/truvideo-capacitor-media-sdk';Create Upload Callback -
The uploadMedia function emits several events during the upload process. These events can be listened to using the NativeEventEmitter from React Native.
onProgress: Emitted to indicate the progress of the upload.
onError: Emitted if there is an error during the upload.
onComplete: Emitted when the upload is complete.
Returned Result With Upload
Upload Media
TruVideoMediaSdk contains all function required to manage the media module. UploadFile function upload’s a one file at a time i.e. photo or video by taking, URI of the local file path, tag, metaData and it will return promise. Promise that resolves with the response from the server upon successful upload, or rejects with an error if the upload fails.
Search Media
search function will give the list uploaded media with respect to tags, page, pageSize and type
SearchPaginationData :
Search Data :
GetAllRequest
This function will provide all the requests created for Upload Builder
Input Params
Function Utilisation
GetRequestById
This function will return exact request associated with the id
MediaData
Last updated
Was this helpful?