aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared/peertube/peertube-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-15 15:30:14 +0200
committerChocobozzz <me@florianbigard.com>2022-07-18 11:37:18 +0200
commit42b40636991b97fe818007fab19091764fc5db73 (patch)
treedb431787c06ce898d22e91ff771f795219274fc6 /client/src/assets/player/shared/peertube/peertube-plugin.ts
parent654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff)
downloadPeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz
PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst
PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip
Add ability for client to create server logs
Diffstat (limited to 'client/src/assets/player/shared/peertube/peertube-plugin.ts')
-rw-r--r--client/src/assets/player/shared/peertube/peertube-plugin.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts
index a29a0921f..69a7b2d65 100644
--- a/client/src/assets/player/shared/peertube/peertube-plugin.ts
+++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts
@@ -1,5 +1,6 @@
1import debug from 'debug' 1import debug from 'debug'
2import videojs from 'video.js' 2import videojs from 'video.js'
3import { logger } from '@root-helpers/logger'
3import { isMobile } from '@root-helpers/web-browser' 4import { isMobile } from '@root-helpers/web-browser'
4import { timeToInt } from '@shared/core-utils' 5import { timeToInt } from '@shared/core-utils'
5import { VideoView, VideoViewEvent } from '@shared/models/videos' 6import { VideoView, VideoViewEvent } from '@shared/models/videos'
@@ -15,7 +16,7 @@ import {
15import { PeerTubePluginOptions, VideoJSCaption } from '../../types' 16import { PeerTubePluginOptions, VideoJSCaption } from '../../types'
16import { SettingsButton } from '../settings/settings-menu-button' 17import { SettingsButton } from '../settings/settings-menu-button'
17 18
18const logger = debug('peertube:player:peertube') 19const debugLogger = debug('peertube:player:peertube')
19 20
20const Plugin = videojs.getPlugin('plugin') 21const Plugin = videojs.getPlugin('plugin')
21 22
@@ -176,7 +177,7 @@ class PeerTubePlugin extends Plugin {
176 lastCurrentTime = currentTime 177 lastCurrentTime = currentTime
177 178
178 this.notifyUserIsWatching(currentTime, lastViewEvent) 179 this.notifyUserIsWatching(currentTime, lastViewEvent)
179 .catch(err => console.error('Cannot notify user is watching.', err)) 180 .catch(err => logger.error('Cannot notify user is watching.', err))
180 181
181 lastViewEvent = undefined 182 lastViewEvent = undefined
182 183
@@ -249,7 +250,7 @@ class PeerTubePlugin extends Plugin {
249 (this.player as any).cache_.inactivityTimeout = timeout 250 (this.player as any).cache_.inactivityTimeout = timeout
250 this.player.options_.inactivityTimeout = timeout 251 this.player.options_.inactivityTimeout = timeout
251 252
252 logger('Set player inactivity to ' + timeout) 253 debugLogger('Set player inactivity to ' + timeout)
253 } 254 }
254 255
255 private initCaptions () { 256 private initCaptions () {