filter to Cap the maximum resolution to the screen resolution
This commit is contained in:
parent
b5c4bfd6ac
commit
06aa2726d7
1 changed files with 3 additions and 2 deletions
|
@ -365,8 +365,9 @@ class PeerTubePlugin extends Plugin {
|
||||||
|
|
||||||
if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed()
|
if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed()
|
||||||
|
|
||||||
// Filter videos we can play according to our bandwidth
|
// Filter videos we can play according to our screen resolution and bandwidth
|
||||||
const filteredFiles = this.videoFiles.filter(f => {
|
const filteredFiles = this.videoFiles.filter(f => f.resolution.id <= this.playerElement.width)
|
||||||
|
.filter(f => {
|
||||||
const fileBitrate = (f.size / this.videoDuration)
|
const fileBitrate = (f.size / this.videoDuration)
|
||||||
let threshold = fileBitrate
|
let threshold = fileBitrate
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue