aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-plugin.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-plugin.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts
index 3991e4627..dd9408c8e 100644
--- a/client/src/assets/player/peertube-plugin.ts
+++ b/client/src/assets/player/peertube-plugin.ts
@@ -83,9 +83,15 @@ class PeerTubePlugin extends Plugin {
83 83
84 if (options.stopTime) { 84 if (options.stopTime) {
85 const stopTime = timeToInt(options.stopTime) 85 const stopTime = timeToInt(options.stopTime)
86 const self = this
86 87
87 this.player.on('timeupdate', () => { 88 this.player.on('timeupdate', function onTimeUpdate () {
88 if (this.player.currentTime() > stopTime) this.player.pause() 89 if (self.player.currentTime() > stopTime) {
90 self.player.pause()
91 self.player.trigger('stopped')
92
93 self.player.off('timeupdate', onTimeUpdate)
94 }
89 }) 95 })
90 } 96 }
91 97