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 { Permissions, webMethod } from 'wix-web-module';
2import { mediaManager } from 'wix-media-backend';
3
4export const getVideoPlaybackUrl = webMethod(Permissions.Anyone, async (fileUrl) => {
5 return mediaManager.getVideoPlaybackUrl(fileUrl, "hls");
6});
7
8/* Returns a promise that resolves to:
9 * "https://repackager.wixmp.com/video.wixstatic.com/video/f6c0f9..."
10 */