aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-18 09:46:58 +0200
committerChocobozzz <me@florianbigard.com>2018-06-18 10:26:19 +0200
commit7b3a99d51716e404bdea0cef8d1f994aab0e8aac (patch)
treef1a07e610a1db0afd9d08083a148381ae1eaf0cf /client/src/assets/player/peertube-videojs-plugin.ts
parentf5a2dc48eb80ab7842cec1da7269b5d153208689 (diff)
downloadPeerTube-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.ts17
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'
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 { isMobile, videoFileMaxByResolution, videoFileMinByResolution } from './utils'
8import * as CacheChunkStore from 'cache-chunk-store'
9import { PeertubeChunkStore } from './peertube-chunk-store'
7import { 10import {
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'
17import * as CacheChunkStore from 'cache-chunk-store'
18import { PeertubeChunkStore } from './peertube-chunk-store'
19 18
20const Plugin: VideoJSComponentInterface = videojs.getPlugin('plugin') 19const Plugin: VideoJSComponentInterface = videojs.getPlugin('plugin')
21class PeerTubePlugin extends Plugin { 20class 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()