getVideoPlaybackUrl( )


Gets a video file's playback URL from the Media Manager.

The getVideoPlaybackUrl() function returns a Promise that resolves to the specified video file's playback URL.

Method Declaration
Copy
function getVideoPlaybackUrl(fileUrl: string, format: string): Promise<string>;
Method Parameters
fileUrlstringRequired

The file's Wix media URL in the following format: 'wix:image://v1//#originWidth=&originHeight=[&watermark=]'.

Note: This replaces the old fileName parameter. fileName will continue to work, but we recommend that you use the updated fileUrl parameter instead.


formatstringRequired

The format of the URL to get. Either "hls" or "dash".

Returns
Return Type:Promise<string>
Get a URL to be used for video playback
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { mediaManager } from "wix-media-backend"; export const getVideoPlaybackUrl = webMethod( Permissions.Anyone, async (fileUrl) => { return mediaManager.getVideoPlaybackUrl(fileUrl, "hls"); }, ); /* Returns a promise that resolves to: * "https://repackager.wixmp.com/video.wixstatic.com/video/f6c0f9..." */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?