Search...
onVideoTranscoded( )
An event that triggers when a video file has completed transcoding.
Description
The onVideoTranscoded()
event handler runs when an uploaded video file
has finished transcoding. Video files that have been imported aren't immediately available
until the transcoding has completed.
It is fired after the onFileUploaded
event, and after the transcoding has completed. The FileEvent
object contains information about the uploaded video and the upload context.
Note: Backend events don't work when previewing your site.
Syntax
function onVideoTranscoded(event: FileEvent): void
onVideoTranscoded Parameters
NAME
TYPE
DESCRIPTION
event
FileEvent
The uploaded file information.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event when a video has been transcoded
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.34export function wixMediaManager_onVideoTranscoded(event) {5 let videoFileInfo = event.fileInfo;6 let fileUrl = event.fileInfo.fileUrl;7 let height = event.fileInfo.height;8}910/* Full event object:11 * {12 * "fileInfo": {13 * "mediaType": "video",14 * "sourceUrl": "https://somedomain.com/img/original-name.mp4",15 * "height": 480,16 * "mimeType":"video/mp4",17 * "hash":"c439e7b7a52f7d7d7263bc0c97dd1ab8",18 * "fileUrl":"wix:video://v1/22d494_3d4b9f1c39674519bf636b9bef499659/fileName.mp4#posterUri=22d494_3d4b9f1c39674519bf636b9bef499659f002.jpg&posterWidth=480&posterHeight=480",19 * "originalFileName":"fileName.mp4",20 * "opStatus": "READY",21 * "originalFileName": "original-name.mp4",22 * "sizeInBytes":74424,23 * "isPrivate":false,24 * "width":480,25 * "iconUrl":"wix:image://v1/22d494_3d4b9f1c39674519bf636b9bef499659f002.jpg/fileName.mp4#originWidth=480&originHeight=480"26 * "parentFolderId":"09057cf95974494c83c8e0b93fd93909"}]"27 * },28 * "context": {29 * "someKey1": "someValue1",30 * "someKey2": "someValue2"31 * }32 * }33 */