diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-15 15:30:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-18 11:37:18 +0200 |
commit | 42b40636991b97fe818007fab19091764fc5db73 (patch) | |
tree | db431787c06ce898d22e91ff771f795219274fc6 /client/src/standalone/videos/embed.ts | |
parent | 654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff) | |
download | PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip |
Add ability for client to create server logs
Diffstat (limited to 'client/src/standalone/videos/embed.ts')
-rw-r--r-- | client/src/standalone/videos/embed.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index c15d4db17..5384ada1c 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts | |||
@@ -6,7 +6,7 @@ import { peertubeTranslate } from '../../../../shared/core-utils/i18n' | |||
6 | import { HTMLServerConfig, LiveVideo, ResultList, VideoDetails, VideoPlaylist, VideoPlaylistElement } from '../../../../shared/models' | 6 | import { HTMLServerConfig, LiveVideo, ResultList, VideoDetails, VideoPlaylist, VideoPlaylistElement } from '../../../../shared/models' |
7 | import { PeertubePlayerManager } from '../../assets/player' | 7 | import { PeertubePlayerManager } from '../../assets/player' |
8 | import { TranslationsManager } from '../../assets/player/translations-manager' | 8 | import { TranslationsManager } from '../../assets/player/translations-manager' |
9 | import { getParamString } from '../../root-helpers' | 9 | import { getParamString, logger } from '../../root-helpers' |
10 | import { PeerTubeEmbedApi } from './embed-api' | 10 | import { PeerTubeEmbedApi } from './embed-api' |
11 | import { AuthHTTP, LiveManager, PeerTubePlugin, PlayerManagerOptions, PlaylistFetcher, PlaylistTracker, VideoFetcher } from './shared' | 11 | import { AuthHTTP, LiveManager, PeerTubePlugin, PlayerManagerOptions, PlaylistFetcher, PlaylistTracker, VideoFetcher } from './shared' |
12 | import { PlayerHTML } from './shared/player-html' | 12 | import { PlayerHTML } from './shared/player-html' |
@@ -31,6 +31,8 @@ export class PeerTubeEmbed { | |||
31 | private playlistTracker: PlaylistTracker | 31 | private playlistTracker: PlaylistTracker |
32 | 32 | ||
33 | constructor (videoWrapperId: string) { | 33 | constructor (videoWrapperId: string) { |
34 | logger.registerServerSending(window.location.origin) | ||
35 | |||
34 | this.http = new AuthHTTP() | 36 | this.http = new AuthHTTP() |
35 | 37 | ||
36 | this.videoFetcher = new VideoFetcher(this.http) | 38 | this.videoFetcher = new VideoFetcher(this.http) |
@@ -43,7 +45,7 @@ export class PeerTubeEmbed { | |||
43 | try { | 45 | try { |
44 | this.config = JSON.parse(window['PeerTubeServerConfig']) | 46 | this.config = JSON.parse(window['PeerTubeServerConfig']) |
45 | } catch (err) { | 47 | } catch (err) { |
46 | console.error('Cannot parse HTML config.', err) | 48 | logger.error('Cannot parse HTML config.', err) |
47 | } | 49 | } |
48 | } | 50 | } |
49 | 51 | ||
@@ -125,7 +127,7 @@ export class PeerTubeEmbed { | |||
125 | async playNextPlaylistVideo () { | 127 | async playNextPlaylistVideo () { |
126 | const next = this.playlistTracker.getNextPlaylistElement() | 128 | const next = this.playlistTracker.getNextPlaylistElement() |
127 | if (!next) { | 129 | if (!next) { |
128 | console.log('Next element not found in playlist.') | 130 | logger.info('Next element not found in playlist.') |
129 | return | 131 | return |
130 | } | 132 | } |
131 | 133 | ||
@@ -137,7 +139,7 @@ export class PeerTubeEmbed { | |||
137 | async playPreviousPlaylistVideo () { | 139 | async playPreviousPlaylistVideo () { |
138 | const previous = this.playlistTracker.getPreviousPlaylistElement() | 140 | const previous = this.playlistTracker.getPreviousPlaylistElement() |
139 | if (!previous) { | 141 | if (!previous) { |
140 | console.log('Previous element not found in playlist.') | 142 | logger.info('Previous element not found in playlist.') |
141 | return | 143 | return |
142 | } | 144 | } |
143 | 145 | ||
@@ -343,5 +345,5 @@ PeerTubeEmbed.main() | |||
343 | .catch(err => { | 345 | .catch(err => { |
344 | (window as any).displayIncompatibleBrowser() | 346 | (window as any).displayIncompatibleBrowser() |
345 | 347 | ||
346 | console.error('Cannot init embed.', err) | 348 | logger.error('Cannot init embed.', err) |
347 | }) | 349 | }) |