aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/shared/p2p-media-loader/segment-validator.ts')
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/segment-validator.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts b/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
index f7f83a8a4..18cb6750f 100644
--- a/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
@@ -1,6 +1,7 @@
1import { wait } from '@root-helpers/utils'
2import { Segment } from '@peertube/p2p-media-loader-core'
3import { basename } from 'path' 1import { basename } from 'path'
2import { Segment } from '@peertube/p2p-media-loader-core'
3import { logger } from '@root-helpers/logger'
4import { wait } from '@root-helpers/utils'
4 5
5type SegmentsJSON = { [filename: string]: string | { [byterange: string]: string } } 6type SegmentsJSON = { [filename: string]: string | { [byterange: string]: string } }
6 7
@@ -23,7 +24,7 @@ function segmentValidatorFactory (segmentsSha256Url: string, isLive: boolean) {
23 } 24 }
24 25
25 if (!segmentValue) { 26 if (!segmentValue) {
26 console.log('Refetching sha segments for %s.', filename) 27 logger.info(`Refetching sha segments for ${filename}`)
27 28
28 await wait(1000) 29 await wait(1000)
29 30
@@ -71,7 +72,7 @@ function fetchSha256Segments (url: string) {
71 return fetch(url) 72 return fetch(url)
72 .then(res => res.json() as Promise<SegmentsJSON>) 73 .then(res => res.json() as Promise<SegmentsJSON>)
73 .catch(err => { 74 .catch(err => {
74 console.error('Cannot get sha256 segments', err) 75 logger.error('Cannot get sha256 segments', err)
75 return {} 76 return {}
76 }) 77 })
77} 78}