diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-07 16:50:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-07 16:50:33 +0200 |
commit | 6cca7360eb9027e1544f7513df7da4684061ef7e (patch) | |
tree | 16550f99324234a94cb7cdb098001051400079c9 /client/src/assets/player/peertube-videojs-plugin.ts | |
parent | 09f35e2a6fa71d593c9b22f90109e91fc6be89a1 (diff) | |
download | PeerTube-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.ts | 17 |
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' | |||
4 | import { renderVideo } from './video-renderer' | 4 | import { renderVideo } from './video-renderer' |
5 | import './settings-menu-button' | 5 | import './settings-menu-button' |
6 | import { PeertubePluginOptions, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' | 6 | import { PeertubePluginOptions, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' |
7 | import { getAverageBandwidth, getStoredMute, getStoredVolume, saveAverageBandwidth, saveMuteInStore, saveVolumeInStore } from './utils' | 7 | import { |
8 | import minBy from 'lodash-es/minBy' | 8 | getAverageBandwidth, |
9 | import maxBy from 'lodash-es/maxBy' | 9 | getStoredMute, |
10 | getStoredVolume, | ||
11 | saveAverageBandwidth, | ||
12 | saveMuteInStore, | ||
13 | saveVolumeInStore, | ||
14 | videoFileMaxByResolution, | ||
15 | videoFileMinByResolution | ||
16 | } from './utils' | ||
10 | import * as CacheChunkStore from 'cache-chunk-store' | 17 | import * as CacheChunkStore from 'cache-chunk-store' |
11 | import { PeertubeChunkStore } from './peertube-chunk-store' | 18 | import { 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 () { |