-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1041 from canalplus/feat/add-memory-size-buffer
Add `maxVideoBufferSize` option to limit the amount of video data (in kilobytes?) the RxPlayer will push on low-end devices
- Loading branch information
Showing
31 changed files
with
611 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
{ | ||
"pages": [ | ||
{ | ||
"path": "./setWantedBufferAhead.md", | ||
"displayName": "setWantedBufferAhead" | ||
}, | ||
{ | ||
"path": "./getWantedBufferAhead.md", | ||
"displayName": "getWantedBufferAhead" | ||
}, | ||
{ | ||
"path": "./setMaxBufferBehind.md", | ||
"displayName": "setMaxBufferBehind" | ||
}, | ||
{ | ||
"path": "./getMaxBufferBehind.md", | ||
"displayName": "getMaxBufferBehind" | ||
}, | ||
{ | ||
"path": "./setMaxBufferAhead.md", | ||
"displayName": "setMaxBufferAhead" | ||
}, | ||
{ | ||
"path": "./getMaxBufferAhead.md", | ||
"displayName": "getMaxBufferAhead" | ||
} | ||
] | ||
} | ||
"pages": [{ | ||
"path": "./setWantedBufferAhead.md", | ||
"displayName": "setWantedBufferAhead" | ||
}, | ||
{ | ||
"path": "./getWantedBufferAhead.md", | ||
"displayName": "getWantedBufferAhead" | ||
}, | ||
{ | ||
"path": "./setMaxBufferBehind.md", | ||
"displayName": "setMaxBufferBehind" | ||
}, | ||
{ | ||
"path": "./getMaxBufferBehind.md", | ||
"displayName": "getMaxBufferBehind" | ||
}, | ||
{ | ||
"path": "./setMaxBufferAhead.md", | ||
"displayName": "setMaxBufferAhead" | ||
}, | ||
{ | ||
"path": "./getMaxBufferAhead.md", | ||
"displayName": "getMaxBufferAhead" | ||
}, | ||
{ | ||
"path": "./setMaxVideoBufferSize.md", | ||
"displayName": "setMaxVideoBufferSize" | ||
}, | ||
{ | ||
"path": "./getMaxVideoBufferSize.md", | ||
"displayName": "getMaxVideoBufferSize" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# getMaxBufferSize | ||
|
||
## Description | ||
|
||
Returns the maximum video buffer memory size limit , in kilobytes. | ||
|
||
This setting can be updated either by: | ||
|
||
- calling the [setMaxVideoBufferSize](./setMaxVideoBufferSize.md) method. | ||
- instanciating an RxPlayer with a `maxVideoBufferSize` property set. | ||
|
||
## Syntax | ||
|
||
```js | ||
const bufferSize = player.getMaxBufferSize(); | ||
``` | ||
|
||
- **return value** `number`: Maximum buffer memory size limit, | ||
in kilobytes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# setMaxVideoBufferSize | ||
|
||
## Description | ||
|
||
Set the maximum memory the video buffer can take up in the memory, in kilobytes | ||
Defaults at `Infinity` | ||
|
||
Once this value is reached, the player won't try to download new video | ||
segments anymore. | ||
|
||
This feature was designed with devices that have limited memory and trying to play very | ||
high bitrates representations in minds. | ||
|
||
However on some custom targets, or just to better control the memory footprint | ||
of the player, you might want to set this limit. | ||
|
||
You can set it to `Infinity` to remove this limit and just let the browser do | ||
this job instead. | ||
|
||
<div class="warning"> | ||
The limit set by `setMaxVideoBufferSize` is approximative, and bypassed in edge case scenarios if we dont have enough buffer because of this limitation. | ||
</div> | ||
|
||
<div class="warning"> | ||
In <i>DirectFile</i> mode (see <a | ||
href="../Loading_a_Content.md#transport">loadVideo options</a>), | ||
this method has no effect. | ||
</div> | ||
|
||
## Syntax | ||
|
||
```js | ||
player.setMaxVideoBufferSize(bufferSize); | ||
``` | ||
|
||
- **arguments**: | ||
|
||
1. _bufferSize_ `number`: Maximum amount of memory the buffer can download, | ||
in kilobytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.