aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
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()