aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared/peertube/peertube-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-12 16:41:29 +0200
committerChocobozzz <me@florianbigard.com>2022-08-16 10:33:27 +0200
commitfd3c2e87051f5029cdec39d877b576a62f48e219 (patch)
treea3c657f178702a3363af680ed8ffb7cd038243b8 /client/src/assets/player/shared/peertube/peertube-plugin.ts
parent0e6cd1c00f71554fe7375a96db693a6983951ba6 (diff)
downloadPeerTube-fd3c2e87051f5029cdec39d877b576a62f48e219.tar.gz
PeerTube-fd3c2e87051f5029cdec39d877b576a62f48e219.tar.zst
PeerTube-fd3c2e87051f5029cdec39d877b576a62f48e219.zip
Add playback metric endpoint sent to OTEL
Diffstat (limited to 'client/src/assets/player/shared/peertube/peertube-plugin.ts')
-rw-r--r--client/src/assets/player/shared/peertube/peertube-plugin.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts
index 69a7b2d65..83c32415e 100644
--- a/client/src/assets/player/shared/peertube/peertube-plugin.ts
+++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts
@@ -144,6 +144,8 @@ class PeerTubePlugin extends Plugin {
144 this.listenFullScreenChange() 144 this.listenFullScreenChange()
145 } 145 }
146 146
147 // ---------------------------------------------------------------------------
148
147 private runUserViewing () { 149 private runUserViewing () {
148 let lastCurrentTime = this.startTime 150 let lastCurrentTime = this.startTime
149 let lastViewEvent: VideoViewEvent 151 let lastViewEvent: VideoViewEvent
@@ -205,6 +207,8 @@ class PeerTubePlugin extends Plugin {
205 return fetch(this.videoViewUrl, { method: 'POST', body: JSON.stringify(body), headers }) 207 return fetch(this.videoViewUrl, { method: 'POST', body: JSON.stringify(body), headers })
206 } 208 }
207 209
210 // ---------------------------------------------------------------------------
211
208 private listenFullScreenChange () { 212 private listenFullScreenChange () {
209 this.player.on('fullscreenchange', () => { 213 this.player.on('fullscreenchange', () => {
210 if (this.player.isFullscreen()) this.player.focus() 214 if (this.player.isFullscreen()) this.player.focus()