Media

Import the following dependency in your file, here you will use these function.

import { 
    MediaBuilder,
    UploadProgressEvent,
    UploadCompleteEventData,
    UploadErrorEvent 
} from 'TruVideoMediaSdk';

Recieve media Response -

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.

const uploadCallbacks = {
    onProgress: (event: UploadProgressEvent) => {
        console.log(`ID: ${event.id}, Progress: ${event.progress}%`);
    },
    onComplete: (event: UploadCompleteEventData) => {
        console.log(`ID: ${event.id}, Type: ${event.fileType}`);
    },
    onError: (event: UploadErrorEvent) => {
        console.log(`ID: ${event.id}, Error: ${event.error}`);
    },
};

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

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?