---
name: "getMediaUrl"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "getMediaUrl - Get actual video playback URL."
summary: "Get actual video playback URL."
---

## getMediaUrl

> [VERSION] @ray-js/lock-sdk >= 1.0.0

### Description

Get the actual playback URL of a video

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetMediaUrlParams` | Yes | Multimedia URL parameters |

### Return Value

Type: `Promise<MediaUrlResult>`

Playable media URL (or the host-defined address field)

##### MediaUrlResult

| Property | Type | Description |
| --- | --- | --- |
| `mediaUrl` | `string` | Media file access URL (temporary URL signed by the cloud) |

### Referenced Types

##### `interface` GetMediaUrlParams

| Property | Type | Description |
| --- | --- | --- |
| `mediaPath` | `string` | Media path |
| `mediaBucket` | `string` | Media bucket |


### Examples

```ts
import { getMediaUrl } from '@ray-js/lock-sdk';
const url = await getMediaUrl({ mediaPath: 'xxxx/xxxx.mp4', mediaBucket: '123456' });
```
