diff options
-rw-r--r-- | client/src/assets/player/shared/metrics/metrics-plugin.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/client/src/assets/player/shared/metrics/metrics-plugin.ts b/client/src/assets/player/shared/metrics/metrics-plugin.ts index 0e296bef6..2aae3e90a 100644 --- a/client/src/assets/player/shared/metrics/metrics-plugin.ts +++ b/client/src/assets/player/shared/metrics/metrics-plugin.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import videojs from 'video.js' | 1 | import videojs from 'video.js' |
2 | import { PlaybackMetricCreate } from '../../../../../../shared/models' | 2 | import { PlaybackMetricCreate } from '../../../../../../shared/models' |
3 | import { MetricsPluginOptions, PlayerMode, PlayerNetworkInfo } from '../../types' | 3 | import { MetricsPluginOptions, PlayerMode, PlayerNetworkInfo } from '../../types' |
4 | import { logger } from '@root-helpers/logger' | ||
4 | 5 | ||
5 | const Plugin = videojs.getPlugin('plugin') | 6 | const Plugin = videojs.getPlugin('plugin') |
6 | 7 | ||
@@ -99,6 +100,7 @@ class MetricsPlugin extends Plugin { | |||
99 | const headers = new Headers({ 'Content-type': 'application/json; charset=UTF-8' }) | 100 | const headers = new Headers({ 'Content-type': 'application/json; charset=UTF-8' }) |
100 | 101 | ||
101 | return fetch(this.metricsUrl, { method: 'POST', body: JSON.stringify(body), headers }) | 102 | return fetch(this.metricsUrl, { method: 'POST', body: JSON.stringify(body), headers }) |
103 | .catch(err => logger.error('Cannot send metrics to the server.', err)) | ||
102 | }, this.CONSTANTS.METRICS_INTERVAL) | 104 | }, this.CONSTANTS.METRICS_INTERVAL) |
103 | } | 105 | } |
104 | 106 | ||