Search.../

getVideoPlaybackUrl( )

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

Description

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

Syntax

function getVideoPlaybackUrl(fileUrl: string, format: string): Promise<string>

getVideoPlaybackUrl Parameters

NAME
TYPE
DESCRIPTION
fileUrl
string

The file's Wix media URL in the following format: 'wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]'.

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

format
string

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

Returns

Fulfilled - The file's URL.

Return Type:

Promise<string>

Was this helpful?

Get a URL to be used for video playback

Copy Code
1import { mediaManager } from 'wix-media-backend';
2
3export async function getVideoPlaybackUrl(fileUrl) {
4 return mediaManager.getVideoPlaybackUrl(fileUrl, "hls");
5}
6
7/* Returns a promise that resolves to:
8 * "https://repackager.wixmp.com/video.wixstatic.com/video/f6c0f9..."
9 */