diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-18 09:46:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-18 10:26:19 +0200 |
commit | 7b3a99d51716e404bdea0cef8d1f994aab0e8aac (patch) | |
tree | f1a07e610a1db0afd9d08083a148381ae1eaf0cf /client/src/assets/player/peertube-videojs-plugin.ts | |
parent | f5a2dc48eb80ab7842cec1da7269b5d153208689 (diff) | |
download | PeerTube-7b3a99d51716e404bdea0cef8d1f994aab0e8aac.tar.gz PeerTube-7b3a99d51716e404bdea0cef8d1f994aab0e8aac.tar.zst PeerTube-7b3a99d51716e404bdea0cef8d1f994aab0e8aac.zip |
Move player local storage functions in their own file
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, 8 insertions, 9 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index b62dcb829..35a347e99 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -4,18 +4,17 @@ 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 { isMobile, videoFileMaxByResolution, videoFileMinByResolution } from './utils' | ||
8 | import * as CacheChunkStore from 'cache-chunk-store' | ||
9 | import { PeertubeChunkStore } from './peertube-chunk-store' | ||
7 | import { | 10 | import { |
8 | getAverageBandwidth, | 11 | getAverageBandwidthInStore, |
9 | getStoredMute, | 12 | getStoredMute, |
10 | getStoredVolume, isMobile, | 13 | getStoredVolume, |
11 | saveAverageBandwidth, | 14 | saveAverageBandwidth, |
12 | saveMuteInStore, | 15 | saveMuteInStore, |
13 | saveVolumeInStore, | 16 | saveVolumeInStore |
14 | videoFileMaxByResolution, | 17 | } from './peertube-player-local-storage' |
15 | videoFileMinByResolution | ||
16 | } from './utils' | ||
17 | import * as CacheChunkStore from 'cache-chunk-store' | ||
18 | import { PeertubeChunkStore } from './peertube-chunk-store' | ||
19 | 18 | ||
20 | const Plugin: VideoJSComponentInterface = videojs.getPlugin('plugin') | 19 | const Plugin: VideoJSComponentInterface = videojs.getPlugin('plugin') |
21 | class PeerTubePlugin extends Plugin { | 20 | class PeerTubePlugin extends Plugin { |
@@ -148,7 +147,7 @@ class PeerTubePlugin extends Plugin { | |||
148 | ) { | 147 | ) { |
149 | // Automatically choose the adapted video file | 148 | // Automatically choose the adapted video file |
150 | if (videoFile === undefined) { | 149 | if (videoFile === undefined) { |
151 | const savedAverageBandwidth = getAverageBandwidth() | 150 | const savedAverageBandwidth = getAverageBandwidthInStore() |
152 | videoFile = savedAverageBandwidth | 151 | videoFile = savedAverageBandwidth |
153 | ? this.getAppropriateFile(savedAverageBandwidth) | 152 | ? this.getAppropriateFile(savedAverageBandwidth) |
154 | : this.pickAverageVideoFile() | 153 | : this.pickAverageVideoFile() |