<commit_before># RxPlayer API ################################################################


## Table of Contents ###########################################################

- [Overview](#overview)
- [Instantiation](#instantiation)
- [Basic methods](#meth-group-basic)
    - [loadVideo](#meth-loadVideo)
    - [reload](#meth-reload)
    - [getPlayerState](#meth-getPlayerState)
    - [addEventListener](#meth-addEventListener)
    - [removeEventListener](#meth-removeEventListener)
    - [play](#meth-play)
    - [pause](#meth-pause)
    - [stop](#meth-stop)
    - [getPosition](#meth-getPosition)
    - [getWallClockTime](#meth-getWallClockTime)
    - [seekTo](#meth-seekTo)
    - [getMinimumPosition](#meth-getMinimumPosition)
    - [getMaximumPosition](#meth-getMaximumPosition)
    - [getVideoDuration](#meth-getVideoDuration)
    - [getError](#meth-getError)
    - [getVideoElement](#meth-getVideoElement)
    - [dispose](#meth-dispose)
 - [Speed control](#meth-group-speed-control)
    - [setPlaybackRate](#meth-setPlaybackRate)
    - [getPlaybackRate](#meth-getPlaybackRate)
 - [Volume control](#meth-group-volume-control)
    - [setVolume](#meth-setVolume)
    - [getVolume](#meth-getVolume)
    - [mute](#meth-mute)
    - [unMute](#meth-unMute)
    - [isMute](#meth-isMute)
  - [Track selection](#meth-track-selection)
    - [getAudioTrack](#meth-getAudioTrack)
    - [getTextTrack](#meth-getTextTrack)
    - [getVideoTrack](#meth-getVideoTrack)
    - [getAvailableAudioTracks](#meth-getAvailableAudioTracks)
    - [getAvailableTextTracks](#meth-getAvailableTextTracks)
    - [getAvailableVideoTracks](#meth-getAvailableVideoTracks)
    - [setAudioTrack](#meth-setAudioTrack)
    - [setTextTrack](#meth-setTextTrack)
    - [disableTextTrack](#meth-disableTextTrack)
    - [setVideoTrack](#meth-setVideoTrack)
    - [disableVideoTrack](#meth-disableVideoTrack)
    - [setPreferredAudioTracks](#meth-setPreferredAudioTracks)
    - [getPreferredAudioTracks](#meth-getPreferredAudioTracks)
    - [setPreferredTextTracks](#meth-setPreferredTextTracks)
    - [getPreferredTextTracks](#meth-getPreferredTextTracks)
    - [setPreferredVideoTracks](#meth-setPreferredVideoTracks)
    - [getPreferredVideoTracks](#meth-getPreferredVideoTracks)
 - [Bitrate selection](#meth-group-bitrate-selection)
    - [getAvailableVideoBitrates](#meth-getAvailableVideoBitrates)
    - [getAvailableAudioBitrates](#meth-getAvailableAudioBitrates)
    - [getVideoBitrate](#meth-getVideoBitrate)
    - [getAudioBitrate](#meth-getAudioBitrate)
    - [setMaxVideoBitrate](#meth-setMaxVideoBitrate)
    - [setMaxAudioBitrate](#meth-setMaxAudioBitrate)
    - [getMaxVideoBitrate](#meth-getMaxVideoBitrate)
    - [getMaxAudioBitrate](#meth-getMaxAudioBitrate)
    - [setVideoBitrate](#meth-setVideoBitrate)
    - [setAudioBitrate](#meth-setAudioBitrate)
    - [getManualVideoBitrate](#meth-getManualVideoBitrate)
    - [getManualAudioBitrate](#meth-getManualAudioBitrate)
  - [Buffer control](#meth-group-buffer-control)
    - [setWantedBufferAhead](#meth-setWantedBufferAhead)
    - [getWantedBufferAhead](#meth-getWantedBufferAhead)
    - [setMaxBufferBehind](#meth-setMaxBufferBehind)
    - [getMaxBufferBehind](#meth-getMaxBufferBehind)
    - [setMaxBufferAhead](#meth-setMaxBufferAhead)
    - [getMaxBufferAhead](#meth-getMaxBufferAhead)
 - [Buffer information](#meth-group-buffer-info)
    - [getVideoLoadedTime](#meth-getVideoLoadedTime)
    - [getVideoPlayedTime](#meth-getVideoPlayedTime)
    - [getVideoBufferGap](#meth-getVideoBufferGap)
 - [Content information](#meth-group-content-info)
    - [isLive](#meth-isLive)
    - [getUrl](#meth-getUrl)
    - [getCurrentKeySystem](#meth-getCurrentKeySystem)
 - [Deprecated](#meth-group-deprecated)
    - [getManifest (deprecated)](#meth-getManifest)
    - [getCurrentAdaptations (deprecated)](#meth-getCurrentAdaptations)
    - [getCurrentRepresentations (deprecated)](#meth-getCurrentRepresentations)
    - [getImageTrackData (deprecated)](#meth-getImageTrackData)
    - [setFullscreen (deprecated)](#meth-setFullscreen)
    - [exitFullscreen (deprecated)](#meth-exitFullscreen)
    - [isFullscreen (deprecated)](#meth-isFullscreen)
    - [getNativeTextTrack (deprecated)](#meth-getNativeTextTrack)
- [Static properties](#static)
    - [version](#static-version)
    - [ErrorTypes](#static-ErrorTypes)
    - [ErrorCodes](#static-ErrorCodes)
    - [LogLevel](#static-LogLevel)
- [Tools](#tools)
    - [StringUtils](#tools-string-parsing)
    - [TextTrackRenderer](#tools-textTrackRenderer)
    - [Experimental - MediaCapabilitiesProber](#tools-mediaCapabilitiesProber)
    - [Experimental - parseBifThumbnails](#tools-parseBifThumbnails)
    - [Experimental - createMetaplaylist](#tools-createMetaplaylist)



<a name="overview"></a>
## Overview ####################################################################

The RxPlayer has a complete API allowing you to:
  - load and stop contents containing video and/or audio media data
  - control playback (play, pause, seek, etc.) when a content is loaded.
  - get multiple information on the current content and on the player's state.
  - choose a specific audio language, subtitles track video track
  - force a given bitrate
  - update the wanted buffer length to reach
  - and more

The following pages define the entire API.

:warning: Only variables and methods defined here are considered as part of the
API. Any other property or method you might find in any other way are not
considered as part of the API and can thus change without notice.

_Note: As some terms used here might be too foreign or slightly different than
the one you're used to, we also wrote a list of terms and definitions used by
the RxPlayer [here](../terms.md)._



<a name="instantiation"></a>
## Instantiation ##############################################################

Instantiating a new RxPlayer is necessary before being able to load a content.
Doing so is straightforward:
```js
import RxPlayer from "rx-player";
const player = new RxPlayer(options);
```

The options are all... optional. They are all defined in the [Player Options
page](./player_options.md).



<a name="meth-group-basic"></a>
## Basic methods ###############################################################

In this chapter, we will go through the basic methods you will need to use when
playing a content through the RxPlayer.

<a name="meth-loadVideo"></a>
### loadVideo ##################################################################

_arguments_:
  - _options_ (``Object``)

Loads the content described in the argument.

This is the central method to use when you want to play a new content.
The options possible as arguments are all defined in [this
page](./loadVideo_options.md).

Despite its name, this method can also load audio-only content.

#### Example

```js
player.loadVideo({
  url: "http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_6s/Manifest.mpd",
  transport: "dash",
  autoPlay: true,
});
```

<a name="meth-reload"></a>
### reload #####################################################################

_arguments_:
  - _options_ (``Object | undefined``)

Re-load the last loaded content as fast as possible.

This API can be called at any time after a content has been loaded (the LOADED
state has been reached), even if the player has been stopped since and even if
it was due to a fatal error.

The user may need to call this API in several cases. For example, it may be used
in case of an error that will not reproduce or inversely when the error is
consistent at a certain playback time (e.g. due to a specific chunk defect).

The options argument is an object containing :
- _reloadAt_ (``Object | undefined``): The object contain directives about
the starting playback position :
  - _relative_ (``string | undefined``) : start playback relatively from the
  last playback position (last played position before entering into STOPPED or
  ENDED state).
  - _position_ (`string`|`undefined`) : absolutve position at which we should
  start playback

If no reload position is defined, start playback at the last playback position.
<commit_msg>doc: fixed typo<commit_after># RxPlayer API ################################################################


## Table of Contents ###########################################################

- [Overview](#overview)
- [Instantiation](#instantiation)
- [Basic methods](#meth-group-basic)
    - [loadVideo](#meth-loadVideo)
    - [reload](#meth-reload)
    - [getPlayerState](#meth-getPlayerState)
    - [addEventListener](#meth-addEventListener)
    - [removeEventListener](#meth-removeEventListener)
    - [play](#meth-play)
    - [pause](#meth-pause)
    - [stop](#meth-stop)
    - [getPosition](#meth-getPosition)
    - [getWallClockTime](#meth-getWallClockTime)
    - [seekTo](#meth-seekTo)
    - [getMinimumPosition](#meth-getMinimumPosition)
    - [getMaximumPosition](#meth-getMaximumPosition)
    - [getVideoDuration](#meth-getVideoDuration)
    - [getError](#meth-getError)
    - [getVideoElement](#meth-getVideoElement)
    - [dispose](#meth-dispose)
 - [Speed control](#meth-group-speed-control)
    - [setPlaybackRate](#meth-setPlaybackRate)
    - [getPlaybackRate](#meth-getPlaybackRate)
 - [Volume control](#meth-group-volume-control)
    - [setVolume](#meth-setVolume)
    - [getVolume](#meth-getVolume)
    - [mute](#meth-mute)
    - [unMute](#meth-unMute)
    - [isMute](#meth-isMute)
  - [Track selection](#meth-track-selection)
    - [getAudioTrack](#meth-getAudioTrack)
    - [getTextTrack](#meth-getTextTrack)
    - [getVideoTrack](#meth-getVideoTrack)
    - [getAvailableAudioTracks](#meth-getAvailableAudioTracks)
    - [getAvailableTextTracks](#meth-getAvailableTextTracks)
    - [getAvailableVideoTracks](#meth-getAvailableVideoTracks)
    - [setAudioTrack](#meth-setAudioTrack)
    - [setTextTrack](#meth-setTextTrack)
    - [disableTextTrack](#meth-disableTextTrack)
    - [setVideoTrack](#meth-setVideoTrack)
    - [disableVideoTrack](#meth-disableVideoTrack)
    - [setPreferredAudioTracks](#meth-setPreferredAudioTracks)
    - [getPreferredAudioTracks](#meth-getPreferredAudioTracks)
    - [setPreferredTextTracks](#meth-setPreferredTextTracks)
    - [getPreferredTextTracks](#meth-getPreferredTextTracks)
    - [setPreferredVideoTracks](#meth-setPreferredVideoTracks)
    - [getPreferredVideoTracks](#meth-getPreferredVideoTracks)
 - [Bitrate selection](#meth-group-bitrate-selection)
    - [getAvailableVideoBitrates](#meth-getAvailableVideoBitrates)
    - [getAvailableAudioBitrates](#meth-getAvailableAudioBitrates)
    - [getVideoBitrate](#meth-getVideoBitrate)
    - [getAudioBitrate](#meth-getAudioBitrate)
    - [setMaxVideoBitrate](#meth-setMaxVideoBitrate)
    - [setMaxAudioBitrate](#meth-setMaxAudioBitrate)
    - [getMaxVideoBitrate](#meth-getMaxVideoBitrate)
    - [getMaxAudioBitrate](#meth-getMaxAudioBitrate)
    - [setVideoBitrate](#meth-setVideoBitrate)
    - [setAudioBitrate](#meth-setAudioBitrate)
    - [getManualVideoBitrate](#meth-getManualVideoBitrate)
    - [getManualAudioBitrate](#meth-getManualAudioBitrate)
  - [Buffer control](#meth-group-buffer-control)
    - [setWantedBufferAhead](#meth-setWantedBufferAhead)
    - [getWantedBufferAhead](#meth-getWantedBufferAhead)
    - [setMaxBufferBehind](#meth-setMaxBufferBehind)
    - [getMaxBufferBehind](#meth-getMaxBufferBehind)
    - [setMaxBufferAhead](#meth-setMaxBufferAhead)
    - [getMaxBufferAhead](#meth-getMaxBufferAhead)
 - [Buffer information](#meth-group-buffer-info)
    - [getVideoLoadedTime](#meth-getVideoLoadedTime)
    - [getVideoPlayedTime](#meth-getVideoPlayedTime)
    - [getVideoBufferGap](#meth-getVideoBufferGap)
 - [Content information](#meth-group-content-info)
    - [isLive](#meth-isLive)
    - [getUrl](#meth-getUrl)
    - [getCurrentKeySystem](#meth-getCurrentKeySystem)
 - [Deprecated](#meth-group-deprecated)
    - [getManifest (deprecated)](#meth-getManifest)
    - [getCurrentAdaptations (deprecated)](#meth-getCurrentAdaptations)
    - [getCurrentRepresentations (deprecated)](#meth-getCurrentRepresentations)
    - [getImageTrackData (deprecated)](#meth-getImageTrackData)
    - [setFullscreen (deprecated)](#meth-setFullscreen)
    - [exitFullscreen (deprecated)](#meth-exitFullscreen)
    - [isFullscreen (deprecated)](#meth-isFullscreen)
    - [getNativeTextTrack (deprecated)](#meth-getNativeTextTrack)
- [Static properties](#static)
    - [version](#static-version)
    - [ErrorTypes](#static-ErrorTypes)
    - [ErrorCodes](#static-ErrorCodes)
    - [LogLevel](#static-LogLevel)
- [Tools](#tools)
    - [StringUtils](#tools-string-parsing)
    - [TextTrackRenderer](#tools-textTrackRenderer)
    - [Experimental - MediaCapabilitiesProber](#tools-mediaCapabilitiesProber)
    - [Experimental - parseBifThumbnails](#tools-parseBifThumbnails)
    - [Experimental - createMetaplaylist](#tools-createMetaplaylist)



<a name="overview"></a>
## Overview ####################################################################

The RxPlayer has a complete API allowing you to:
  - load and stop contents containing video and/or audio media data
  - control playback (play, pause, seek, etc.) when a content is loaded.
  - get multiple information on the current content and on the player's state.
  - choose a specific audio language, subtitles track video track
  - force a given bitrate
  - update the wanted buffer length to reach
  - and more

The following pages define the entire API.

:warning: Only variables and methods defined here are considered as part of the
API. Any other property or method you might find in any other way are not
considered as part of the API and can thus change without notice.

_Note: As some terms used here might be too foreign or slightly different than
the one you're used to, we also wrote a list of terms and definitions used by
the RxPlayer [here](../terms.md)._



<a name="instantiation"></a>
## Instantiation ##############################################################

Instantiating a new RxPlayer is necessary before being able to load a content.
Doing so is straightforward:
```js
import RxPlayer from "rx-player";
const player = new RxPlayer(options);
```

The options are all... optional. They are all defined in the [Player Options
page](./player_options.md).



<a name="meth-group-basic"></a>
## Basic methods ###############################################################

In this chapter, we will go through the basic methods you will need to use when
playing a content through the RxPlayer.

<a name="meth-loadVideo"></a>
### loadVideo ##################################################################

_arguments_:
  - _options_ (``Object``)

Loads the content described in the argument.

This is the central method to use when you want to play a new content.
The options possible as arguments are all defined in [this
page](./loadVideo_options.md).

Despite its name, this method can also load audio-only content.

#### Example

```js
player.loadVideo({
  url: "http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_6s/Manifest.mpd",
  transport: "dash",
  autoPlay: true,
});
```

<a name="meth-reload"></a>
### reload #####################################################################

_arguments_:
  - _options_ (``Object | undefined``)

Re-load the last loaded content as fast as possible.

This API can be called at any time after a content has been loaded (the LOADED
state has been reached), even if the player has been stopped since and even if
it was due to a fatal error.

The user may need to call this API in several cases. For example, it may be used
in case of an error that will not reproduce or inversely when the error is
consistent at a certain playback time (e.g. due to a specific chunk defect).

The options argument is an object containing :
- _reloadAt_ (``Object | undefined``): The object contain directives about
the starting playback position :
  - _relative_ (``string | undefined``) : start playback relatively from the
  last playback position (last played position before entering into STOPPED or
  ENDED state).
  - _position_ (`string`|`undefined`) : absolute position at which we should
  start playback

If no reload position is defined, start playback at the last playback position.

{'fraction_non_alphanumeric': 0.17100486123930836, 'fraction_numerical': 0.00036920804873546244, 'mean_word_length': 4.90766993820429, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2046516', 'n_tokens_mistral': 5090, 'n_tokens_neox': 4602, 'n_words': 1116}