# mediaSubscribeParameters

URL: https://www.caprid.com/docs/reference/typescript/caprid/relay/media/functions/mediasubscribeparameters/

```ts
function mediaSubscribeParameters(kind, overrides?): MessageParameters;
```

Defined in: [relay-sdks/ts/src/media-track-properties.ts:100](https://github.com/caprids/relay-sdks/blob/main/ts/src/media-track-properties.ts#L100)

The subscription parameters a viewer gives a media track, so audio goes ahead of video when the downlink is congested
(spec/behavior.md, "Media subscribing"). Pass them to `subscribe`, `want` or `switchTo`:

```ts
subscriber.subscribe({ namespace, track: 'audio', parameters: mediaSubscribeParameters('audio') }, handlers);
subscriber.subscribe({ namespace, track: 'video', parameters: mediaSubscribeParameters('video') }, handlers);
```

The result is a SUBSCRIBER_PRIORITY of 16 for audio and 96 for video, lower being more urgent: the same values
`mediaTrackProperties` gives as publisher priorities. moq-relay 0.17 orders what it sends a viewer by subscriber
priority alone and ignores the publisher's, so this is the priority that decides delivery there. It cannot be
changed later: on that relay any `update()` ends the subscription. `overrides` are copied onto the result, such as a
`locationFilter`; an explicit `subscriberPriority`, an integer from 0 to 255, replaces the default.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `kind` | [`MediaKind`](https://www.caprid.com/docs/reference/typescript/caprid/relay/media/type-aliases/mediakind/) |
| `overrides?` | [`MessageParameters`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/messageparameters/) |

## Returns

[`MessageParameters`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/messageparameters/)
