> ## Documentation Index
> Fetch the complete documentation index at: https://developer.bitmovin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PlayerAPI

Core player instance methods and properties

## PlayerAPI

> Interface

Bitmovin Player instance members.

## Properties

### adaptation

• `Readonly` **adaptation**: [`AdaptationAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-adaptation#adaptationapi)

The adaptation API namespace.

***

### ads

• `Readonly` **ads**: [`PlayerAdvertisingAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-advertising#playeradvertisingapi)

The advertising API namespace.

***

### analytics

• `Readonly` **analytics**: [`Bitmovin8Adapter`](https://developer.bitmovin.com/playback/reference/web-sdk-analytics#bitmovin8adapter)

The Analytics API namespace.

***

### buffer

• `Readonly` **buffer**: [`PlayerBufferAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-buffer#playerbufferapi)

The buffer API namespace.

***

### drm

• `Readonly` **drm**: [`DrmAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-drm#drmapi)

The DRM API namespace.

***

### exports

• `Readonly` **exports**: [`PlayerExports`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playerexports)

Exports from the player core as a convenience fallback for non-modular code.
It is recommended to use ES6 imports instead.

Usage:

```ts
import { Player } from 'bitmovin-player';
const player = new Player(...);
player.on(player.exports.Event.Loaded, () => ...);
```

Recommended approach:

```ts
import { Player, Event } from 'bitmovin-player';
const player = new Player(...);
player.on(Event.Loaded, () => ...);
```

**Deprecated:** It is recommended to use ES6 imports instead

***

### lowlatency

• `Readonly` **lowlatency**: [`LowLatencyAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#lowlatencyapi)

The low latency API namespace.

***

### manifest

• `Readonly` **manifest**: [`PlayerManifestAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playermanifestapi)

The manifest API namespace.

***

### sgai

• `Readonly` **sgai**: `PlayerSgaiAPI`

The SGAI API namespace.

***

### subtitles

• `Readonly` **subtitles**: [`PlayerSubtitlesAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#playersubtitlesapi)

The subtitles API namespace.

***

### version

• `Readonly` **version**: `string`

The version number of the player.

***

### vr

• `Readonly` **vr**: [`PlayerVRAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#playervrapi)

The VR API namespace.

## Methods

### addMetadata

▸ **addMetadata**(`metadataType`, `metadata`): `boolean`

Sends custom metadata to a remote receiver app (e.g. Chromecast).

#### Parameters

| Name           | Type                                  | Description                                                   |
| :------------- | :------------------------------------ | :------------------------------------------------------------ |
| `metadataType` | [`CAST`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#cast) | The type of the metadata. Currently only 'CAST' is supported. |
| `metadata`     | `any`                                 | The custom data to send to the receiver.                      |

#### Returns

`boolean`

True if it was successful.

**Since:** v4.0

***

### castStop

▸ **castStop**(): `void`

Stops a running Cast session (i.e. [isCasting](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#iscasting) returns true). Has no effect if [isCasting](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#iscasting)
returns false.

#### Returns

`void`

**Since:** v4.0

***

### castVideo

▸ **castVideo**(): `void`

Initiates casting the current video to a Cast-compatible device. The user has to choose the target device.

#### Returns

`void`

**Since:** v4.0

***

### clearQueryParameters

▸ **clearQueryParameters**(): `void`

Removes all existing query parameters as specified in [setQueryParameters](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#setqueryparameters) or
[query\_parameters](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#query_parameters).

#### Returns

`void`

**Since:** v4.0

***

### destroy

▸ **destroy**(): `Promise`<`void`>

Unloads the player and removes all inserted HTML elements and event handlers.

#### Returns

`Promise`<`void`>

Promise resolves when the player has cleaned up all its event handlers & resources

**Since:** v8.0

***

### getAspectRatio

▸ **getAspectRatio**(): `number`

Returns the current aspect ratio of the player, or 0 if there is no style module.
Note: the default player aspect ratio is 16:9.

#### Returns

`number`

A number indicating the player aspect ratio (e.g. 1.6 for 16:10).

**Since:** v8.74

***

### getAudio

▸ **getAudio**(): [`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)

Returns the currently used audio track, or null if no track is active.

#### Returns

[`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)

**Since:** v4.0

***

### getAudioBufferLength

▸ **getAudioBufferLength**(): `number`

Returns the seconds of already buffered audio data or null if no audio source is loaded.

#### Returns

`number`

**Deprecated:** Use [getLevel](https://developer.bitmovin.com/playback/reference/web-sdk-buffer#getlevel) instead.

***

### getAudioQuality

▸ **getAudioQuality**(): [`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)

Returns the currently selected audio quality. One of the elements of [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities).

#### Returns

[`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)

**Since:** v7.3.1

***

### getAvailableAudio

▸ **getAvailableAudio**(): [`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

Returns an array of all available audio tracks.

#### Returns

[`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

**Since:** v4.0

***

### getAvailableAudioQualities

▸ **getAvailableAudioQualities**(): [`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)\[]

Returns an array of all available audio qualities the player can adapt between.

#### Returns

[`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)\[]

**Since:** v4.0

***

### getAvailableSegments

▸ **getAvailableSegments**(): [`SegmentMap`](https://developer.bitmovin.com/playback/reference/web-sdk-network#segmentmap)

Returns infos for segments that can be requested by the player

#### Returns

[`SegmentMap`](https://developer.bitmovin.com/playback/reference/web-sdk-network#segmentmap)

**Since:** v7.2

***

### getAvailableVideoQualities

▸ **getAvailableVideoQualities**(): [`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)\[]

Returns an array containing all available video qualities the player can adapt between.

#### Returns

[`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)\[]

**Since:** v4.0

***

### getBufferedRanges

▸ **getBufferedRanges**(): [`TimeRange`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timerange)\[]

Returns the currently buffered time ranges of the video element.

#### Returns

[`TimeRange`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timerange)\[]

**Since:** v6.1

***

### getConfig

▸ **getConfig**(`mergedConfig?`): [`PlayerConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#playerconfig)

Returns the config object of the current player instance.

#### Parameters

| Name            | Type      | Description                                                                                                                     |
| :-------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------ |
| `mergedConfig?` | `boolean` | true to return the config expanded with all default values, false to return the user config passed to the player's constructor. |

#### Returns

[`PlayerConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#playerconfig)

The current user or merged player config.

**Since:** v4.0

***

### getContainer

▸ **getContainer**(): `HTMLElement`

Returns the html element that the player is embedded in, which has been provided in the player constructor.

#### Returns

`HTMLElement`

**Since:** v8.0

***

### getCurrentTime

▸ **getCurrentTime**(`mode?`): `number`

Returns the current playback time in seconds of the video.

#### Parameters

| Name    | Type                                          | Description                                                                                                                                        |
| :------ | :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode?` | [`TimeMode`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timemode) | The mode to decide if the returned time should be absolute or relative, see [TimeMode](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timemode). Default mode is absolute. |

#### Returns

`number`

**Since:** v4.0

***

### getDownloadedAudioData

▸ **getDownloadedAudioData**(): [`DownloadedAudioData`](https://developer.bitmovin.com/playback/reference/web-sdk-network#downloadedaudiodata)

Returns data about the last downloaded audio segment.

#### Returns

[`DownloadedAudioData`](https://developer.bitmovin.com/playback/reference/web-sdk-network#downloadedaudiodata)

**Since:** v4.0

***

### getDownloadedVideoData

▸ **getDownloadedVideoData**(): [`DownloadedVideoData`](https://developer.bitmovin.com/playback/reference/web-sdk-network#downloadedvideodata)

Returns data about the last downloaded video segment.

#### Returns

[`DownloadedVideoData`](https://developer.bitmovin.com/playback/reference/web-sdk-network#downloadedvideodata)

**Since:** v4.0

***

### getDroppedVideoFrames

▸ **getDroppedVideoFrames**(): `number`

Returns the total number of dropped video frames since playback started.

#### Returns

`number`

**Since:** v8.0

***

### getDuration

▸ **getDuration**(): `number`

Returns the total duration in seconds of the current video or `Infinity` if it’s a live stream.

#### Returns

`number`

**Since:** v4.0

***

### getManifest

▸ **getManifest**(): `string`

Returns the used DASH or HLS manifest file, or null if no manifest is loaded.

Previous player versions (v4.2-v7.0) returned an object for DASH and a string for HLS, this has been corrected
in v7.1.

#### Returns

`string`

**Since:** v7.1

***

### getMaxTimeShift

▸ **getMaxTimeShift**(): `number`

Returns the limit in seconds for time shift. Is either negative or 0 and applicable to live streams only.

#### Returns

`number`

**Since:** v4.0

***

### getPlaybackAudioData

▸ **getPlaybackAudioData**(): [`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)

Returns data about the currently playing audio segment.

#### Returns

[`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)

**Since:** v4.0

***

### getPlaybackSpeed

▸ **getPlaybackSpeed**(): `number`

Returns the current playback speed of the player. 1 is the default playback speed, values
between 0 and 1 refer to slow motion and values greater than 1 refer to fast forward. Values less or
equal zero are ignored.

#### Returns

`number`

**Since:** v4.0

***

### getPlaybackVideoData

▸ **getPlaybackVideoData**(): [`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)

Returns data about the currently playing video segment.

#### Returns

[`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)

**Since:** v4.0

***

### getPlayerType

▸ **getPlayerType**(): [`PlayerType`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playertype)

Returns the currently used rendering mode. See [PlayerType](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playertype) for details of the valid values.

#### Returns

[`PlayerType`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playertype)

**Since:** v4.0

***

### getSeekableRange

▸ **getSeekableRange**(): [`TimeRange`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timerange)

Returns the time range that is currently valid for seeking.

#### Returns

[`TimeRange`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#timerange)

**Since:** v7.1

***

### getSnapshot

▸ **getSnapshot**(`type?`, `quality?`): [`Snapshot`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#snapshot)

Creates a snapshot of the current video frame.
Snapshots cannot be taken from DRM protected content.

#### Parameters

| Name       | Type     | Description                                                                              |
| :--------- | :------- | :--------------------------------------------------------------------------------------- |
| `type?`    | `string` | The type of image snapshot to capture. Allowed values are 'image/jpeg' and 'image/webp'. |
| `quality?` | `number` | A number between 0 and 1 indicating the image quality.                                   |

#### Returns

[`Snapshot`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#snapshot)

**Since:** v4.0

***

### getSource

▸ **getSource**(): [`SourceConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#sourceconfig)

Returns the source that was loaded via a successfully finished [load](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#load) call. After a
[Error](https://developer.bitmovin.com/playback/reference/web-sdk-events#error) event is thrown, it returns the last successfully loaded source.
Returns `null` if no source is loaded or a load is in progress.

#### Returns

[`SourceConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#sourceconfig)

the loaded source or `null` if no source is loaded

***

### getStreamType

▸ **getStreamType**(): [`StreamType`](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#streamtype)

Returns the currently used streaming technology. See [StreamType](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#streamtype) for details of the valid values.

#### Returns

[`StreamType`](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#streamtype)

**Since:** v4.0

***

### getSupportedDRM

▸ **getSupportedDRM**(): `Promise`<`string`\[]>

Tests and retrieves a list of all supported DRM systems in the current user agent.

#### Returns

`Promise`<`string`\[]>

A Promise that resolves to an array of strings with the supported DRM systems after fulfillment.
Should never be rejected.

**Since:** v4.1

***

### getSupportedTech

▸ **getSupportedTech**(`mode?`): [`Technology`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#technology)\[]

Returns an array of objects denoting a player and streaming technology combination. By default, this
returns the combinations supported on the current platform ([Platform](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#platform)),
ordered by descending priority which will be used to play a stream.

#### Parameters

| Name    | Type                                                                           | Description                                                 |
| :------ | :----------------------------------------------------------------------------- | :---------------------------------------------------------- |
| `mode?` | [`SupportedTechnologyMode`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#supportedtechnologymode) | the mode by which the supported technologies are determined |

#### Returns

[`Technology`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#technology)\[]

**Since:** v4.0

***

### getThumbnail

▸ **getThumbnail**(`time`): [`Thumbnail`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#thumbnail)

Returns a thumbnail image for a certain time or null if there is no thumbnail available.
Requires a configured thumbnails track in [thumbnailTrack](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#thumbnailtrack).

#### Parameters

| Name   | Type     | Description                                               |
| :----- | :------- | :-------------------------------------------------------- |
| `time` | `number` | the media time for which the thumbnail should be returned |

#### Returns

[`Thumbnail`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#thumbnail)

A thumbnail if a thumbnails track is configured and a thumbnail exists for the specified time, else null

**Since:** v8.0

***

### getTimeShift

▸ **getTimeShift**(): `number`

Returns the current time shift offset to the live edge in seconds. Only applicable to live streams.

#### Returns

`number`

**Since:** v4.0

***

### getTotalStalledTime

▸ **getTotalStalledTime**(): `number`

Returns the stalled time in seconds since playback started.

#### Returns

`number`

**Since:** v4.0

***

### getVideoBufferLength

▸ **getVideoBufferLength**(): `number`

Returns the seconds of already buffered video data or null if no video source is loaded.

#### Returns

`number`

**Deprecated:** Use [getLevel](https://developer.bitmovin.com/playback/reference/web-sdk-buffer#getlevel) instead.

***

### getVideoElement

▸ **getVideoElement**(): `HTMLVideoElement`

Returns the used HTML5 video element.

#### Returns

`HTMLVideoElement`

The HTML5 video element which is used by the player

***

### getVideoQuality

▸ **getVideoQuality**(): [`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)

Returns the currently selected video quality, if the user manually selected one. In this case it returns one of
the elements of [getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities).

In case the user did not select a video quality it returns `auto`.

#### Returns

[`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)

**Since:** v7.3.1

***

### getViewMode

▸ **getViewMode**(): [`ViewMode`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode)

Gets the active [ViewMode](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode).

#### Returns

[`ViewMode`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode)

the view mode that is currently active

**Since:** v8.0

***

### getVolume

▸ **getVolume**(): `number`

Returns the player’s volume between 0 (silent) and 100 (max volume).

#### Returns

`number`

**Since:** v4.0

***

### hasEnded

▸ **hasEnded**(): `boolean`

Returns true if the video has ended.

#### Returns

`boolean`

**Since:** v4.0

***

### isAirplayActive

▸ **isAirplayActive**(): `boolean`

Checks if Apple Airplay is enabled.

#### Returns

`boolean`

**Since:** v7.8.4

***

### isAirplayAvailable

▸ **isAirplayAvailable**(): `boolean`

Checks if Apple AirPlay support is available.

#### Returns

`boolean`

**Since:** v7.1

***

### isCastAvailable

▸ **isCastAvailable**(): `boolean`

Returns true if casting to another device (such as a ChromeCast) is available, otherwise false.
Please note that this function only returns true after the [CastAvailable](https://developer.bitmovin.com/playback/reference/web-sdk-events#castavailable) event has fired.

#### Returns

`boolean`

**Since:** v5.2

***

### isCasting

▸ **isCasting**(): `boolean`

Returns true if the video is currently casted to a device and not played in the browser,
or false if the video is played locally.

#### Returns

`boolean`

**Since:** v4.0

***

### isDRMSupported

▸ **isDRMSupported**(`drmSystem`): `Promise`<`string`>

Checks if a DRM system is supported in the current user agent.

#### Parameters

| Name        | Type     | Description                         |
| :---------- | :------- | :---------------------------------- |
| `drmSystem` | `string` | A Key System string to test against |

#### Returns

`Promise`<`string`>

Resolves with the DRM system string if it is supported, or rejects with an error message if not

**Since:** v4.1

***

### isLive

▸ **isLive**(): `boolean`

Return true if the displayed video is a live stream.

#### Returns

`boolean`

**Since:** v4.0

***

### isMuted

▸ **isMuted**(): `boolean`

Returns true if the player has been muted.

#### Returns

`boolean`

**Since:** v4.0

***

### isPaused

▸ **isPaused**(): `boolean`

Returns true if the player has started playback but is currently paused.

#### Returns

`boolean`

**Since:** v4.0

***

### isPlaying

▸ **isPlaying**(): `boolean`

Returns true if the player is currently playing, i.e. has started and is not paused.

#### Returns

`boolean`

**Since:** v4.0

***

### isStalled

▸ **isStalled**(): `boolean`

Returns true if the player is currently stalling due to an empty buffer.

#### Returns

`boolean`

**Since:** v4.0

***

### isViewModeAvailable

▸ **isViewModeAvailable**(`viewMode`): `boolean`

Tests if a particular [ViewMode](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode) is available for selection with [setViewMode](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#setviewmode).

#### Parameters

| Name       | Type                                  | Description           |
| :--------- | :------------------------------------ | :-------------------- |
| `viewMode` | [`ViewMode`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode) | the view mode to test |

#### Returns

`boolean`

`true` if the tested view mode is available, else `false`

**Since:** v8.0

***

### load

▸ **load**(`source`, `forceTechnology?`, `disableSeeking?`): `Promise`<`void`>

Sets a new video source and returns a promise which resolves to the player.

#### Parameters

| Name               | Type                                                     | Description                                                                                                                                                                                                                                                                     |
| :----------------- | :------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `source`           | [`SourceConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-source-config#sourceconfig) | The source the player should load.                                                                                                                                                                                                                                              |
| `forceTechnology?` | `string`                                                 | Forces the player to use the specified playback and streaming technology. The specified technologies have to be separated by a period (e.g. 'html5.hls'). A list of valid combinations can be retrieved by calling [getSupportedTech](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getsupportedtech). |
| `disableSeeking?`  | `boolean`                                                | If set, seeking will be disabled                                                                                                                                                                                                                                                |

#### Returns

`Promise`<`void`>

**Since:** v4.0

***

### mute

▸ **mute**(`issuer?`): `void`

Mutes the player if an audio track is available. Has no effect if the player is already muted.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`void`

**Since:** v4.0

***

### off

▸ **off**<`T`>(`eventType`, `callback`): `void`

Removes a handler for a player event. This method was called `removeEventHandler` in previous
player versions.

#### Type parameters

| Name | Type                                                    |
| :--- | :------------------------------------------------------ |
| `T`  | extends [`PlayerEvent`](https://developer.bitmovin.com/playback/reference/web-sdk-events#playerevent) |

#### Parameters

| Name        | Type                                                                      | Description                          |
| :---------- | :------------------------------------------------------------------------ | :----------------------------------- |
| `eventType` | `T`                                                                       | The event to remove the handler from |
| `callback`  | [`PlayerEventCallback`](https://developer.bitmovin.com/playback/reference/web-sdk-event-types#playereventcallback)<`T`> | The callback handler to remove       |

#### Returns

`void`

**Since:** v7.8

***

### on

▸ **on**<`T`>(`eventType`, `callback`): `void`

Subscribes an event handler to a player event. This method was called `addEventHandler` in previous
player versions.

#### Type parameters

| Name | Type                                                    |
| :--- | :------------------------------------------------------ |
| `T`  | extends [`PlayerEvent`](https://developer.bitmovin.com/playback/reference/web-sdk-events#playerevent) |

#### Parameters

| Name        | Type                                                                      | Description                                                          |
| :---------- | :------------------------------------------------------------------------ | :------------------------------------------------------------------- |
| `eventType` | `T`                                                                       | The type of event to subscribe to.                                   |
| `callback`  | [`PlayerEventCallback`](https://developer.bitmovin.com/playback/reference/web-sdk-event-types#playereventcallback)<`T`> | The event callback handler that will be called when the event fires. |

#### Returns

`void`

**Since:** v7.8

***

### pause

▸ **pause**(`issuer?`): `void`

Pauses the video if it is playing. Has no effect if the player is already paused.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`void`

**Since:** v4.0

***

### play

▸ **play**(`issuer?`): `Promise`<`void`>

Starts playback or resumes after being paused. No need to call it if the player is setup with
autoplay attribute ([autoplay](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#autoplay)). Has no effect if the player is already playing.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`Promise`<`void`>

a Promise which resolves as soon as playback has actually started. This promise can reject
if play is prohibited by the browser (a missing user interaction for example)

**Since:** v4.0

***

### preload

▸ **preload**(): `void`

Starts preloading the content of the currently loaded source.

#### Returns

`void`

**Since:** v6.1

***

### seek

▸ **seek**(`time`, `issuer?`): `boolean`

Seeks to the given playback time specified by the parameter time in seconds. Must not be greater
than the total duration of the video. Has no effect when watching a live stream as seeking is
not possible.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `time`    | `number` | The time to seek to                                                             |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`boolean`

**Since:** v4.0

***

### setAspectRatio

▸ **setAspectRatio**(`aspectratio`): `void`

Modifies the current aspect ratio of the player. Can be used to override the [aspectratio](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#aspectratio)
that is optionally passed during player initialization. Has no effect if the player has also been configured
to have a fixed [width](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#width) and [height](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#height): in general, no more than two options
among `width`, `height`, and `aspectratio` should be provided to the player.

#### Parameters

| Name          | Type                 | Description                                                                                                           |
| :------------ | :------------------- | :-------------------------------------------------------------------------------------------------------------------- |
| `aspectratio` | `string` \| `number` | The desired aspect ratio for the player. It can be a string (e.g. '16:9' or '16/9'), or a number (e.g 1.6 for 16:10). |

#### Returns

`void`

**Since:** v8.74

***

### setAudio

▸ **setAudio**(`trackID`): `void`

Sets the audio track to the ID specified by trackID.
Available tracks can be retrieved with [getAvailableAudio](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudio).

#### Parameters

| Name      | Type     | Description                           |
| :-------- | :------- | :------------------------------------ |
| `trackID` | `string` | The ID of the audio track to activate |

#### Returns

`void`

**Since:** v4.0

***

### setAudioQuality

▸ **setAudioQuality**(`audioQualityID`): `void`

Manually sets the audio stream to a fixed quality, identified by ID. Has to be an ID defined in
the MPD or the keyword 'auto'. Auto resets to dynamic switching. A list with valid IDs can be
retrieved by calling [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities).

#### Parameters

| Name             | Type     | Description                                                         |
| :--------------- | :------- | :------------------------------------------------------------------ |
| `audioQualityID` | `string` | The ID of the desired audio quality or 'auto' for dynamic switching |

#### Returns

`void`

**Since:** v4.0

***

### setAuthentication

▸ **setAuthentication**(`customData`): `void`

Sets authentication data which is sent along with the licensing call. Can be used to add more
information for a 3rd party licensing backend. The data be any type or object as needed by the
3rd party licensing backend.

#### Parameters

| Name         | Type  | Description                                       |
| :----------- | :---- | :------------------------------------------------ |
| `customData` | `any` | Data which should be sent with the licensing call |

#### Returns

`void`

**Since:** v4.2

***

### setLogLevel

▸ **setLogLevel**(`level`): `void`

Sets the level of player log outputs.

#### Parameters

| Name    | Type                                             | Description                                                             |
| :------ | :----------------------------------------------- | :---------------------------------------------------------------------- |
| `level` | [`LogLevel`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#loglevel) | Log level, allowed values are "debug", "log", "warn", "error" and "off" |

#### Returns

`void`

**Since:** v6.1

***

### setPlaybackSpeed

▸ **setPlaybackSpeed**(`speed`): `void`

\[<i>HTML5 only</i>]
Sets the playback speed of the player. Fast forward as well as slow motion is supported.
Slow motion is used by values between 0 and 1, fast forward by values greater than 1.

#### Parameters

| Name    | Type     | Description                            |
| :------ | :------- | :------------------------------------- |
| `speed` | `number` | A playback speed factor greater than 0 |

#### Returns

`void` [getPlaybackSpeed](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackspeed)

**Since:** v4.0

***

### setPosterImage

▸ **setPosterImage**(`url`, `keepPersistent`): `void`

Sets a poster image. Will be displayed immediately, even if a video stream is playing.

#### Parameters

| Name             | Type      | Description                                                                                                      |
| :--------------- | :-------- | :--------------------------------------------------------------------------------------------------------------- |
| `url`            | `string`  | The URL to the poster image                                                                                      |
| `keepPersistent` | `boolean` | Flag to set the poster image persistent so it is also displayed during playback (useful for audio-only playback) |

#### Returns

`void`

**Since:** v4.3

***

### setQueryParameters

▸ **setQueryParameters**(`queryParameters`): `void`

Adds GET parameters to all request URLs (e.g. manifest, media segments, subtitle files, …).
The queryParameters should be an object with key value pairs, where the keys are used as
parameter name and the values as parameter values.

#### Parameters

| Name              | Type                                                     | Description                                 |
| :---------------- | :------------------------------------------------------- | :------------------------------------------ |
| `queryParameters` | [`QueryParameters`](https://developer.bitmovin.com/playback/reference/web-sdk-network#queryparameters) | The list of query parameter key/value pairs |

#### Returns

`void`

**Since:** v4.1

***

### setVideoElement

▸ **setVideoElement**(`videoElement`): `void`

Passes an HTML video element to the player, which should be used in case of Html5 or Native playback.
Needs to be called before [load](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#load).

#### Parameters

| Name           | Type          | Description                   |
| :------------- | :------------ | :---------------------------- |
| `videoElement` | `HTMLElement` | The HTML video element to use |

#### Returns

`void`

**Since:** v5.1

***

### setVideoQuality

▸ **setVideoQuality**(`videoQualityID`): `void`

Manually sets the video stream to a fixed quality, identified by ID. Has to be an ID defined in
the MPD or the keyword 'auto'. Auto resets to dynamic switching. A list with valid IDs can be retrieved
by calling [getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities).

#### Parameters

| Name             | Type     | Description                     |
| :--------------- | :------- | :------------------------------ |
| `videoQualityID` | `string` | ID defined in the MPD or 'auto' |

#### Returns

`void`

**Since:** v4.0

***

### setViewMode

▸ **setViewMode**(`viewMode`, `options?`): `void`

Sets the player to a particular [ViewMode](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode). Will only work if the selected view mode is available and
[isViewModeAvailable](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#isviewmodeavailable) returns `true`, else this call will be ignored. If successful, a
[ViewModeChanged](https://developer.bitmovin.com/playback/reference/web-sdk-events#viewmodechanged) will be fired.

#### Parameters

| Name       | Type                                                | Description                                   |
| :--------- | :-------------------------------------------------- | :-------------------------------------------- |
| `viewMode` | [`ViewMode`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode)               | the view mode to switch the player into       |
| `options?` | [`ViewModeOptions`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmodeoptions) | additional optional parameters for view modes |

#### Returns

`void`

**Since:** v8.0

***

### setVolume

▸ **setVolume**(`volume`, `issuer?`): `void`

Sets the player’s volume in the range of 0 (silent) to 100 (max volume). Unmutes a muted player.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `volume`  | `number` | The volume to set between 0 and 100                                             |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`void`

**Since:** v4.0

***

### showAirplayTargetPicker

▸ **showAirplayTargetPicker**(): `void`

Shows the airplay playback target picker.

#### Returns

`void`

**Since:** v7.1

***

### timeShift

▸ **timeShift**(`offset`, `issuer?`): `void`

Shifts the time to the given offset in seconds from the live edge. Has to be within [getMaxTimeShift](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getmaxtimeshift)
(which is a negative value) and 0. Only works in live streams. <span class='highlight'>\[new in v4.3]</span>: The offset can be positive and is then interpreted as a UNIX
timestamp in seconds. The value has to be within the timeShift window as specified by [getMaxTimeShift](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getmaxtimeshift).

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `offset`  | `number` | The offset to timeshift to                                                      |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`void`

**Since:** v4.0

***

### unload

▸ **unload**(): `Promise`<`void`>

Unloads the current video source.

#### Returns

`Promise`<`void`>

**Since:** v4.0

***

### unmute

▸ **unmute**(`issuer?`): `void`

Unmutes the player if muted.

#### Parameters

| Name      | Type     | Description                                                                     |
| :-------- | :------- | :------------------------------------------------------------------------------ |
| `issuer?` | `string` | The issuer of the API call that will be passed to events triggered by this call |

#### Returns

`void`

**Since:** v4.0

***

## StaticPlayerAPI

> Interface

The static interface of the Bitmovin Player API class that is either available through the global <code>\[window.]bitmovin.player.Player</code> namespace or imported as AMD module.
The static API provides the constructor for player instances and other static fields as documented.

## Constructors

### constructor

• **new StaticPlayerAPI**(`containerElement`, `config`): [`PlayerAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playerapi)

Creates a new player instance.

#### Parameters

| Name               | Type                                                     | Description                              |
| :----------------- | :------------------------------------------------------- | :--------------------------------------- |
| `containerElement` | `HTMLElement`                                            | the DOM element container for the player |
| `config`           | [`PlayerConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#playerconfig) | the player configuration                 |

#### Returns

[`PlayerAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playerapi)

the player instance

## Properties

### version

• `Readonly` **version**: `string`

The version number of the player.

## Methods

### addModule

▸ **addModule**(`moduleDefinition`): `void`

Adds a module into the player.

#### Parameters

| Name               | Type  | Description                                           |
| :----------------- | :---- | :---------------------------------------------------- |
| `moduleDefinition` | `any` | the module object which should be added to the player |

#### Returns

`void`

***

### getModules

▸ **getModules**(): [`ModuleName`](https://developer.bitmovin.com/playback/reference/web-sdk-modules#modulename)\[]

Gets the list of modules that have been added through [addModule](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#addmodule).

#### Returns

[`ModuleName`](https://developer.bitmovin.com/playback/reference/web-sdk-modules#modulename)\[]

the list of added modules

***

### removeModule

▸ **removeModule**(`name`): `void`

Removes a module from the player.

#### Parameters

| Name   | Type                                           | Description                                              |
| :----- | :--------------------------------------------- | :------------------------------------------------------- |
| `name` | [`ModuleName`](https://developer.bitmovin.com/playback/reference/web-sdk-modules#modulename) | the module name which should be removed from the player. |

#### Returns

`void`

***

## PlayerExports

> Interface

## Properties

### AdQuartile

• `Readonly` **AdQuartile**: typeof [`AdQuartile`](https://developer.bitmovin.com/playback/reference/web-sdk-advertising#adquartile)

***

### BufferType

• `Readonly` **BufferType**: typeof [`BufferType`](https://developer.bitmovin.com/playback/reference/web-sdk-buffer#buffertype)

***

### ErrorCode

• `Readonly` **ErrorCode**: typeof [`ErrorCode`](https://developer.bitmovin.com/playback/reference/web-sdk-errors#errorcode)

***

### HttpRequestMethod

• `Readonly` **HttpRequestMethod**: typeof [`HttpRequestMethod`](https://developer.bitmovin.com/playback/reference/web-sdk-network#httprequestmethod)

***

### HttpRequestType

• `Readonly` **HttpRequestType**: typeof [`HttpRequestType`](https://developer.bitmovin.com/playback/reference/web-sdk-network#httprequesttype)

***

### HttpResponseType

• `Readonly` **HttpResponseType**: typeof [`HttpResponseType`](https://developer.bitmovin.com/playback/reference/web-sdk-network#httpresponsetype)

***

### LogLevel

• `Readonly` **LogLevel**: typeof [`LogLevel`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#loglevel)

***

### MediaType

• `Readonly` **MediaType**: typeof [`MediaType`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatype)

***

### ModuleName

• `Readonly` **ModuleName**: typeof [`ModuleName`](https://developer.bitmovin.com/playback/reference/web-sdk-modules#modulename)

***

### PlayerAPINotAvailableError

• `Readonly` **PlayerAPINotAvailableError**: typeof [`PlayerAPINotAvailableError`](https://developer.bitmovin.com/playback/reference/web-sdk-errors#playerapinotavailableerror)

***

### PlayerError

• `Readonly` **PlayerError**: typeof [`PlayerError`](https://developer.bitmovin.com/playback/reference/web-sdk-errors#playererror)

***

### PlayerEvent

• `Readonly` **PlayerEvent**: typeof [`PlayerEvent`](https://developer.bitmovin.com/playback/reference/web-sdk-events#playerevent)

***

### PlayerModuleMissingError

• `Readonly` **PlayerModuleMissingError**: typeof [`PlayerModuleMissingError`](https://developer.bitmovin.com/playback/reference/web-sdk-errors#playermodulemissingerror)

***

### PlayerType

• `Readonly` **PlayerType**: typeof [`PlayerType`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#playertype)

***

### SupportedTechnologyMode

• `Readonly` **SupportedTechnologyMode**: typeof [`SupportedTechnologyMode`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#supportedtechnologymode)

***

### ViewMode

• `Readonly` **ViewMode**: typeof [`ViewMode`](https://developer.bitmovin.com/playback/reference/web-sdk-vr#viewmode)

***

### WarningCode

• `Readonly` **WarningCode**: typeof [`WarningCode`](https://developer.bitmovin.com/playback/reference/web-sdk-errors#warningcode)

***

## Snapshot

> Interface

A snapshot of a video frame.

## Properties

### data

• **data**: `String`

A Base64-encoded string that contains the image.

***

### height

• **height**: `number`

The height of the image.

***

### width

• **width**: `number`

The width of the image.

***

## Quality

> Interface

Quality definition of a media representation.

## Hierarchy

* **`Quality`**

  ↳ [`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)

  ↳ [`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)

## Properties

### bitrate

• **bitrate**: `number`

The bitrate of the media representation.

***

### codec

• `Optional` **codec**: `string`

The codec of the media representation.

***

### id

• **id**: `string`

The id of the media representation.

***

### label

• `Optional` **label**: `string`

The label of the media representation that should be exposed to the user (e.g. in the UI).
Only set when requesting qualities through [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities) and
[getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities).

***

### uid

• `Optional` **uid**: `string`

The unique id of the current segment.
Only set when requesting the video quality through [getPlaybackVideoData](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackvideodata).

***

## QualityMetadata

> Interface

## Properties

### bitrate

• **bitrate**: `number`

Bitrate of the quality.

***

### frameRate

• `Optional` **frameRate**: `number`

Frame rate of the quality. Only applicable for video tracks, otherwise `undefined`.

***

### height

• **height**: `number`

Height of the quality. Only applicable for video tracks, otherwise `undefined`.

***

### id

• **id**: `string`

Unique identifier of the quality.

***

### mimeType

• **mimeType**: `string`

Mime type of the quality.

***

### qualityRanking

• `Optional` **qualityRanking**: `number`

The quality ranking as given in the manifest. `undefined` if not present.

***

### width

• **width**: `number`

Width of the quality. Only applicable for video tracks, otherwise `undefined`.

***

## AudioQuality

> Interface

Quality definition of an audio representation.

* [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities)
* [getAudioQuality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getaudioquality)
* [getPlaybackAudioData](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackaudiodata)

## Hierarchy

* [`Quality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality)

  ↳ **`AudioQuality`**

## Properties

### bitrate

• **bitrate**: `number`

The bitrate of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[bitrate](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#bitrate)

***

### channels

• `Optional` **channels**: `number`

The number of audio channels

***

### codec

• `Optional` **codec**: `string`

The codec of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[codec](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#codec)

***

### id

• **id**: `string`

The id of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[id](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#id)

***

### label

• `Optional` **label**: `string`

The label of the media representation that should be exposed to the user (e.g. in the UI).
Only set when requesting qualities through [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities) and
[getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities).

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[label](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#label)

***

### uid

• `Optional` **uid**: `string`

The unique id of the current segment.
Only set when requesting the video quality through [getPlaybackVideoData](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackvideodata).

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[uid](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#uid)

***

## VideoQuality

> Interface

Quality definition of a video representation.

* [getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities)
* [getVideoQuality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getvideoquality)
* [getPlaybackVideoData](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackvideodata)

## Hierarchy

* [`Quality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality)

  ↳ **`VideoQuality`**

## Properties

### bitrate

• **bitrate**: `number`

The bitrate of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[bitrate](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#bitrate)

***

### codec

• `Optional` **codec**: `string`

The codec of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[codec](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#codec)

***

### frameRate

• `Optional` **frameRate**: `number`

Frame rate of the video representation as stated in the manifest

***

### height

• **height**: `number`

The heights of the video representation.

***

### id

• **id**: `string`

The id of the media representation.

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[id](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#id)

***

### label

• `Optional` **label**: `string`

The label of the media representation that should be exposed to the user (e.g. in the UI).
Only set when requesting qualities through [getAvailableAudioQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailableaudioqualities) and
[getAvailableVideoQualities](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getavailablevideoqualities).

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[label](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#label)

***

### uid

• `Optional` **uid**: `string`

The unique id of the current segment.
Only set when requesting the video quality through [getPlaybackVideoData](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getplaybackvideodata).

#### Inherited from

[Quality](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#quality).[uid](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#uid)

***

### width

• **width**: `number`

The width of the video representation.

***

## AudioTrack

> Interface

Definition of an audio track.

## Hierarchy

* [`MediaTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack)

  ↳ **`AudioTrack`**

## Properties

### id

• **id**: `string`

The id of the media track that is used to identify and set the track.

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[id](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#id)

***

### label

• **label**: `string`

The text used to represent this track to the user (e.g. in the UI).

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[label](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#label)

***

### lang

• **lang**: `string`

The language of the audio track.

***

### metadata

• `Optional` **metadata**: [`MediaTrackMetadata`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackmetadata)\[]

Optional custom metadata about the track.
This is currently only supported for DASH manifests, where these are populated from SupplementalProperty elements.

**Since:** 8.243.0

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[metadata](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#metadata)

***

### role

• `Optional` **role**: [`MediaTrackRole`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackrole)\[]

The optional roles of the track.

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[role](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#role)

## Methods

### getQualities

▸ **getQualities**(): [`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)\[]

Returns the available audio qualities.

#### Returns

[`AudioQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audioquality)\[]

***

## VideoTrack

> Interface

Definition of a video track.

## Hierarchy

* [`MediaTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack)

  ↳ **`VideoTrack`**

## Properties

### id

• **id**: `string`

The id of the media track that is used to identify and set the track.

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[id](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#id)

***

### label

• **label**: `string`

The text used to represent this track to the user (e.g. in the UI).

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[label](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#label)

***

### metadata

• `Optional` **metadata**: [`MediaTrackMetadata`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackmetadata)\[]

Optional custom metadata about the track.
This is currently only supported for DASH manifests, where these are populated from SupplementalProperty elements.

**Since:** 8.243.0

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[metadata](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#metadata)

***

### role

• `Optional` **role**: [`MediaTrackRole`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackrole)\[]

The optional roles of the track.

#### Inherited from

[MediaTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrack).[role](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#role)

## Methods

### getQualities

▸ **getQualities**(): [`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)\[]

Returns the available video qualities.

#### Returns

[`VideoQuality`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videoquality)\[]

***

## MediaTrack

> Interface

## Hierarchy

* **`MediaTrack`**

  ↳ [`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)

  ↳ [`VideoTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videotrack)

  ↳ [`TextTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#texttrack)

## Properties

### id

• **id**: `string`

The id of the media track that is used to identify and set the track.

***

### label

• **label**: `string`

The text used to represent this track to the user (e.g. in the UI).

***

### metadata

• `Optional` **metadata**: [`MediaTrackMetadata`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackmetadata)\[]

Optional custom metadata about the track.
This is currently only supported for DASH manifests, where these are populated from SupplementalProperty elements.

**Since:** 8.243.0

***

### role

• `Optional` **role**: [`MediaTrackRole`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#mediatrackrole)\[]

The optional roles of the track.

***

## MediaTrackMetadata

> Interface

Describes custom metadata associated with a media track, e.g. an [AudioTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack).

**Since:** 8.243.0

## Indexable

▪ \[key: `string`]: `string` | `undefined`

## Properties

### id

• `Optional` **id**: `string`

***

### schemeIdUri

• `Optional` **schemeIdUri**: `string`

***

### value

• `Optional` **value**: `string`

***

## MediaTrackRole

> Interface

Describes the role of a media track, e.g. an [AudioTrack](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack).

## Indexable

▪ \[key: `string`]: `string` | `undefined`

## Properties

### id

• `Optional` **id**: `string`

***

### schemeIdUri

• **schemeIdUri**: `string`

***

### value

• `Optional` **value**: `string`

***

## TrackMetadata

> Interface

## Properties

### id

• `Optional` **id**: `string`

Unique identifier of the track.

***

### lang

• `Optional` **lang**: `string`

Language of the track. Only applicable for audio and subtitles, otherwise `undefined`.

***

### mimeType

• `Optional` **mimeType**: `string`

Mime type of the track.

***

## Thumbnail

> Interface

Properties of a thumbnail out of a seeking thumbnail preview definition.

## Properties

### end

• **end**: `number`

End time of the thumbnail.

***

### height

• **height**: `number`

Height of the thumbnail.

***

### start

• **start**: `number`

Start time of the thumbnail.

***

### text

• **text**: `string`

Raw cue data.

***

### url

• **url**: `string`

URL of the spritesheet.

***

### width

• **width**: `number`

Width of the thumbnail.

***

### x

• **x**: `number`

Horizontal offset of the thumbnail in its spritesheet.

***

### y

• **y**: `number`

Vertical offset of the thumbnail in its spritesheet.

***

## TimeRange

> Interface

## Properties

### end

• **end**: `number`

The end of the range.

***

### start

• **start**: `number`

The start of the range

***

## Attributes

> Interface

## Indexable

▪ \[name: `string`]: `any`

***

## Metadata

> Interface

## Properties

### end

• `Optional` **end**: `number`

The end time of the metadata.

***

### payload

• **payload**: `any`

the actual metadata.

***

### start

• `Optional` **start**: `number`

The start time of the metadata.

***

### type

• **type**: [`MetadataType`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#metadatatype)

The type of timed metadata.

***

## Period

> Interface

## Properties

### id

• **id**: `string`

The ID of the `Period`.

***

### properties

• **properties**: `Object`

Contains `Period` attributes as defined in the MPD.

#### Index signature

▪ \[key: `string`]: `string`

## Methods

### getAudioTracks

▸ **getAudioTracks**(): [`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

Returns available audio tracks of the `Period`.

#### Returns

[`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

***

### getMetadata

▸ **getMetadata**(): [`Metadata`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#metadata)\[]

Returns metadata contained in the `EventStream` of the `Period`.

#### Returns

[`Metadata`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#metadata)\[]

***

### getTextTracks

▸ **getTextTracks**(): [`TextTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#texttrack)\[]

Returns available text tracks of the `Period`.

#### Returns

[`TextTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#texttrack)\[]

***

### getVideoTracks

▸ **getVideoTracks**(): [`VideoTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videotrack)\[]

Returns available video tracks of the `Period`.

#### Returns

[`VideoTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videotrack)\[]

***

## PeriodContentInformation

> Interface

Content information about one track inside the Period.

## Properties

### codec

• **codec**: `string`

The codec of the content.

***

### isDrmProtected

• **isDrmProtected**: `boolean`

Whether the content is DRM-protected.

***

### mimeType

• **mimeType**: `string`

The mime type of the content, expressed in the format `content-type/container-format` (e.g. `video/mp4`).

***

## PeriodInformation

> Interface

Information about a period that is relevant for the decision on whether to recreate SourceBuffers or not.

## Properties

### contentInformation

• **contentInformation**: [`PeriodContentInformation`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#periodcontentinformation)\[]

Information about the content of the period, one entry per available track.

***

### periodId

• **periodId**: `string`

The ID of the period (always `0` for HLS).

***

## PeriodSwitchObject

> Interface

## Properties

### periodId

• **periodId**: `string`

***

## PlayerManifestAPI

> Interface

## Properties

### dash

• `Optional` **dash**: [`DashAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#dashapi)

Offers insight into the loaded DASH manifest.

***

### hls

• `Optional` **hls**: [`HlsAPI`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#hlsapi)

Offers insight into the loaded HLS manifest.

***

## DashAPI

> Interface

## Methods

### getPeriod

▸ **getPeriod**(): [`Period`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#period)

Returns the currently playing `Period`.

#### Returns

[`Period`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#period)

***

### listPeriods

▸ **listPeriods**(): [`Period`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#period)\[]

Returns all available `Periods`.

#### Returns

[`Period`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#period)\[]

***

## HlsAPI

> Interface

## Properties

### properties

• **properties**: [`HlsTag`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#hlstag)\[]

Contains all tags found in the Master Playlist.

## Methods

### getAudioTracks

▸ **getAudioTracks**(): [`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

Returns available audio tracks.

#### Returns

[`AudioTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#audiotrack)\[]

***

### getTextTracks

▸ **getTextTracks**(): [`TextTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#texttrack)\[]

Returns available text tracks.

#### Returns

[`TextTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-subtitles#texttrack)\[]

***

### getVideoTracks

▸ **getVideoTracks**(): [`VideoTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videotrack)\[]

Returns available video tracks.

#### Returns

[`VideoTrack`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#videotrack)\[]

***

## HlsTag

> Interface

## Properties

### attributes

• `Optional` **attributes**: [`Attributes`](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#attributes)

The attributes of the HLS tag as key-value pairs.

***

### name

• **name**: `string`

The name of the HLS tag.

***

### value

• `Optional` **value**: `string`

The value of the HLS tag that is not part of its attributes.

***

## LowLatencyAPI

> Interface

## Methods

### getCatchupConfig

▸ **getCatchupConfig**(): [`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig)

Returns the current latency sync configuration for catchup.

#### Returns

[`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig)

the catchup sync configuration.

**Since:** v8.3

***

### getFallbackConfig

▸ **getFallbackConfig**(): [`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig)

Returns the current latency sync configuration for fallback.

#### Returns

[`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig)

the fallback sync configuration.

**Since:** v8.3

***

### getLatency

▸ **getLatency**(): `number`

Returns the current latency in seconds.

#### Returns

`number`

**Since:** v8.3

***

### getTargetLatency

▸ **getTargetLatency**(): `number`

Returns the current target latency in seconds.

#### Returns

`number`

**Since:** v8.3

***

### setCatchupConfig

▸ **setCatchupConfig**(`config`): `void`

Sets the configuration specifying parameters for latency catchup.

#### Parameters

| Name     | Type                                                                     | Description                                 |
| :------- | :----------------------------------------------------------------------- | :------------------------------------------ |
| `config` | [`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig) | the sync configuration for latency catchup. |

#### Returns

`void`

**Since:** v8.3

***

### setFallbackConfig

▸ **setFallbackConfig**(`config`): `void`

Sets the configuration specifying parameters for latency fallback.

#### Parameters

| Name     | Type                                                                     | Description                                  |
| :------- | :----------------------------------------------------------------------- | :------------------------------------------- |
| `config` | [`LowLatencySyncConfig`](https://developer.bitmovin.com/playback/reference/web-sdk-player-config#lowlatencysyncconfig) | the sync configuration for latency fallback. |

#### Returns

`void`

**Since:** v8.3

***

### setTargetLatency

▸ **setTargetLatency**(`latency`): `void`

Sets the target latency to be maintained during playback. Causes firing a [TargetLatencyChanged](https://developer.bitmovin.com/playback/reference/web-sdk-events#targetlatencychanged)
event.

#### Parameters

| Name      | Type     | Description                    |
| :-------- | :------- | :----------------------------- |
| `latency` | `number` | the target latency in seconds. |

#### Returns

`void`

**Since:** v8.3

***

## Stream

> Interface

## Type parameters

| Name | Type                     |
| :--- | :----------------------- |
| `T`  | extends `StreamDataType` |

## Methods

### getType

▸ **getType**(): `string`

The type of data that the stream carries.

#### Returns

`string`

string

***

### read

▸ **read**(): `Promise`<[`StreamResponse`](https://developer.bitmovin.com/playback/reference/web-sdk-network#streamresponse)<`T`>>

Provides the next data chunk in the stream and rejects once all data has been read.

#### Returns

`Promise`<[`StreamResponse`](https://developer.bitmovin.com/playback/reference/web-sdk-network#streamresponse)<`T`>>

***

## PlayerType

> Enum

* `html5`... The MediaSource Extension (MSE) based JavaScript player.
* `native`... The browser's native capabilities are being used, e.g. playing back HLS in Safari on iOS.
* `unknown`... The initial value where it is not known yet which player will be used.

## Enumeration Members

### Html5

• **Html5** = `"html5"`

***

### Native

• **Native** = `"native"`

***

### Unknown

• **Unknown** = `"unknown"`

***

### WebRtc

• **WebRtc** = `"webrtc"`

***

## TimeMode

> Enum

The mode for getting the player's current time. [getCurrentTime](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#getcurrenttime)

**Since:** v8.31.0

## Enumeration Members

### AbsoluteTime

• **AbsoluteTime** = `"absolutetime"`

Returns the Unix timestamp of the current playback time.
For live stream `EXT-X-PROGRAM-DATE-TIME` tags in HLS manifests are utilized for this value, if present.

***

### RelativeTime

• **RelativeTime** = `"relativetime"`

Returns the relative timestamp of the current playback time.
For live streams the beginning of the DVR window at the time of tuning in is defined as 0.

***

## TimelineReferencePoint

> Enum

## Enumeration Members

### End

• **End** = `"end"`

`startOffset` will be calculated from the end of the stream or the live edge in case of a live stream with DVR
window.

***

### Start

• **Start** = `"start"`

`startOffset` will be calculated from the beginning of the stream or DVR window.

***

## MediaType

> Enum

## Enumeration Members

### Audio

• **Audio** = `"audio"`

***

### Video

• **Video** = `"video"`

***

## MetadataType

> Enum

The supported types of timed metadata.

## Enumeration Members

### CAST

• **CAST** = `"CAST"`

Used for custom messages between the sender and the remote receiver, such as a Chromecast receiver app.
Refer to [addMetadata](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#addmetadata) for details.

***

### CUETAG

• **CUETAG** = `"CUETAG"`

HLS `#EXT-X-CUE-OUT`, `#EXT-X-CUE-OUT-CONT` and `#EXT-X-CUE-IN` tags are surfaced with this type.

***

### CUSTOM

• **CUSTOM** = `"CUSTOM"`

All custom, i.e. unknown/unsupported HLS tags are surfaced with this type.

***

### DATERANGE

• **DATERANGE** = `"DATERANGE"`

HLS `#EXT-X-DATERANGE` tags are surfaced with this type.

***

### EMSG

• **EMSG** = `"EMSG"`

EMSG data from MP4 container formats are surfaced with this type.
See [ID3](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#id3) for the MPEG-2 TS equivalent.

**Since:** v8.81.0 EMSG version 1 is also supported, prior to v8.81.0 only version 0 was supported.

***

### EVENT\_STREAM

• **EVENT\_STREAM** = `"EVENT-STREAM"`

DASH `EventStream` events (also known as `MPD Events`) are surfaced with this type.

***

### ID3

• **ID3** = `"ID3"`

ID3 tags from MPEG-2 Transport Stream container formats are surfaced with this type.
See [EMSG](https://developer.bitmovin.com/playback/reference/web-sdk-player-api#emsg) for the MP4 equivalent.

***

### SCTE

• **SCTE** = `"SCTE"`

HLS `#EXT-X-SCTE35` tags are surfaced with this type.

***

## ContentLocationChangedReason

> Enum

## Enumeration Members

### ContentSteering

• **ContentSteering** = `"contentsteering"`

The player switched content location as a result of a recommendation from the steering server,
i.e. it switched to a higher priority pathway.

***

### Failover

• **Failover** = `"failover"`

The player switched content location as a result of a failover, i.e. due to a network issue.