aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-07 16:50:33 +0200
committerChocobozzz <me@florianbigard.com>2018-06-07 16:50:33 +0200
commit6cca7360eb9027e1544f7513df7da4684061ef7e (patch)
tree16550f99324234a94cb7cdb098001051400079c9 /client/src/assets/player/peertube-videojs-plugin.ts
parent09f35e2a6fa71d593c9b22f90109e91fc6be89a1 (diff)
downloadPeerTube-6cca7360eb9027e1544f7513df7da4684061ef7e.tar.gz
PeerTube-6cca7360eb9027e1544f7513df7da4684061ef7e.tar.zst
PeerTube-6cca7360eb9027e1544f7513df7da4684061ef7e.zip
Reduce bundle sizes
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index 9babe556a..b54f096b2 100644
--- a/client/src/assets/player/peertube-videojs-plugin.ts
+++ b/client/src/assets/player/peertube-videojs-plugin.ts
@@ -4,9 +4,16 @@ import { VideoFile } from '../../../../shared/models/videos/video.model'
4import { renderVideo } from './video-renderer' 4import { renderVideo } from './video-renderer'
5import './settings-menu-button' 5import './settings-menu-button'
6import { PeertubePluginOptions, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' 6import { PeertubePluginOptions, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
7import { getAverageBandwidth, getStoredMute, getStoredVolume, saveAverageBandwidth, saveMuteInStore, saveVolumeInStore } from './utils' 7import {
8import minBy from 'lodash-es/minBy' 8 getAverageBandwidth,
9import maxBy from 'lodash-es/maxBy' 9 getStoredMute,
10 getStoredVolume,
11 saveAverageBandwidth,
12 saveMuteInStore,
13 saveVolumeInStore,
14 videoFileMaxByResolution,
15 videoFileMinByResolution
16} from './utils'
10import * as CacheChunkStore from 'cache-chunk-store' 17import * as CacheChunkStore from 'cache-chunk-store'
11import { PeertubeChunkStore } from './peertube-chunk-store' 18import { PeertubeChunkStore } from './peertube-chunk-store'
12 19
@@ -339,9 +346,9 @@ class PeerTubePlugin extends Plugin {
339 }) 346 })
340 347
341 // If the download speed is too bad, return the lowest resolution we have 348 // If the download speed is too bad, return the lowest resolution we have
342 if (filteredFiles.length === 0) return minBy(this.videoFiles, 'resolution.id') 349 if (filteredFiles.length === 0) return videoFileMinByResolution(this.videoFiles)
343 350
344 return maxBy(filteredFiles, 'resolution.id') 351 return videoFileMaxByResolution(filteredFiles)
345 } 352 }
346 353
347 private getAndSaveActualDownloadSpeed () { 354 private getAndSaveActualDownloadSpeed () {